This project was derived from the Spring Guides project for accessing MySQL data with Spring Boot. The original project can be found here. It has been modified to include additional features and to be used as a playground for testing exercises. For example, to practice unit tests, integration tests and system tests through a different project. See backend-playground-tests. Finally, this project can also be used for testing CI/CD pipelines.
The project currently uses Java 17 with Maven for builds. The service is a Spring Boot application that uses a MySQL database for persistence. It includes Docker files for running the application and the database in containers. This is not intended to be a production-ready application, but rather a simple example for testing purposes. For example, it has no security, no logging, no environment configurations (for example, for PROD), etc. These may be added later.
Ensure you have Docker installed on your machine. You can download Docker Desktop from here. You will also need to set environment variables for your desired values for DB_USER, DB_ROOT_PASSWORD and DB_PASSWORD (for MySQL configuration).
To package the application, run the following command:
mvn clean package
To run the application in Docker containers, run the following command:
docker-compose --profile full up