Image Manager - Backend Server
Node.js/Express backend for the Image Manager System with JWT authentication and image compression.
Features
- JWT-based authentication
- Role-based access control (HR, SLIP)
- Image upload and compression
- File management API
- ZIP file creation
- Auto-delete functionality
Installation
npm install
Configuration
Create a .env file with:
PORT=5000
JWT_SECRET=your_secret_key
JWT_EXPIRE=7d
NODE_ENV=development
MAX_FILE_SIZE=50000000
COMPRESSION_QUALITY=80
Running
# Production
npm start
# Development with auto-reload
npm run dev
API Endpoints
Auth
POST /api/auth/signup- RegisterPOST /api/auth/login- Login
Files
GET /api/files/list- Get source imagesGET /api/files/outputs- Get compressed imagesPOST /api/files/upload- Upload imagePOST /api/files/upload-multiple- Bulk uploadPOST /api/files/compress/:filename- CompressPOST /api/files/compress-multiple- Batch compressGET /api/files/download/:filename- DownloadPOST /api/files/download-zip- Download ZIPDELETE /api/files/delete/:filename- Delete
Dependencies
- express
- cors
- jsonwebtoken
- bcryptjs
- sharp
- multer
- archiver
- dotenv
Port
Default: 5000