This repository demonstrates a microservices architecture using Docker Compose. The system consists of three microservices:
- Spring Boot Service(
springboot-service
) - Stats Service(
stats-service
) - Logs Service(
logs-service
)
The services interact with a MySQL database to provide functionality for capturing and managing data related to animal visits and veterinarians.
Before running the application, ensure the following are installed:
Follow these steps to run the microservices:
-
Clone the Repository:
git clone https://github.com/Agusioma/circleci-microservices-unit-testing-demo.git cd circleci-microservices-unit-testing-demo
-
Start the Docker Containers: Run the following command to start all services:
docker-compose up --build
This command will build the images for each service and start the containers. The services will be accessible after the containers are fully initialized.
- Endpoint: http://localhost:8080
- Use this service to add and manage visits and veterinarians.
- Add a new visit: http://localhost:8080/visits/new
- Add a new veterinarian: http://localhost:8080/veterinarians/new
- Endpoint: http://localhost:8000/chart
- This service provides aggregated statistics based on the data collected using a pie chart.
- Internal Usage Only: The logs service is called internally by the Spring Boot Service to log data.
- Endpoint:
logs-service:5001/api/logs
- It records logs whenever a new veterinarian or animal visit is added.
To stop all services, run:
docker-compose down
This command stops and removes the containers but preserves the database data stored in the Docker volume.
- Ensure the Docker daemon is running before executing the commands.
- Logs can be viewed for debugging by using:
docker-compose logs
- If you encounter connection issues, verify the services are healthy by running:
docker ps
If you have any questions, feel free to open an issue in this repository.
This repository demonstrates a microservices architecture using Docker Compose. The system consists of three microservices:
- Spring Boot Service(
springboot-service
) - Stats Service(
stats-service
) - Logs Service(
logs-service
)
The services interact with a MySQL database to provide functionality for capturing and managing data related to animal visits and veterinarians.
Before running the application, ensure the following are installed:
Follow these steps to run the microservices:
-
Clone the Repository:
git clone https://github.com/Agusioma/circleci-microservices-unit-testing-demo.git cd circleci-microservices-unit-testing-demo
-
Start the Docker Containers: Run the following command to start all services:
docker-compose up --build
This command will build the images for each service and start the containers. The services will be accessible after the containers are fully initialized.
- Endpoint: http://localhost:8080
- Use this service to add and manage visits and veterinarians.
- Add a new visit: http://localhost:8080/visits/new
- Add a new veterinarian: http://localhost:8080/veterinarians/new
- Endpoint: http://localhost:8000/chart
- This service provides aggregated statistics based on the data collected using a pie chart.
- Internal Usage Only: The logs service is called internally by the Spring Boot Service to log data.
- Endpoint:
logs-service:5001/api/logs
- It records logs whenever a new veterinarian or animal visit is added.
To stop all services, run:
docker-compose down
This command stops and removes the containers but preserves the database data stored in the Docker volume.
- Ensure the Docker daemon is running before executing the commands.
- Logs can be viewed for debugging by using:
docker-compose logs
- If you encounter connection issues, verify the services are healthy by running:
docker ps
If you have any questions, feel free to open an issue in this repository.