This project is in development stage. Further enhancements are planned.
- Java
- Spring Boot
- Spring Cloud Netflix Eureka
- Spring Data JPA
- Feign Client
- PostgreSQL (Or any other database option)
The project is designed following the microservices architecture and consists of the following components:
- Animal Service: Service responsible for managing operations related to animals.
- Eureka Server: Eureka server responsible for service registration and discovery.
- Customer Service: Service responsible for customer management and customer-animal relationships.
- Controller:
AnimalControllerclass manages animal operations and provides RESTful APIs. - Model:
Animalclass represents the animal object. - Repository:
AnimalRepositoryclass performs database operations related to animals. - Service:
AnimalServiceandAnimalManagerclasses manage animal operations and execute database operations.
- Main Class:
EurekaServerApplicationclass starts the Eureka server and holds service registrations.
- Controller:
CustomerControllerclass manages customer operations and provides RESTful APIs. - DTO:
AddAnimalRequestclass is a data transfer object used for adding animals to customers. - Model:
Customerclass represents the customer object. - Repository:
CustomerRepositoryclass performs database operations related to customers. - Service:
CustomerServiceandCustomerManagerclasses manage customer operations and execute database operations.
- Customer Service - Animal Service Communication: Achieved via
AnimalServiceClient. The customer service communicates with the animal service and performs data exchange.
- Clone the project.
- Start each service separately using the
mvn spring-boot:runcommand. - Start the Eureka Server to enable communication between services.
- Verify that the services are running and perform operations using the RESTful APIs.