How tin1508/movieticketsmanagementsystem works
Project Type and Purpose
• This is a full-stack web application called “MovieTicketsManagementSystem” composed of:
• A React/Vite-based SPA (“movie-login” folder) for user authentication, movie browsing, and admin dashboards.
• A Spring Boot microservice (“movie-service” folder) providing REST endpoints for authentication, user/genre/movie management, and file-storage.
• A relational database (DDL script in ddl_Movie.sql) and a filesystem directory (uploads/movies/posters) for storing movie poster images.
Architectural Analysis
• Top-level directories:
• movie-login: Front-end app structured by components, pages, services, context.
• movie-service: Back-end service using Spring Boot with layered packages (config, controller, service, repository, entity, dto, mapper, specification).
• uploads: File storage for uploaded movie posters.
• Key patterns:
• Front-end: Component-based SPA with context for auth, protected routes, and a service layer for HTTP calls.
• Back-end: Classic layered MVC + Service + Repository architecture with JWT security and file storage.
• Deployment files:
• vite.config.js, package.json for front-end build.
• pom.xml, Maven wrapper, application.yaml for back-end.
• ddl_Movie.sql for database schema.
a. Front-end (React SPA)
– Hosted on a CDN or web server (e.g., Nginx)
– Routes: /login, /register, /dashboard, /movies, etc.
– Services: authService, movieService, genreService, userService (HTTP clients)
b. Back-end (Spring Boot API)
– Controllers: AuthenticationController, MovieController, GenreController, UserController
– Services: AuthenticationService, MovieService, GenreService, UserService, FileStorageService
– Security: JWT filter/entry point, SecurityConfig
– Configuration: CORS (WebConfig), file-upload properties
c. Database
– Tables: users, movies, genres, invalidated_tokens, etc.
– SQL script: ddl_Movie.sql
d. File Storage
– Local folder uploads/movies/posters
– Managed by FileStorageService
e. Authentication Flow
– Clients send credentials → /api/auth/login → JWT in response → stored in client context → sent in Authorization: Bearer header for protected API calls
f. Data Flow
– User actions in UI → React services → REST calls → Spring Boot controllers → Service layer → Repository → Database or File Storage → Response back through layers to front-end
• User ↔︎ Browser (UI)
• UI → REST API endpoints
• API → Database (CRUD)
• API → File System (upload/download posters)
• UI ↔︎ Local Storage or Context (JWT tokens)
• Sequence: Login → Token issuance → Authorized requests → Data updates → UI state changes
Architectural Patterns & Principles
• Separation of concerns: UI layer, API layer, persistence, and file storage each in its own component.
• Layered architecture on back-end: Controller → Service → Repository.
• Stateless authentication via JWT.
• SPA with client-side routing and protected routes.
• Configuration-driven (YAML, Vite config) and environment isolation.
Detail Level
• Be as granular as necessary: show individual services if needed (e.g., FileStorageService vs MovieService).
• Endpoints and data-flow paths that are critical for understanding system behavior.