How nicolasberti/movie-reservation-system works
Main Components
• API Layer (Controllers): In the “controllers” package, you have separate controllers for authentication, movie handling, showing (movie screenings), and user management.
• Service Layer: This includes the various services such as MovieService, ShowingService (with sub-services for retrieval, reservation, seats, and stats), UserService, and the JWT-specific services. Different service implementation classes (e.g., JWT/AuthenticationService, JwtService, and others) should be represented.
• Data Access Layer (Repositories): These consist of the interfaces for accessing Movie, Showing, User, and UserShowing data.
• Domain Models: The domain entities such as Movie, User, Showing, Role, and others which manage application state.
• Security & Configurations: Configuration components like SecurityConfiguration, ApplicationConfiguration, and JWT filters that manage authentication and security aspects.
• External/Infrastructure Components:
• Database: Although not explicitly mentioned in the file tree, the use of JPA/Hibernate implies a connection to a relational database.
• Containerization: Docker files (Dockerfile and docker-compose.yml) indicate that this back-end service is designed to run in Docker containers.
• Front-end integration: Mentioned in the README as Angular-based but not fully implemented yet; it should be noted as an external client interfacing with the API.
Relationships and Interactions
• Client to API: Show the Angular front-end (client) making HTTP requests to the back-end controllers.
• API to Services: Controllers delegate business logic and processing to their respective service classes.
• Services to Repositories: Service implementations handle CRUD operations via repository interfaces which interact with the database.
• Security Flow: Clients first authenticate via the AuthenticationController and JWT-based services. The JwtAuthenticationFilter intercepts requests to secure endpoints.
• Exception Handling: Although not a separate “layer,” the GlobalExceptionHandler in the exceptions package governs error and exception responses across layers.
Architectural Patterns and Design Principles
• Layered Architecture: Clearly separate the Controller, Service, and Data Access layers.
• Clean Code & SOLID: The project packages indicate adherence to these principles by using clearly named interfaces and corresponding implementations.
• Security Filtering: Emphasize the centralized JWT filtering and security configuration.
• Containerization: Include a note on how Docker is set up for deployment which encapsulates the entire back-end environment.
Relevant Technologies, Frameworks, and Libraries
• Spring Boot: Central framework powering the application.
• Spring Security & JWT: For handling authentication and authorization.
• Hibernate & JPA: For ORM and database interactions.
• Docker: For containerizing the application, with Docker Compose to potentially setup the complete environment (e.g., linking the application to a database container).
• Maven: Indicated by pom.xml and Maven Wrapper scripts for building the project.