feat: initialize Express application with middleware and routes

- Set up Express application in src/app.ts with CORS, JSON parsing, and logging.
- Implement health check route.
- Add authentication, product, and order routes.
- Create error handling middleware for centralized error management.

feat: add authentication middleware with placeholder endpoints

- Implement /register and /login routes in src/middleware/auth.middleware.ts with 501 status responses.

feat: create error handling middleware

- Add error handling middleware in src/middleware/error.middleware.ts to manage errors and send appropriate responses.

feat: implement server startup logic

- Create server entry point in src/server.ts to connect to the database and start the Express server.

feat: add JWT utility functions for token signing and verification

- Implement JWT signing and verification functions in src/utils/jwt.ts with payload interface for user roles.
This commit is contained in:
2026-01-12 23:24:43 +03:00
parent 9e65d2f2d5
commit 95c24b9925
7 changed files with 386 additions and 64 deletions
+8 -1
View File
@@ -18,18 +18,25 @@
"license": "ISC",
"packageManager": "[email protected]",
"dependencies": {
"cors": "^2.8.5",
"dotenv": "^17.2.3",
"express": "^5.2.1",
"mongoose": "^9.1.3"
"express-rate-limit": "^8.2.1",
"mongoose": "^9.1.3",
"morgan": "^1.10.1"
},
"devDependencies": {
"@eslint/js": "^9.39.2",
"@eslint/json": "^0.14.0",
"@eslint/markdown": "^7.5.1",
"@types/cors": "^2.8.19",
"@types/express": "^5.0.6",
"@types/jsonwebtoken": "^9.0.10",
"@types/morgan": "^1.9.10",
"@types/node": "^25.0.6",
"eslint": "^9.39.2",
"globals": "^17.0.0",
"jsonwebtoken": "^9.0.3",
"nodemon": "^3.1.11",
"prettier": "^3.7.4",
"ts-node": "^10.9.2",