This repository implements a layered architecture, promoting separation of concerns and maintainability. Below you'll find an overview of the architecture, instructions to run the project, and useful links for testing and code coverage.
The project follows a layered architecture pattern, structured as:
- Rest Layer: Handles HTTP requests/responses (e.g., controllers).
- Application Service Layer: Contains software logic, orchestrates operations over domain service layer.
- Domain Service Layer: Contains business logic, orchestrates operations, and communicates between layers.
- Data Access Layer: Manages persistence operations (e.g., repositories).
This approach ensures that each layer has a distinct responsibility, making the application easier to test and extend.
- Java: 21
- Spring Boot: 3.5.4
- Maven: 3.8
-
Clone the repository:
git clone https://github.com/iliojunior/transactions-test.git cd transactions-test -
Build and run the application:
# Using docker with docker-compose # Does not work on Windows chmod +X run.sh ./run.sh
on Windows use:
docker compose -f others/docker/docker-compose.yaml up -d
-
Access the application:
- The app typically runs on http://localhost:8080.
-
Jacoco Coverage Report:
After running tests (mvn clean test), open the Coverage Report -
Postman Collection:
Import the provided Postman collection and environment for API testing:
others/postman
The docker build is done two steps:
- Maven build: Executes
mvn clean package -DskipTeststo package application. - Application image: Copies the generated jar from previous steps and run in
java -jar app.jar.
-
Run tests:
mvn clean test -
View Jacoco report:
Opentarget/site/jacoco/index.htmlin your browser after running tests.
- Make sure you have Java and Maven installed for development mode.
- make sure you have Docker installed supporting compose standard run.
- For API interactions, use the provided Postman collection for accurate request formats.