How vonhumbolt/cinevisionmicroserviceproject works
Main Components
• API Gateway: Acts as a front door for all client requests; it manages routing, security, and load balancing.
• Eureka Server: The service discovery component (using Netflix Eureka) where all services (API Gateway, Movie Service, User Service, and Email Service) register.
• Movie Service: Handles functionalities related to movies, including CRUD operations, movie scheduling, payments, and caching (with Redis). It uses PostgreSQL for persistence and WebFlux for inter-service communication.
• User Service: Manages user accounts including registration, authentication (utilizing JWT), and user-related operations. It uses MongoDB and Spring Security.
• Email Service: Responsible for asynchronous email notifications (triggered by movie-related actions) using Apache Kafka and Java Mail Sender along with FreeMarker for templating.
• Frontend Application: A React-based web app that interfaces with the backend via Axios, Redux for state management, and Bootstrap for styling.
• Docker & Supporting Infrastructure: Docker Compose is used to containerize dependencies (PostgreSQL, MongoDB, Kafka, Zipkin, etc.).
Relationships and Interactions
• The Client (web browser) communicates with the Frontend, which in turn sends REST API calls to the API Gateway.
• API Gateway forwards requests to the appropriate backend service (Movie, User, Email) based on route configurations.
• All backend services are registered with the Eureka Server for service discovery.
• Communication between services uses Spring Cloud (for direct REST or reactive WebFlux) and asynchronous messaging through Apache Kafka (for example, Movie Service sends a message to Email Service).
• Resilience4j is integrated in Movie Service (and possibly in others) to handle circuit breaking and fallback strategies.
• Zipkin and Sleuth are used across services to trace distributed operations.
• JWT-based authentication and Spring Security in the User Service protect endpoints and manage token verification across services.
Important Infrastructure and Patterns
• Microservices Architecture: Separate services for movies, users, email, and a centralized API gateway ensure loose coupling and scalability.
• N-Layered Architecture: Each microservice is organized using domain, service, data access, and presentation layers.
• Service Discovery and Routing: Eureka for discovery and Spring Cloud Gateway for request routing.
• Asynchronous Communication: Apache Kafka is used to decouple services (especially for sending emails from the Movie Service).
• Externalized Configuration & Containerization: Docker Compose is used to manage and run infrastructure components like databases, Kafka, and Zipkin.