How dammanhdungvn/teenup works
Project Type and Purpose
• This is a full-stack web application (“TeenUp Contest Management System”) that provides a UI for parents, students, classes and subscriptions management, backed by REST APIs in Spring Boot and a MySQL database. It is fully containerized via Docker Compose and includes cross-platform start/stop/health scripts.
File Structure Analysis
• Top-level service separation:
• frontend/ – React (Vite) code, Ant Design, Axios API clients, Dockerfile + Nginx config.
• backend/contest/ – Spring Boot project with controllers, services, repositories, entities, mappers, exception handlers, Dockerfile + Maven wrapper.
• docker-compose.yml – orchestrates frontend, backend, db.
• scripts/ & teenup.sh/.bat – helper scripts for developer workflows (start, stop, health).
• database_export/ – SQL dumps of tables.
• docs/ – API documentation.
• Patterns/Modules:
• Backend follows layered architecture (Controller → Service → Repository) with DTOs, mappers, exception handling.
• Frontend is an SPA with pages/components/services (API wrappers) → React Router.
• Data persistence: JPA to MySQL.
• Deployment via Docker Compose, health checks, volumes for persistence.
README Insights
• Tech stack summary: React + Vite + Ant Design + Axios; Spring Boot + Java 21 + MySQL 8 + JPA; Docker Compose; cross-platform scripts.
• Business rules and sample data seeding in DevDataSeeder.
a. Main Components
• Client/UI – React SPA (Browser).
• API Gateway/Reverse Proxy – Nginx in frontend container.
• Frontend Service – Node server or static files served.
• Backend Service – Spring Boot application exposing /api endpoints.
• Database – MySQL container.
• Auxiliary – Docker Compose orchestrator, cross-platform scripts.
b. Relationships & Data Flows
1. Browser → HTTP(S) → Nginx → React app.
2. React app (Axios) → HTTP → Spring Boot REST Controllers.
3. Controllers → call Service layer → Repository layer → MySQL.
4. DevDataSeeder → initial data load at startup.
5. Docker Compose → networks connecting frontend, backend, db.
c. Architectural Patterns
• Frontend: Component-based UI, service layer for API, client-side routing.
• Backend: Layered (Controller, Service, Repository), exception handling via ApiExceptionHandler, DTO mapping.
• Database: Relational with JPA entities.
• Deployment: Containerized micro-services style (though all in one compose).
d. Key Technologies
• React + Vite + Ant Design + Axios.
• Spring Boot 3 + Java 21 + Spring Data JPA.
• MySQL 8.
• Docker, Docker Compose, Nginx.
• Maven build, cross-platform shell/batch scripts.
Capturing Essential Elements
• Layering and separation of concerns: UI / API / Data.