Răsfoiți Sursa

Add backend package.json and config template

k4be 7 ore în urmă
părinte
comite
e38d173583

+ 5 - 0
gpx-vis-backend/.gitignore

@@ -0,0 +1,5 @@
+node_modules/
+config.js
+data/
+temp/
+*.log

+ 29 - 0
gpx-vis-backend/config.example.js

@@ -0,0 +1,29 @@
+module.exports = {
+  port: 3000,
+  // Set to the path where frontend is served, e.g. '/gpx' or '/'
+  basePath: '/',
+  database: {
+    // type: 'sqlite' | 'mysql' | 'mariadb'
+    type: 'sqlite',
+    // SQLite only:
+    storage: './data/gpx-vis.db',
+    // MySQL/MariaDB (fill in if not using SQLite):
+    // host: 'localhost',
+    // port: 3306,
+    // database: 'gpx_vis',
+    // username: 'root',
+    // password: 'password',
+  },
+  jwt: {
+    secret: 'CHANGE_THIS_TO_A_RANDOM_SECRET',
+    expiresIn: '7d',
+  },
+  upload: {
+    maxFileSizeMB: 50,
+    tempDir: './temp',
+  },
+  cors: {
+    // Origin of the frontend, e.g. 'http://localhost:8080' or '*'
+    origin: '*',
+  },
+};

+ 22 - 0
gpx-vis-backend/package.json

@@ -0,0 +1,22 @@
+{
+  "name": "gpx-vis-backend",
+  "version": "1.0.0",
+  "description": "GPX track visualization backend",
+  "main": "index.js",
+  "scripts": {
+    "start": "node index.js",
+    "dev": "node --watch index.js"
+  },
+  "dependencies": {
+    "express": "^4.18.2",
+    "sequelize": "^6.35.2",
+    "sqlite3": "^5.1.7",
+    "mysql2": "^3.7.1",
+    "bcryptjs": "^2.4.3",
+    "jsonwebtoken": "^9.0.2",
+    "multer": "^1.4.5-lts.1",
+    "xml2js": "^0.6.2",
+    "compression": "^1.7.4",
+    "cors": "^2.8.5"
+  }
+}