This project demonstrates a robust and scalable backend service for secure file management built using Spring Boot and MySQL. It implements a fully functional RESTful API that supports secure file upload, retrieval, and metadata handling with high performance and reliability.
Designed following enterprise architecture principles, the system uses modular abstraction through Controller, Service, Repository, and Entity layers, ensuring clean separation of concerns and easy extensibility.
- Optimized File Processing: Supports large file uploads with configurable multipart streaming parameters.
- Database-Backed Storage: Files are stored directly in the database as BLOBs using JPA and Hibernate to maintain consistency and data integrity.
- Dynamic Download Endpoints: Uses
ServletUriComponentsBuilderfor generating download URIs with automatic MIME type detection. - Comprehensive Error Handling: Implements a custom exception hierarchy and standardized HTTP response models.
- Cloud-Ready Design: Can be extended to integrate with AWS S3, Google Cloud Storage, or Azure Blob Storage for hybrid or distributed persistence strategies.
- Transaction Management: Adheres to Spring’s transaction management best practices for data safety.
- Maintainable Architecture: Clean layering makes it suitable for microservices or containerized environments.
| Category | Technology |
|---|---|
| Backend Framework | Spring Boot (REST, Web, JPA, Validation) |
| Database | MySQL |
| ORM | Hibernate |
| Utilities | Lombok, Servlet API, ByteArrayResource |
| Testing Tools | Postman / cURL |
| Programming Language | Java 11+ |
The application follows a multi-tier architecture ensuring modularity and scalability.
Controller → Service → Repository → Database
Controller: Handles HTTP requests and maps them to corresponding service methods. Service: Contains business logic, validation, and exception handling. Repository: Manages database operations via Spring Data JPA. Entity: Defines database schema with optimized BLOB field mappings.
# File Upload Configuration
spring.servlet.multipart.enabled=true
spring.servlet.multipart.max-file-size=200MB
spring.servlet.multipart.max-request-size=215MB
# Database Configuration
spring.datasource.url=jdbc:mysql://localhost:3306/file_db
spring.datasource.username=root
spring.datasource.password=root
spring.jpa.hibernate.ddl-auto=updategit clone https://github.com/SAdhikary2/uploadify.gitEdit the application.properties file with your MySQL credentials.
mvn spring-boot:runUse Postman or cURL to verify file upload and download functionality.
Upload Example:
curl -F "file=@path/to/yourfile.txt" http://localhost:8080/uploadDownload Example:
curl -O http://localhost:8080/download/{fileId}src/
├── main/
│ ├── java/com/example/filemanager/
│ │ ├── controller/
│ │ ├── service/
│ │ ├── repository/
│ │ └── entity/
│ └── resources/
│ └── application.properties
└── test/
- Integration with AWS S3, Azure Blob, or GCP Cloud Storage
- JWT-based authentication and access control
- Docker containerization for deployment
- File versioning and metadata management
- Asynchronous processing using Kafka or RabbitMQ
Sukalyan Adhikary | Full Stack Developer — Spring Boot | React | MySQL