A clean starter template for building a REST API with Java 21, Spring Boot 3.3.5, MongoDB, Spring Security, JWT and Swagger/OpenAPI.
- Java 21
- Spring Boot 3.3.5
- Spring Web
- Spring Security
- Spring Data MongoDB
- JJWT 0.11.5
- SpringDoc OpenAPI
- Lombok
- Gradle
- JDK 21+
- MongoDB 6+
- Gradle 8+ (or the included Gradle wrapper, when present)
git clone https://github.com/vsmm-world/spring-boot-3.3.5-starting-template.git
cd spring-boot-3.3.5-starting-template
./gradlew clean build
./gradlew bootRunOn Windows PowerShell use gradlew.bat clean build and gradlew.bat bootRun.
Create src/main/resources/application.properties from the example configuration and set your MongoDB connection and JWT secret. Never commit production secrets.
When the application is running, Swagger UI is available at:
http://localhost:8080/swagger-ui/index.html
src/main/java/
βββ config/
βββ controller/
βββ model/
βββ repository/
βββ service/
βββ security/
βββ Application.java
./gradlew testUse a strong, environment-specific JWT secret. Keep credentials out of Git and use environment variables or a secrets manager for deployed environments.
Ravindra Valand (RV)
GitHub: https://github.com/vsmm-world
MIT