How 0xroguex/watchlistapplication works
And Label Main Components
• Frontend (Presentation Layer):
• Thymeleaf templates (home.html, watchlist.html, watchlistItemForm.html) as the user interface.
• That these views render HTML pages which are served by the backend.
• Backend (Application Layer):
• Controllers: Include MovieController.java which handles incoming HTTP requests (e.g., form submissions, displaying the watchlist, etc.).
• The DatabaseService coordinates data persistence and retrieval (via JPA).
• The RatingService is responsible for external API integration with services such as OMDB.
• Entities: Highlight the Movie.java entity along with its custom validations in sub-packages (Rating and Priority validations).
• That these enforce business rules, ensuring valid movie data (rating between 5–10, priority as 'L', 'M', or 'H').
• Repository: Include MovieRepo.java, which abstracts the CRUD operations using Spring Data JPA.
• Application Entry Point: Mark WatchlistApplication.java as the bootstrap class for Spring Boot.
• Data Persistence Layer:
• Mention that application.properties configures the required connection parameters.
• External Services:
• OMDB API: Include an external block for the OMDB API.
• Call from the RatingService to OMDB, illustrating how external data enhances the movie data.
Relationships and Interactions
• Beginning at the user’s browser where HTTP requests are initiated.
• Dependency directions:
• The controller depends on both services.
• Services invoke the repository and/or external API calls.
• The application startup (WatchlistApplication) initializes the entire context.
Architectural Patterns and Design Principles
• Use the MVC (Model-View-Controller) pattern:
• Model: Movie entity (and its validations).
• View: Thymeleaf templates.
• Controller: MovieController for routing and handling user actions.
• Layered architecture:
• Separation of concerns between presentation (views), business logic (services), data access (repositories), and configuration.
• Integration of custom validation logic:
• “validations” folder under the entity component, showing how Priority and Rating validations are applied.
• Mention dependency injection provided by Spring Boot and configurations centralized in application.properties.
Specific Technologies, Frameworks, and Tools
• Spring Boot for application configuration and bootstrapping.
• Spring Data JPA and Hibernate for ORM.
• Thymeleaf for server-side view rendering.
• PostgreSQL as the production database.
• Maven for build automation and dependency management.
• (Optionally) OMDB API for external movie rating integration.