Pet API is a system that allows the registration of dogs and cats based on breeds and images from external APIs TheCatAPI and TheDogAPI. It also handles appointment registrations for services like vaccinations, baths, medical exams, medical appointments, surgeries, and sends emails with information about the scheduled events.
- Create a cat
- Automatically sends and e-mail for the owner if cat's age >= 10 or vaccinationHistory = 'none' with appointment data
- Search registered cats by breed
- Search registered cats by species
- Create a dog
- Automatically sends and e-mail if cat's age >= 10 or vaccines = none
- Search registered dogs by breed
- Search registered dogs by species
- View registered pets
- Fetch pet by ID
- Update pets by ID
- Delete pet by ID
- Fetch available cat and dog breeds
- Fetch available cat and dog images
- Create an appointment
- Automatically sends and e-mail for the owner with appointment data
- View appointments
- Update appointment based on animal name, owner email, and event name
- Delete an appointment based on animal name, owner email, and event name
- Automatically send emails for scheduled appointments (vaccines, bath, etc.) and manually registered appointments
- Spring Boot: Framework for building Java applications.
- Spring Data JPA: Simplifies database integration, using object-relational mapping for persistence.
- Maven: Dependency and build management tool.
- MySQL: Relational database for storing entities.
- Swagger: Interactive API documentation.
- WebClient: For integrating with external APIs.
- RabbitMQ: Messaging broker for communication between microservices.
- Docker: Dockerfile and Docker Compose for containerization.
- Eureka Discovery Client: Service discovery for microservices.
- API Gateway: Gateway to manage and route API requests.
- Java Mail Sender: Sends emails automatically for appointments.
Before running the application, make sure you have Docker installed on your machine.
Note: There is no need to have a JDK installed locally. Docker will handle all dependencies within isolated containers.
git clone git@git.gft.com:lnsi/microserviceschallenge.git
cd microserviceschallenge/backend/deploy
To build and start the application using Docker Compose, run the following command:
docker-compose up --build
This command will:
- Build the application images based on the
Dockerfiles
in the application. - Create and start the containers for both the Spring Boot application and the MySQL database.
- Set up the necessary environment variables for the database connection.
Important
AFTER RUNNING THE COMMAND, WAIT FOR THE MESSAGE 'RUNNING THE EVICT TASK WITH COMPENSATIONTIME 0MS' TO APPEAR, THEN GO TO STEP 3.
You can make the HTTP requests now. Access petAPI.postman_collection.json located in backend/
docker-compose down
- Swagger UI: http://localhost:8084/swagger-ui.html
- Swagger json: http://localhost:8084/v3/api-docs
- Swagger UI: http://localhost:8083/swagger-ui.html
- Swagger json: http://localhost:8083/v3/api-docs