How sunil3gs98/secretsanta-generator works
Secret Santa Generator is a Spring MVC web app: users visit the welcome page, maintain a list of people, then request randomly generated giver-to-recipient matches. The controller handles page requests and delegates people operations and match generation to the service; the service uses the JPA repository for persisted people. The controller supplies data to Thymeleaf views for display. The README documents MySQL, JPA, and Thymeleaf; the sampled source confirms the controller/service/repository flow, but does not show the database connection configuration or view bindings in detail.
Main entry points: PersonController.java Person controller · PersonService.java Person service · PersonRepo.java Person repository · Person.java Person entity
Components 9
Web views
- Person controller
src/main/java/com/notthebest/demo/controller/PersonController.java - Welcome view
src/main/resources/templates/index.html - People view
src/main/resources/templates/addpeople.html - Matches view
src/main/resources/templates/generate.html
Application logic
- Person service
src/main/java/com/notthebest/demo/service/PersonService.java - Person entity
src/main/java/com/notthebest/demo/model/Person.java
Persistence
- Person repository
src/main/java/com/notthebest/demo/repository/PersonRepo.java - MySQL database
Other components
- Visitor
Connections 10
- Visitor → Person controller: requests pages
- Person controller → Welcome view: renders welcome
- Person controller → Person service: delegates people ops
- Person controller → Person service: requests matches
- Person controller → People view: renders people
- Person controller → Matches view: renders matches
- Person service → Person repository: loads and saves
- Person service → Person entity: uses person records
- Person repository → Person entity: persists entity
- Person repository → MySQL database: JPA persistence