In this project, I utilize multiple design patterns to achieve optimal readability and scalability.
- CQRS with Event Sourcing: For transaction handling, I employ CQRS with event sourcing to clearly separate commands and queries.
- Command Design Pattern: I leverage the command design pattern alongside the builder pattern to construct precise commands.
- Backend: MySQL is used for the database.
- Integration Testing: I implement integration tests using Testcontainers to fully simulate a real-world environment.
- Docker & Docker Compose: Ensure you have Docker and Docker Compose installed on your machine.
- Start the Application: Run the command
./start.sh
to launch the application easily. - Stop the Application: Use
./stop.sh
to shut down the application. - View Logs: To trace the application logs, use the command
docker compose logs -f spring-boot-app
.
All data logs and MySQL data are stored under the path /home/madara/data/(logs or mysql)
. Feel free to change this path as needed.
- Deposit API:
POST /api/v1/command/deposit
- Query API:
GET /api/v1/query/{userId}
(e.g.,/api/v1/query/1
)
There are two default user IDs:
- ID 1: Enabled user
- ID 12: Suspended user