first commit

This commit is contained in:
Gitea
2026-06-24 16:07:39 +05:30
commit 38c43c1cbb
11 changed files with 3837 additions and 0 deletions
+72
View File
@@ -0,0 +1,72 @@
# 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
```bash
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
```bash
# Production
npm start
# Development with auto-reload
npm run dev
```
## API Endpoints
### Auth
- `POST /api/auth/signup` - Register
- `POST /api/auth/login` - Login
### Files
- `GET /api/files/list` - Get source images
- `GET /api/files/outputs` - Get compressed images
- `POST /api/files/upload` - Upload image
- `POST /api/files/upload-multiple` - Bulk upload
- `POST /api/files/compress/:filename` - Compress
- `POST /api/files/compress-multiple` - Batch compress
- `GET /api/files/download/:filename` - Download
- `POST /api/files/download-zip` - Download ZIP
- `DELETE /api/files/delete/:filename` - Delete
## Dependencies
- express
- cors
- jsonwebtoken
- bcryptjs
- sharp
- multer
- archiver
- dotenv
## Port
Default: 5000