How andargachewtadesse/cinema-ebooking-system works
Main Components
• Frontend Application:
• Located in the root project under directories such as “src/app” and “src/components”. This folder contains pages for both user interactions (movie browsing, booking, profile management, login/signup) and an admin panel (admin movies, users, promotions).
• It also includes API route handlers under “src/app/api” that likely communicate with or proxy to the backend.
• Backend Server:
• Found in the “cinema-backend” directory, which is a standard Spring Boot project. It includes Java packages for controllers, DAOs, and configurations.
• Key Java classes (e.g., MovieController, UserController, PromotionController) indicate that the backend applies an MVC-like pattern.
• The backend accesses the MySQL database and handles business logic (with classes such as DatabaseConnection, EmailService, and data initializers).
• Database:
• A MySQL database, setup instructions in the README specify tables for movies, users, cards, show_times, etc.
• SQL scripts and table creation commands are provided in “cinema-backend/SQL Tables.txt” and the README.
Relationships and Interactions
• User interactions start at the Frontend:
• Users interact with the Next.js client (on port 3000) which provides interfaces for browsing movies, managing bookings, and admin tasks.
• The frontend pages (including admin and public pages) either invoke frontend internal API routes (in src/app/api) or directly make HTTP requests to the backend REST API.
• Frontend to Backend Communications:
• The frontend communicates to the Spring Boot backend running on port 8080.
• Backend to Database Communication:
• The backend uses DAOs and a DatabaseConnection class to interact with MySQL. Represent the database as a separate component receiving queries from the backend.
Important Architectural Patterns and Design Principles
• MVC/Layered Architecture:
• In the backend, controllers receive requests and use DAOs to update or query the database.
• In the frontend, Next.js pages and components separate presentation, state management, and API calls.
• Separation of Concerns:
• Distinct project directories clearly separate UI (frontend), server-side logic (backend), and data persistence (MySQL).
• Micro Frontend Pattern (if applicable):
• The admin panel has dedicated page routes under “src/app/admin”, which is logically separated from the public-facing parts of the application.
Relevant Technologies
• Frontend: Next.js, TypeScript, Tailwind CSS.
• Backend: Spring Boot, Java, and MySQL Connector (provided in the “cinema-backend/lib” directory).
• Database: MySQL.
• Build tools: Maven for the backend and npm for the frontend.
Details
• For frontend:
• That it includes both public user pages and an admin panel to manage promotions, movies, and users.
• For backend:
• Some of the key controllers and DAOs (e.g., MovieController, UserController, CardDAO).
• That configuration files (“application.properties”, “pom.xml”, etc.) play a crucial role in setting up the environment.
• For Database:
• Sample table names from the provided SQL scripts (such as movies, show_times, user, card) to clearly connect the data layer to the backend.