[]
(https://github.com/hetacz/[]
(https://github.com/hetacz/HowToSelenium/actions/workflows/gradle.yml)/actions/workflows/workflow.yml)
This is a sample application that demonstrates the use of Spring Boot to manage a simple MySQL database of products.
It also allows for WebSocket subscription to some events.
Type docker-compose up in the root directory of the project.
This will start a MySQL database and a Spring Boot application.
Go to localhost:8080 to subscribe via STOMP to events from the application.
Database called 'Products' is exposed on port 3306 with username root and password qwe123.
Add and remove products from the database using the REST API.
Each product has a name, description and price, created and modifed date as well as categories.
Categories are stored in a separate table and are referenced by the product table.
Their relation is many to many.
Subscribe to events from the application using WebSocket.
The application will send a message to the client when a product, or a category is added or removed from the database.
MySQL database is used to store the data.
Products database is exposed on port 3306 with username root and password qwe123.
It contains Product, Category and Product_Categories tables.
Endpoints are exposed on port 8080, behind api prefix.
There are main two endpoints: /products and /categories.
Swagger documentation is available at localhost:8080/swagger-ui.html.
Unit tests use a different profile and in memory database.
Caching is enabled for the REST API.
The application uses Lombok to reduce boilerplate code.
Some data is validated using jakarta.validation annotations.
Logs are stored in /logs directory, with old log file being compressed.
This is incomplete list of endpoints.
It only contains the most important ones.
/api/products/GET- get all productsPOST- add a product
/{id}GET- get a product by idPUT- update a product by idDELETE- delete a product by id
/batchPOST- add multiple productsDELETE- delete multiple products
/specificGET- get specific product using range of filters
/api/categories/GET- get all categoriesPOST- add a category
/{id}GET- get a category by idPUT- update a category by idDELETE- delete a category by id
/batchPOST- add multiple categoriesDELETE- delete multiple categories
- Tests
- Add more tests
- Add integration tests
- Security
- Add more endpoints
- Add more validation
- Add more documentation
- Add more logging
- Add more caching