This is a modern spring boot CRUD application that has a fully functional & secured user management system and it uses rabbitmq for event-driven updates, redis for caching and mysql as a database.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
To build and run the application you need :
There are several ways to run a Spring Boot application on your local machine. One way is to execute the main
method in the com.app.crud.DemoApplication
class from your IDE.
Alternatively you can use the Spring Boot Maven plugin like so:
mvn spring-boot:run
- Create a database in your MySQL instance.
- Update the application.yaml file in the
src/main/resources
folder with the URL, username and password for your MySQL instance. The table schema will be created for you in the database.
Real time event updates are managed in RabbitMQ. Two scenarios here :
# Updating the list when a user is created
# Updating the list when a user is deleted
We are using Redis as our caching system. The configuration in application.yaml remains the same.
We used Swagger to easily generate REST API documentation for our project.
Method | Url | Description |
---|---|---|
GET | /info | info / heartbeat - provided by boot |
GET | /health | application health - provided by boot |
GET | /v2/api-docs | swagger json |
GET | /swagger-ui.html | swagger html |
GET | /api/users/{id} | get user by id |
GET | /api/users | get N users with an offset |
POST | /api/users | create user |
PUT | /api/users/{id} | update user |
DELETE | /api/users/{id} | delete user |
GET | /api/users/me | current user |
POST | /auth/signin | authenticate user |