How toru2004/hairsalonbooking works
Project Type and Purpose
• This is a monolithic, full-stack Spring Boot web application (MVC) that allows customers to browse services, view stylists, and book appointments.
• It uses Thymeleaf templates, static assets (CSS/JS/images), and a MySQL database.
File Structure
• src/main/java/com/admin:
• controller/…Controller.java (HTTP endpoints)
• service/…Service.java (business logic)
• repository/…Repository.java (data access)
• model/*.java (domain entities)
• exception/*.java (error handling)
• config/AppConfig.java (Spring configuration)
• utils/TimePeriodHelper.java (helper logic)
• src/main/resources:
• static/ (CSS, JS, images, videos) – client-side assets
• templates/ (Thymeleaf views for admin, manager, stylist, public)
• application.properties (app & DB config)
• web/WEB-INF/web.xml & index.jsp (legacy servlet config)
README
• Confirms Spring Boot + Thymeleaf UI + MySQL
• Core features: booking, service listings, stylist info
Main Components
a. Client Browser (Web UI)
• Static assets: CSS, JS, images/videos
• Thymeleaf-rendered HTML pages
b. Spring Boot Application (Monolith)
1. Presentation Layer (Controllers)
2. Service Layer (business rules)
3. Data Layer (Repositories using Spring Data JPA)
c. MySQL Database
d. External Systems (e.g., SMTP for emails if any – not present but leave extensibility)
Relationships & Data Flows
• Browser → HTTP (GET/POST) → Controllers
• Controllers ↔ Services (method calls)
• Services ↔ Repositories (JPA queries)
• Repositories → JDBC → MySQL
• Controllers → Thymeleaf → HTML → Browser
• Static assets served from /static directory
Architectural Patterns & Principles
• MVC: clear separation of concerns
• Layered Architecture: Presentation → Business → Data
• Dependency Injection (Spring)
• Exception Handling via @ControllerAdvice or custom exceptions
Relevant Technologies & Roles
• Spring Boot (embedded Tomcat, auto-configuration)
• Spring MVC (DispatcherServlet, @Controller)
• Spring Data JPA (Repositories, Entities)
• Thymeleaf (View templates)
• MySQL (persistent storage)
• Maven (build)