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:
AnimalController
class manages animal operations and provides RESTful APIs. - Model:
Animal
class represents the animal object. - Repository:
AnimalRepository
class performs database operations related to animals. - Service:
AnimalService
andAnimalManager
classes manage animal operations and execute database operations.
- Main Class:
EurekaServerApplication
class starts the Eureka server and holds service registrations.
- Controller:
CustomerController
class manages customer operations and provides RESTful APIs. - DTO:
AddAnimalRequest
class is a data transfer object used for adding animals to customers. - Model:
Customer
class represents the customer object. - Repository:
CustomerRepository
class performs database operations related to customers. - Service:
CustomerService
andCustomerManager
classes 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:run
command. - Start the Eureka Server to enable communication between services.
- Verify that the services are running and perform operations using the RESTful APIs.