RealWorld spec and API.Spring boot + MyBatis codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the
This codebase was created to demonstrate a fully fledged fullstack application built with Spring boot + Mybatis including CRUD operations, authentication, routing, pagination, and more.
For more information on how to this works with other frontends/backends, head over to the RealWorld repo.
How it works
The application uses Spring boot (Web, Mybatis).
- Use the idea of Domain Driven Design to separate the business term and infrastruture term.
- Use MyBatis to implement the Data Mapper pattern for persistence.
- Use CQRS pattern to separate the read model and write model.
And the code organize as this:
apiis the web layer to implement by Spring MVC
coreis the business model including entities and services
applicationis the high level services for query with the data transfer objects
infrastructurecontains all the implementation classes as the technique details
Integration with Spring Security and add other filter for jwt token process.
The secret key is stored in
It uses a H2 in memory database (for now), can be changed easily in the
application.properties for any other database.
You need Java installed.
./gradlew bootRun open http://localhost:8080
You need Docker installed.
docker-compose up -d
The repository contains a lot of test cases to cover both api test and repository test.
Please fork and PR to improve the code.