Automated Action 4c4d27fee9 Add file upload functionality to authentication service
- Add multer, mime-types, and sharp packages for file handling
- Create upload middleware with file validation and security
- Implement file and avatar upload controllers
- Add image processing with automatic avatar resizing to 200x200px
- Create upload routes for multiple file types and avatars
- Configure storage locations in /app/storage/uploads and /app/storage/avatars
- Add file type validation (images, PDFs, documents)
- Implement file size limits (10MB general, 5MB avatars)
- Add protected and public endpoints for file management
- Update README with comprehensive upload API documentation

New endpoints:
- POST /api/v1/upload/files - Upload multiple files (protected)
- POST /api/v1/upload/avatar - Upload user avatar (protected)
- GET /api/v1/upload/files - List files (protected)
- GET /api/v1/upload/files/:filename - Download file (public)
- GET /api/v1/upload/avatars/:filename - Get avatar (public)
- DELETE /api/v1/upload/files/:filename - Delete file (protected)
2025-06-27 09:59:20 +00:00

48 lines
1.1 KiB
JSON

{
"name": "user-authentication-service",
"version": "1.0.0",
"description": "A Node.js Express-based user authentication service with JWT and SQLite",
"main": "src/server.js",
"scripts": {
"start": "node src/server.js",
"dev": "nodemon src/server.js",
"migrate": "sequelize-cli db:migrate",
"migrate:undo": "sequelize-cli db:migrate:undo",
"seed": "sequelize-cli db:seed:all",
"lint": "eslint src/",
"lint:fix": "eslint src/ --fix"
},
"keywords": [
"nodejs",
"express",
"authentication",
"jwt",
"sqlite",
"sequelize"
],
"author": "BackendIM",
"license": "MIT",
"dependencies": {
"express": "^4.18.2",
"sequelize": "^6.35.2",
"sqlite3": "^5.1.6",
"bcryptjs": "^2.4.3",
"jsonwebtoken": "^9.0.2",
"cors": "^2.8.5",
"helmet": "^7.1.0",
"express-validator": "^7.0.1",
"express-rate-limit": "^7.1.5",
"dotenv": "^16.3.1",
"multer": "^1.4.5-lts.1",
"mime-types": "^2.1.35",
"sharp": "^0.33.1"
},
"devDependencies": {
"nodemon": "^3.0.2",
"eslint": "^8.55.0",
"sequelize-cli": "^6.6.2"
},
"engines": {
"node": ">=16.0.0"
}
}