-
Notifications
You must be signed in to change notification settings - Fork 116
Closed
Labels
BackendNestJSStellar WaveIssues in the Stellar wave programIssues in the Stellar wave programgood first issueGood for newcomersGood for newcomers
Description
Description:
Build a comprehensive file upload service supporting profile pictures, documents, receipts, and biometric images with AWS S3/CloudFlare R2 storage, image optimization, and CDN integration.
Acceptance Criteria:
- POST /api/files/upload endpoint - Upload single file
- POST /api/files/upload-multiple endpoint - Upload multiple files
- GET /api/files/:id endpoint - Get file metadata
- GET /api/files/:id/download endpoint - Download file
- DELETE /api/files/:id endpoint - Delete file
- Support file types: images (JPEG, PNG, WebP), PDFs, documents (DOC, DOCX)
- File size limits: Images (5MB), Documents (10MB), PDFs (20MB)
- Image optimization (compression, resizing, format conversion)
- Generate thumbnails for images (3 sizes: small, medium, large)
- Virus scanning with ClamAV
- Store files in AWS S3 or CloudFlare R2
- Generate signed URLs for private files (1-hour expiry)
- CDN integration for public files
- Track file metadata (size, mime type, uploader, upload date)
- Automatic cleanup of orphaned files (30 days)
- Rate limiting (20 uploads per hour per user)
Technical Requirements:
- Use
@nestjs/platform-expresswith Multer - Use
@aws-sdk/client-s3for S3 operations - Use
sharpfor image processing - Use
file-typefor MIME type detection - Use
clamscanfor virus scanning - Implement streaming for large files
- Create custom validators for file types and sizes
Files to Create:
backend/src/
├── files/
│ ├── files.module.ts
│ ├── files.controller.ts
│ ├── files.service.ts
│ ├── storage/
│ │ ├── storage.interface.ts
│ │ ├── s3-storage.service.ts
│ │ └── local-storage.service.ts (for development)
│ ├── processors/
│ │ ├── image-processor.service.ts
│ │ └── virus-scanner.service.ts
│ ├── validators/
│ │ ├── file-type.validator.ts
│ │ └── file-size.validator.ts
│ ├── dto/
│ │ ├── upload-file.dto.ts
│ │ └── file-filter.dto.ts
│ ├── entities/
│ │ └── file.entity.ts
│ └── decorators/
│ └── file-upload.decorator.ts
└── config/
└── storage.config.ts
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BackendNestJSStellar WaveIssues in the Stellar wave programIssues in the Stellar wave programgood first issueGood for newcomersGood for newcomers