A simple sample of Rest API by Spring Boot with Java 11.
- Gradle Multi Project (With Groovy)
- Lombok
- JUnit 5 Tests
- Spring Security with JWT
- Spring Data JPA with H2 (Memory Mode)
web
: Remoting layerconfig
: Configuration classescontroller
: Rest controllersform
: Request bodiesinterceptor
: Interceptorssecurity
: Utilities for securityviewmodel
: Response bodies
domain
: Business logic and data access layerapplication
: Business logicsconfig
: Configuration classesdto
: DTOssevice
: Service classescommon
: Constants, exception, utilities
domain
: Data accessentity
: Entitiesrepository
: Repositories
- Run server.
./gradlew bootRun
- Import Postman data from below.
/miscs/SpringBootSample.postman_collection.json
- Test with Postman.
Note: Some APIs need JWT on HTTP Request Header(X-AUTH-TOKEN
) and it will be found at HTTP Response Header when successfully logged in.
http://localhost:8080/api/v1/web/swagger-ui/index.html