How slavakuntsov/untitled-cinema works
Project Type and Purpose
• This is a full-stack cinema booking application that features an Angular-based frontend and multiple backend microservices. The system is organized into separate modules for managing bookings, movies, users, and shared functionalities such as messaging and broker services.
• The project is containerized – notice the docker-compose file, Dockerfiles for both the client, server, and Nginx, indicating that deployment uses container orchestration and possibly an API gateway for routing requests.
Main Components
a. Frontend:
– Angular client under src/client.
– Contains components, pages, shared UI elements, widgets, and state management.
– Interacts with the backend via REST APIs and possibly via websockets (observable in authentication interceptors, etc.).
b. Backend Microservices:
– Booking Service: Contains API, Application, Domain, Infrastructure, Persistence, and Test projects. Manages bookings, seat reservations, and related workflows.
– Movie Service: Similar layered structure and handles movies, halls, sessions management, and associated operations.
– User Service: Manages users, authentication, notifications, and tokens. Has its own API, Application, Domain, Infrastructure, Persistence.
– Each microservice is further decomposed into standard layers (e.g., Controllers, Handlers for commands/queries, Domain entities, Repositories) reflecting a Clean Architecture or CQRS pattern in parts.
c. Shared/Infrastructure Components:
– Shared Libraries for Brokers (RabbitMQ for message queuing between services), Databases, Domain tools, Extensions (logging, exception handling, etc.), Redis cache, and Utilities.
– Note the existence of a Shared folder with subcomponents for Brokers, Protobufs, Redis, etc., indicating cross-service communication and common services.
d. Gateway and Infrastructure:
– An Nginx configuration folder with a Dockerfile and certificates, likely providing reverse-proxying, load balancing and possibly SSL termination.
– docker-compose file shows orchestration of client, multiple server microservices, and infrastructure components.
– There are Dockerfiles for the entire solution and separate ones like BookingsDockerfile or MoviesDockerfile which help manage containerization per service.
Relationships and Interactions
– The Angular client makes HTTP/REST calls to the backend services (Booking, Movie, User) via the API endpoints exposed by each microservice.
– Nginx acts as a reverse proxy or gateway, directing the incoming requests from the client to the appropriate microservice.
– The services interact with each other indirectly using asynchronous messaging through RabbitMQ (located in the Shared/Brokers section) for cross-cutting concerns such as notifications, session seats updates, or handling transactions.
– The infrastructure layer of each service interacts with its persistent storage using Entity Framework (or equivalent ORMs) to perform CRUD operations on the databases.
Key Architectural Patterns and Technologies
– Microservices Architecture: Each major domain (bookings, movies, users) is split into independent services with internal layered structure.
– Clean Architecture / CQRS: Notice the separation of commands and queries (Handlers, Commands, Queries folders) and distinct Application, Domain, Persistence projects.
– Containerization: Dockerfiles and docker-compose configuration indicate the use of Docker in deployment.
– Messaging and Asynchronous Communication: Use of RabbitMQ for inter-service message passing and possibly Redis for caching.
– Frontend Angular: Organized with feature modules and reusable components, utilizing services, routing, and interceptors for API communications.
– Security: Presence of JWT authentication and associated authentication interceptors both in the frontend and in the User Service’s Domain and Infrastructure.