The Reports microservice is responsible for managing purchase reports in the database. Its main function is to register and manage reports for users who have made a purchase, providing an efficient and scalable API for report management.
This service follows a hexagonal architecture, ensuring a clear separation between business logic and infrastructure layers. Additionally, it integrates with other microservices, such as the Transaction service, to retrieve purchased items.
To run the Reports microservice, follow these steps:
git clone https://github.com/julian98789/reports_microservice.git
cd reports_microserviceAdd the database connection in the application-dev.properties file with the following fields:
spring.data.mongodb.uri=mongodb://<YOUR_CONNECTION_URL>
spring.data.mongodb.username=<YOUR_USERNAME>
spring.data.mongodb.password=<YOUR_PASSWORD>
Add the JWT secret key in the following field of the application-dev.properties file:
JWT_SECRET_KEY=<YOUR_JWT_SECRET_KEY>
Run the microservice locally with the following command:
gradle bootRunCreate a .env file in the root of the project and add the following fields:
JAVA_APP_PORT=<YOUR_SERVICE_PORT>
MONGO_INITDB_ROOT_PASSWORD=<YOUR_MONGO_PASSWORD>
MONGO_PORT=<YOUR_MONGO_PORT>
MONGO_INITDB_DATABASE=<YOUR_DATABASE_NAME>
MONGO_INITDB_ROOT_USERNAME=<YOUR_MONGO_USERNAME>
JWT_SECRET_KEY=<YOUR_JWT_SECRET_KEY>
Activate the prod profile in the following field of the application.properties file:
spring.profiles.active=prod
Run the following commands to start the containers:
docker-compose up --build -dTo stop the containers:
docker-compose downThis project uses the following technologies for its development:
- Description: A framework for building Java applications quickly and easily.
- Documentation: Spring Boot Documentation
- Description: A platform that allows packaging applications and their dependencies into containers.
- Documentation: Docker Documentation
- Description: A NoSQL database that uses a document-oriented data model, allowing for flexible and scalable data storage.
- Documentation: MongoDB Documentation
This project consists of several microservices that work together. Below are the links to each of them:
- Reports Microservice: reports_microservice
- Stock Microservice: stock_microservice
- User Microservice: user_microservice
- Shopping Cart Microservice: shopping_cart_microservice
- Transaction Microservice: transaction_microservice