Skip to content

Conversation

@k5101998
Copy link

@mykolasolodukha Here is Proposed Architecture and basic Implementation. Please have a look at it and let me know your thoughts. Thanks.

  1. File Storage Service Layer
  • Extend the existing BaseStorageService to handle general files, not just images
  • Support multiple storage backends (S3, Azure Blob Storage, Local FileSystem)
  • Implement chunked file uploads for large files
  • Add file metadata handling (size, type, created date, etc.)
  1. API Endpoints
  • /api/files/upload - For file uploads (multipart/form-data)
  • /api/files/download/{file_id} - For file downloads
  • /api/files/{file_id} - For file metadata
  • /api/files - For listing files
  1. Database Schema
  • Create a new File model to store file metadata
  • Include fields for: id, filename, size, mime_type, storage_location, created_at, etc.
  1. Security & Performance
  • Implement file type validation
  • Add file size limits
  • Use streaming responses for large files
  • Add rate limiting
  • Implement authentication/authorization

TODO:

  1. Implement Cloud Storage
  • Add S3 storage implementation
  • Add Azure Blob storage implementation
  • Implement URL signing for direct downloads
  1. Add Advanced Features
  • File type detection
  1. Add authentication/authorization
  • Implement rate limiting
  • Add file encryption
  • Set up CORS policies
  1. Performance Optimizations
  • Add caching layer
  • Implement background processing for large files
  • Add compression

@samonaisi samonaisi deleted the branch CyberCRI:main March 11, 2025 15:16
@samonaisi samonaisi closed this Mar 11, 2025
@samonaisi samonaisi reopened this Mar 11, 2025
@samonaisi samonaisi changed the base branch from feature/api-server to main March 11, 2025 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants