Spring Boot 4 multi-module template for an online cloud storage service. Modules split into domain, repository, web-api, and application, with OpenAPI, MinIO client, OAuth2 login, Redis caching, and Postgres persistence.
- Java 17+, Maven Wrapper (
./mvnw/mvnw.cmd), Node 18+ (for Husky hooks), Docker/Docker Compose. - Running services: Postgres, Redis, MinIO. A default compose stack is provided.
npm install # installs husky hooks
docker compose up -d # start Postgres/Redis/MinIO
./mvnw clean verify # build and run tests
./mvnw -pl application spring-boot:run # start the appWindows users can substitute mvnw.cmd for ./mvnw.
pom.xmlroot aggregator and shared dependency management (Spotless, Checkstyle).domain/: JPA entities/value objects (e.g.,FileItem,StorageSource,User).repository/: Spring Data JPA repositories.web-api/: Controllers/services, storage adapters, API docs.application/: Boot app wiring, security/OAuth2, configs, resources.compose.yaml: Local Postgres/Redis/MinIO..husky/,package.json: Git hooks and format/lint scripts.
- Full build:
./mvnw clean verify - Module-scoped:
./mvnw -pl web-api test(swap module as needed) - Format:
npm run fmt(Spotless apply), check only:npm run fmt:check - Lint:
npm run lint(Checkstyle). Non-zero exit indicates style issues.
- App:
./mvnw -pl application spring-boot:run - Jar:
java -jar application/target/application-*.jarafter packaging. - Services:
docker compose psto confirm Postgres/Redis/MinIO are healthy. Default ports: 5432, 6379, 9000/9001.
- Copy
.envas needed; keep secrets out of VCS. Override DB/MinIO/OAuth credentials via environment variables or Spring profiles. - Jackson and security are preconfigured in
applicationmodule; adjust inapplication/src/main/java/org/superwindcloud/cloud_disk/*Config.java.
- Follow Google Java Format and Checkstyle (CI-failing). Run format before commits.
- Commit messages: short imperative, add module scope when useful (e.g.,
web-api: add upload policy). - Include test evidence and any API examples/screenshots in PR descriptions; link issues and note config or schema changes.***