How proyectoscopersonales/movie-reservation-system-solutions works
Project Type and Purpose
• This is a full-stack web application (“Sistema de Reserva de un Cine”) composed of:
a) A Java/Spring Boot backend providing a REST API (business logic, security, data persistence)
b) A static frontend built with plain HTML/CSS/JavaScript that consumes the API
c) A PostgreSQL database for data storage
• Purpose: allow users (USER, ADMIN) to register/login (JWT-based), browse movies and showtimes, make/track reservations; admins manage movies, showtimes, halls, users.
High-Level File Structure Analysis
• BackendCine/
• mvnw, pom.xml → Maven wrapper and project definition
• src/main/java/com/jordancode/plataformacine/…
– Auth (AuthController, AuthService, DTOs)
– Config (ApplicationConfig, SecurityConfig)
– Jwt (filter, service)
– Controller (MovieController, ReservationController, etc.)
– Service (MovieService, ReservationService, etc.)
– Repository (Spring Data JPA interfaces)
– Entity (Movie, Horario, Reservation, Salas, User, Role)
• src/main/resources/application.properties → DB and security settings
• FrontendCine/
– View/<Feature>/… HTML/CSS/JS per page (Login, Dashboard, MovieForm, etc.)
– Reservation/… standalone reservation page
Key README Insights
• Spring Security with Bcrypt password hashing and JWT for stateless auth
• Two roles: USER (view/buy seats) and ADMIN (CRUD on movies, halls, showtimes, users)
• Exposed REST endpoints under /auth, /user/*, /admin/*
• PostgreSQL backing store
a. Main Components
1) Web Browser (User’s UI)
2) Frontend Static Files (HTML/CSS/JS)
3) Spring Boot Application (API)
– Security Layer (JWTAuthenticationFilter, SecurityConfig)
– Controllers (AuthController, MovieController, etc.)
– Service Layer (AuthService, MovieService, etc.)
– Repository Layer (Spring Data JPA)
4) PostgreSQL Database
5) External JWT Provider (internal library com.jordancode.plataformacine.Jwt)
b. Interactions & Data Flows
• Browser → HTTP(S) → Frontend HTML/JS
• JS (fetch/AJAX) → REST API (/auth/login, /user/movie, /admin/movie, etc.)
• Security filter intercepts → validates JWT → populates SecurityContext
• Controller invokes Service → uses Repository → queries/updates DB
• DB returns result → Service → Controller → JSON → Browser
c. Architectural Patterns
• Layered (Controller → Service → Repository)
• Stateless authentication using JWT
• Role-based access control (USER vs ADMIN)
d. Key Technologies/Libs
• Spring Boot (REST API, DI, auto-configuration)
• Spring Security + JWT for auth
• Spring Data JPA + Hibernate
• Maven build
• PostgreSQL
• Vanilla JS frontend
– Inside, at the top edge, show “JWT Auth Filter (JwtAuthenticationFilter)” and “SecurityConfig.”
– Beneath, group Controllers (AuthController, MovieController, etc.) in one layer.
– Under that, group Services (AuthService, MovieService, etc.).
– Under that, group Repositories.
– Browser → Static Frontend → API/AuthController (POST /auth/login) → JWTFilter → AuthService → UserRepository → DB
– Post-login: Browser stores JWT → attaches to /user/movie etc. calls
– Controller → Service → Repository → DB → back up to Controller → Browser