How jaiswaladi246/boardgame works
1. Overall shape
This is a server-rendered Spring Boot web application, not a JSON API. The main runtime flow is: browser request → Spring MVC controller → JDBC database access → Thymeleaf view rendering → HTML response.
2. Core domain
The application centers on two business entities: BoardGame and Review. These live in com.javaproject.beans and represent the data passed between controllers, the database layer, and templates. ErrorMessage is used for error presentation.
3. Web layer
BoardGameController and HomeController are the primary MVC entry points. They handle page navigation and user actions such as viewing board games/reviews, adding games, and adding or managing reviews. The app uses Thymeleaf templates rather than a frontend SPA.
4. Data access boundary
DatabaseAccess is the persistence boundary for the application. It encapsulates JDBC-based interaction with the database, so controllers do not talk directly to SQL. This is the main separation between presentation logic and storage logic.
5. Database model and initialization
The app uses an H2 in-memory database. src/main/resources/schema.sql defines the schema and seeds initial data, which matches the README’s default users and starting content. This means the app is designed to bootstrap itself on startup in a local/runtime database.
6. Security model
SecurityConfig and LoggingAccessDeniedHandler enforce authentication and authorization. The security boundary splits the app into:
- public pages for browsing board games and reviews
- user pages for adding board games and reviews
- manager pages for elevated review edit/delete capabilities
7. Role-specific UI
The templates/secured/user and templates/secured/manager directories show role-based page variants. The app’s authorization model is reflected both in backend access control and in the page structure, so protected functionality is not just hidden in the UI; it is gated by Spring Security.
8. View composition
Thymeleaf fragments under templates/fragments provide shared layout pieces like header, footer, and common links. This reduces duplication across pages such as index, login, new-user, boardgame, and review.
9. Static assets
CSS, JavaScript, and images live under src/main/resources/static. These are the browser-facing assets that support the Thymeleaf pages, likely including styling, simple client-side behavior, and branding.
10. Error handling
There is a dedicated permission-denied view under templates/error, which aligns with the custom access-denied handler. This indicates the app handles authorization failures as a first-class user experience rather than relying on default framework errors.
11. Testing
Tests are split into application startup tests plus focused controller/database tests. That suggests the repo verifies both Spring context wiring and the behavior of the MVC/data-access layers.
12. Delivery and deployment
The presence of a Dockerfile, Jenkinsfile, and deployment-service.yaml indicates the app is built for containerized delivery and automated deployment. README also mentions AWS EC2 as the hosting target, so the architecture includes a deployment pipeline and container/runtime boundary beyond the code itself.
Main entry points: BoardGameController.java Game controller · HomeController.java Home controller · SecurityConfig.java Security config · DatabaseAccess.java Database access
Components 19
Runtime
Spring Boot application startup and request handling
- App startup · Application entrypoint that boots the Spring context and web runtime
src/main/java/com/javaproject/DatabaseServiceProjectApplication.java
Web Layer
MVC entry points and page navigation
- Home controller · Handles landing, login, and navigation pages
src/main/java/com/javaproject/controllers/HomeController.java - Game controller · Handles board game and review actions and page flow
src/main/java/com/javaproject/controllers/BoardGameController.java
Domain
Core application data objects
- BoardGame · Board game data passed between controller, database, and views
src/main/java/com/javaproject/beans/BoardGame.java - Review · Review data bound to forms and rendered in pages
src/main/java/com/javaproject/beans/Review.java - ErrorMessage · Error payload used for user-facing failure messages
src/main/java/com/javaproject/beans/ErrorMessage.java
Persistence
JDBC access and database bootstrap
- Database access · Encapsulates SQL and database operations for the application
src/main/java/com/javaproject/database/DatabaseAccess.java - Schema seed · Defines H2 schema and initial data loaded on startup
src/main/resources/schema.sql
Security
Authentication, authorization, and denied-access handling
- Security config · Defines authentication and authorization rules
src/main/java/com/javaproject/security/SecurityConfig.java - Denied handler · Custom handler for authorization failures
src/main/java/com/javaproject/security/LoggingAccessDeniedHandler.java
Views
Thymeleaf templates and shared fragments
- Home page · Public landing page
src/main/resources/templates/index.html - Board game page · Public board game detail and browse page
src/main/resources/templates/boardgame.html - Review page · Public review display page
src/main/resources/templates/review.html - Login page · Authentication page
src/main/resources/templates/login.html - Fragments · Shared Thymeleaf header, footer, and links fragments
src/main/resources/templates/fragments - Secured pages · Protected user and manager page variants
src/main/resources/templates/secured - Denied page · User-facing permission denied page
src/main/resources/templates/error/permission-denied.html - Static assets · CSS, JavaScript, and images served to the browser
src/main/resources/static
Delivery
Container build and deployment pipeline
- Delivery pipeline · Containerization and CI/CD deployment artifacts
Connections 20
- App startup → Home controller: wires MVC · Bootstraps controllers into the web application
- App startup → Game controller: wires MVC · Bootstraps controllers into the web application
- Home controller → Home page: renders · Serves the public landing page
- Home controller → Login page: renders · Serves the login page
- Game controller → BoardGame: uses · Binds board game data to requests and views
- Game controller → Review: uses · Binds review data to requests and views
- Game controller → Database access: reads/writes · Delegates persistence work to the JDBC boundary
- Database access → Schema seed: boots from · Relies on schema and seed data in H2 startup script
- Database access → BoardGame: maps · Materializes board game records
- Database access → Review: maps · Materializes review records
- Security config → Home controller: permits · Allows public navigation pages
- Security config → Game controller: guards · Protects write and management actions
- Security config → Secured pages: routes · Controls access to role-based pages
- Security config → Denied handler: uses · Delegates forbidden access handling
- Denied handler → Denied page: shows · Directs users to permission denied page
- Home controller → Fragments: composes · Reuses shared page layout fragments
- Game controller → Fragments: composes · Reuses shared page layout fragments
- Home page → Static assets: loads · Uses browser assets for styling and scripts
- Secured pages → Static assets: loads · Uses browser assets for styling and scripts
- Delivery pipeline → App startup: packages · Builds and deploys the application runtime