A secure cloud storage REST API built with Spring Boot that enables authenticated users to upload, organize, share, and manage files with JWT authentication, storage quotas, content deduplication, and secure public sharing.
- User registration and login using JWT authentication
- Stateless authentication with Spring Security
- Upload, download, rename and delete files
- Nested folder hierarchy with recursive traversal
- SHA-256 based file deduplication to reduce disk usage
- Per-user storage quota enforcement (10 GB default)
- Secure public file sharing using token-based links
- Configurable share link expiration (24 hours by default)
- Per-IP rate limiting using Bucket4j
- Centralized exception handling with consistent JSON responses
- OpenAPI documentation with Swagger UI
| Technology | Details |
|---|---|
| Language | Java 21 |
| Framework | Spring Boot 4.1.0 |
| Security | Spring Security (JWT Authentication + BCrypt) |
| Database | PostgreSQL (Neon) |
| ORM | Spring Data JPA / Hibernate |
| Documentation | SpringDoc OpenAPI (Swagger UI) |
| Rate Limiting | Bucket4j |
| Storage | Local Filesystem (metadata stored in PostgreSQL) |
| Build Tool | Maven |
| Containerization | Docker |
- Java 21
- Maven
git clone https://github.com/your-username/FileNest.git
cd FileNest./mvnw spring-boot:runSwagger UI
http://localhost:8080/swagger-ui.html
Response
Response
Response
Response
Response
| Method | Endpoint | Authentication | Description |
|---|---|---|---|
| POST | /auth/register |
No | Register a new user |
| POST | /auth/login |
No | Login |
| POST | /auth/logout |
Yes | Logout |
| GET | /users/me |
Yes | Current user profile |
| POST | /files/upload |
Yes | Upload file |
| GET | /files |
Yes | List root files |
| GET | /files/{id}/download |
Yes | Download file |
| PUT | /files/{id}/rename |
Yes | Rename file |
| DELETE | /files/{id} |
Yes | Delete file |
| POST | /files/{id}/share |
Yes | Generate share link |
| GET | /share/{token} |
No | Download shared file |
| POST | /folders |
Yes | Create folder |
| GET | /folders |
Yes | List root folders |
| GET | /folders/{id} |
Yes | Get folder recursively |
- JWT-based authentication
- BCrypt password hashing
- Spring Security
- Bucket4j rate limiting
- Secure share tokens
- Input validation
- Global exception handling











