CloudNest is a Spring Boot based distributed net disk backend. It provides user authentication, file and folder management, upload/download, recycle bin, sharing, quota management and admin APIs.
- Java 17, Spring Boot 3.5
- Spring Security, JWT
- MyBatis-Plus, MySQL 8
- Redis 7
- MinIO object storage
- Springdoc OpenAPI / Swagger
- H2 for local dev and tests
- User registration, login, logout and password change
- JWT authentication with token blacklist support
- Folder create, rename, move, tree and recursive recycle
- File list, detail, search, sort, rename, move and batch delete
- Simple upload with MD5 verification
- MD5 instant upload with storage reference counting
- Chunk upload with resume, local temp chunks, merge, MD5 verification and cleanup
- Single file download, folder zip download and batch zip download
- Preview by presigned URL, with text file content preview
- Recycle bin list, restore, purge, clear and scheduled expired cleanup
- Share create, extract code verification, cancel, public access, save to own drive and download
- Quota accounting for upload, instant upload, share save and purge
- Admin user management, quota adjustment, statistics, share list, operation logs and system config
- Swagger API documentation
src/main/java/com/clouddrive
common common models, exceptions, annotations and utilities
config security, MyBatis, MinIO, Redis, scheduling and OpenAPI config
infrastructure Redis and MinIO adapters
module/auth registration, login, logout and password APIs
module/user profile and quota APIs
module/file folder, file, upload, media and recycle bin APIs
module/share sharing APIs
module/admin admin APIs
module/operation operation log persistence
src/main/resources/db
schema.sql database schema
data.sql default seed users
Start infrastructure first:
docker compose up -dRun the API:
./mvnw spring-boot:runOn Windows PowerShell:
.\mvnw.cmd spring-boot:rundocker-compose.yml starts MySQL, Redis, MinIO and the API service:
./mvnw -DskipTests package
docker compose up -dOn Windows PowerShell:
.\mvnw.cmd -DskipTests package
docker compose up -dMySQL runs schema.sql and data.sql on first container initialization. If you already have an existing mysql_data volume, remove it before reinitializing the schema.
Initialization SQL is under src/main/resources/db.
The dev profile uses H2 and initializes automatically. The default profile targets MySQL and expects the cloud_drive database from Docker Compose.
- Admin:
admin / admin123456 - User:
test / test123456
- API health: http://localhost:8080/actuator/health
- Swagger UI: http://localhost:8080/swagger-ui/index.html
- OpenAPI JSON: http://localhost:8080/v3/api-docs
- MinIO Console: http://localhost:9001
- MinIO default login:
minioadmin / minioadmin
- Login with
test / test123456. - Create a folder with
POST /api/folders. - Upload a small file with
POST /api/upload/simple. - Download it with
GET /api/files/{id}/download. - Create a share with
POST /api/shares. - Visit share info with
GET /api/shares/public/{shareCode}. - Save the share to another account with
POST /api/shares/public/{shareCode}/save. - Delete a file and restore or purge it from
/api/recycle-bin.
./mvnw testThe tests run against H2 and mock external MinIO/Redis behavior where needed.
Main configuration lives in src/main/resources/application.yml.
Common environment variables:
MYSQL_HOST,MYSQL_PORT,MYSQL_USER,MYSQL_PASSWORDREDIS_HOST,REDIS_PORT,REDIS_PASSWORDMINIO_ENDPOINT,MINIO_ACCESS_KEY,MINIO_SECRET_KEY,MINIO_BUCKETJWT_SECRET,JWT_EXPIRE_SECONDSUPLOAD_MAX_FILE_SIZE_MB,UPLOAD_CHUNK_SIZE_MBRECYCLE_BIN_KEEP_DAYS,DEFAULT_USER_QUOTA_BYTES
No frontend screenshots are included. Use Swagger UI for API demonstration.