How theanh994/kiemthu works
Project type and purpose
• EduMana is a Spring Boot–based, full-stack education management system.
• It provides both server-rendered HTML views (Thymeleaf + static CSS) and a RESTful API.
• Uses H2 in-memory database with Flyway migrations, Spring Data JPA for persistence, and Maven for build.
File structure
• Top-level artifacts:
• pom.xml – Maven project definition
• src/main/java/com/edumana – Java source split into controller, service, repository, model, dto
• src/main/resources:
– application.properties – runtime configuration
– db/migration – Flyway SQL migrations
– static/css – styles
– templates – Thymeleaf views organized by feature (course, teacher, statistics, etc.)
• Patterns:
• Layered MVC: Controllers → Services → Repositories → Database
• One monolithic deployable JAR with embedded Tomcat
Main components
a. Client Layer
– Browser/UI (HTML pages + CSS)
– REST client (e.g., AJAX, Postman)
b. Web Server
– Spring Boot embedded Tomcat
– Spring MVC dispatcher
c. Presentation Layer
– Thymeleaf templates + static assets
– API controllers (CourseClassApiController, etc.)
d. Service Layer
– Business logic services (CourseService, TeachingPaymentService, etc.)
e. Data Access Layer
– Spring Data JPA repositories
f. Persistence
– H2 in-memory database
– Flyway migration scripts
g. (Optional) H2 Console as external admin UI
Relationships & data flows
• Browser → HTTP GET/POST → MVC Controller → Service → Repository → H2 DB → back up chain → Browser
• REST client → HTTP JSON → ApiController → Service → Repository → DB → JSON response
• At application start: Flyway migrations → DB schema
• DB console access routes to H2 engine
Architectural patterns and design principles
• Layered architecture (separation of concerns)
• MVC for server-rendered pages
• RESTful resource controllers
• Dependency inversion: Controllers depend on Service interfaces, Services depend on Repository interfaces
• Flyway for versioned DB schema migration
• DTO pattern for reports and statistics
Essential details to capture
• All controller classes and their channels (UI vs. API)
• Key service classes and the domain they serve (e.g., TeachingPaymentService)
• Repository interfaces and Flyway migrations feeding into the database
• Static asset server and H2 console as side-car