How hoc081098/movie-ticket-booking works
Main Components
• Frontend Mobile Apps:
• User Mobile App (located in MobileApp/datn)
• Admin Mobile App (located in MobileApp/movie_admin)
• Backend:
• NestJS-based API server (located in Backend/main) with many sub-modules (auth, movies, theatres, seats, reservations, socket communication, etc.)
• Real-time communication via socket (socket gateway)
• Databases and External Services:
• MongoDB for primary data storage
• Neo4j for recommendation and graph-based queries (with modules for movie transfers and search via Cypher)
• External APIs such as Stripe, MovieDB API, Firebase authentication and notifications, and Google Places API (for mobile apps)
• Supporting Layers:
• Configuration and environment file management (.env and config module)
• Utility modules (common utilities, decorators, DTOs, etc.)
• Testing and documentation components (Docs folder and test directories)
Relationships and Interactions
• Both mobile apps (User and Admin) communicate with the NestJS backend via RESTful APIs and socket connections.
• The backend further interacts with MongoDB (for standard CRUD operations) and with Neo4j (for advanced recommendation queries and graph queries).
• External services (Stripe for payments, Firebase for real-time notifications, third‑party API keys for movie data) are integrated at the configuration level in the backend.
• The mobile apps implement state management using Flutter BLoC and other libraries, and they use network clients to communicate with the backend.
• Additionally, there is separation in backend modules following a modular pattern (each feature such as movies, comments, promotions, reservations is separated into its own module) and custom guards, decorators, and middleware that manage authentication and authorization.
Architectural Patterns and Design Principles
• The backend uses the modular design pattern of NestJS (each domain feature is encapsulated in its controller, service, and module).
• MVC-like flows: controllers handle requests, services process business logic, and schema/DTOs support data validation.
• Micro-frontends in the mobile apps: although both mobile apps are built in Flutter, they remain separated by purpose (user versus admin) to provide different interfaces and functionalities.
• Real-time communication with socket.io integrated in the backend.
• Use of dependency injection and separation of concerns in both backend and Flutter application code.
• Environment-based configuration through .env files and external service keys.