How jorgepiconjr/lottery-web-app works
Project Type & Purpose
• Full-stack web application built with Spring Boot (Java) and Thymeleaf.
• Purpose: Allow users to play number lotteries, bet on Bundesliga matches, and form private betting pools.
File Structure
• src/main/java/lottery – the root package.
• Sub-packages as logical modules (using Spring Modulith):
– bet (domain, controllers, services, data initializers)
– event (football & lotto event domain + forms + controllers)
– lottery (Lottery domain & controller)
– pool (pool domain, controller, service)
– user (user registration/login domain, controllers, services)
– welcome (landing-page controller)
• repositories – Spring Data JPA interfaces for persistence.
• src/main/resources/static – CSS, images for the front-end (Thymeleaf).
• src/main/resources/templates – Thymeleaf HTML templates (views).
• pom.xml & mvnw – Maven build, declares dependencies (Spring Web, Spring Data JPA, Thymeleaf, Salespoint framework, etc.).
Extract Key Insights from the README
• Confirms use of Spring Boot + Thymeleaf.
• Team-based Scrum project with MVC architecture.
• No mention of external third-party betting-data services, so the system is self-contained.
Defining the Main Components & Their Interactions
a. Components:
1. Web Client (Browser)
2. Static Content Server (delivers CSS/JS/images)
3. Spring Boot Application (REST + MVC)
• Presentation Layer: Controllers (BetController, PoolController, UserController, etc.)
• Service Layer: Business logic (BetService, PoolService, UserService, LotteryService)
• Domain Model: Entities (Bet, Event, Pool, User)
• Data Access Layer: Repositories (Spring Data JPA interfaces)
4. Relational Database (e.g., H2/MySQL)
5. (Optional) External Services – none by default
b. Relationships & Data Flow:
• User → HTTP(S) → Controller → Service → Repository → Database
• Controller returns Thymeleaf view + model → Browser renders UI
• Static assets served directly from /static
c. Architectural Patterns & Principles:
• Layered (Presentation → Business → Data)
• Modular Monolith via Spring Modulith (each sub-package is a module)
• MVC for web interactions
• Dependency Injection & Inversion of Control (Spring)
• Repository Pattern (Spring Data JPA)
d. Key Technologies & Frameworks:
• Spring Boot Web, Spring MVC
• Thymeleaf templating engine
• Spring Data JPA + Hibernate
• Salespoint framework modules (accountancy, catalog, etc.)
• Maven for build
• SQL database (H2/MySQL)