Spring Boot codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API.
This codebase was created to demonstrate a fully fledged backend application built with Spring Boot including CRUD operations, authentication, routing, pagination, and more.
We've gone to great lengths to adhere to the Spring Boot community styleguides & best practices.
For more information on how to this works with other frontends/backends, head over to the RealWorld repo.
- It uses a Modular Monolith architecture with clearly defined boundaries and independent modules (users, profiles, and articles).
- It uses Spring Security and Keycloak for user registration, authentication, and authorization. It provides good examples of usage of the Keycloak Admin REST Client, including User creation and JWT generation (See).
- Both Keycloak and the Realworld backend application use PostgreSQL as their database/datasource. The Realworld backend application uses Jakarta Persistence (JPA) as an object/relational mapping facility (ORM).
- It handles exceptions in a centralized way, extending the ResponseEntityExceptionHandler class.
- Run
cp .env.template .env
. The.env
file contains the environment variables used by both Keycloak and the Realworld backend application, including secrets.
Follow the documentation
- Run
docker compose up
. - When you register or update an user, you can see it listed and also it's details on the Keycloak admin console.