How thiennguyen62/project1-hust works
Project I is a Vietnamese high-school management web app. Users enter through the landing page or sign in, then use the dashboard to manage academic years and related school records; the frontend calls an Express API backed by MySQL. The README documents academic-year creation, editing, filtering, deletion, semester creation, and safeguards for related classes. The graph reflects those documented capabilities and sampled wiring; where source excerpts do not show a specific cross-component call, links are omitted or marked unverified.
Main entry points: app.js Express app · App.jsx Page routing · Dashboard.jsx Dashboard · auth.controller.js Authentication controller
Components 34
Frontend
- Landing pages
frontend/src/components/landing - Page routing
frontend/src/App.jsx - Login page
frontend/src/components/login/LoginPage.jsx - Auth API client
frontend/src/api/auth.js - Protected dashboard
frontend/src/components/dashboard/ProtectedDashboard.jsx - Dashboard
frontend/src/Dashboard.jsx - Dashboard navigation
frontend/src/components/dashboard/Sidebar.jsx - Dashboard pages
frontend/src/components/dashboard/DashboardPages.jsx - Academic-year management
frontend/src/components/academic-years/AcademicYearsPage.jsx - Semester view
frontend/src/components/academic-years/Semesters.jsx - Classroom management
frontend/src/components/classrooms/ClassroomsPage.jsx - School-record interface
frontend/src/components/shared/SchoolRecords.jsx - Academic-year API client
frontend/src/api/academic-years.js - School-record API client
frontend/src/api/school-records.js - Shared icons
frontend/src/components/shared/Icon.jsx
Backend API
- Express app
backend/src/app.js - Health route
backend/src/routes/health.routes.js - Authentication routes
backend/src/routes/auth.routes.js - Authentication controller
backend/src/controllers/auth.controller.js - Academic-year routes
backend/src/routes/academic-year.routes.js - Academic-year controller
backend/src/controllers/academic-year.controller.js - School-record routes
backend/src/routes/school-record.routes.js
Domain services
- Credential verification
backend/src/services/auth.service.js - Session handling
backend/src/services/session.service.js - Academic-year rules
backend/src/services/academic-year.service.js - Semester rules
backend/src/services/semester.service.js - Classroom rules
backend/src/services/classroom.service.js
Persistence
- Academic-year repository
backend/src/repositories/academic-year.repository.js - Semester repository
backend/src/repositories/semester.repository.js - Classroom repository
backend/src/repositories/classroom.repository.js - Account repository
backend/src/repositories/account.repository.js - MySQL connection pool
backend/src/config/database.js
Other components
- School staff
- Web browser
Connections 41
- School staff → Web browser: uses
- Web browser → Page routing: opens
- Page routing → Landing pages: renders
frontend/src/App.jsx - Page routing → Login page: routes to
frontend/src/App.jsx - Page routing → Protected dashboard: routes to
frontend/src/App.jsx - Protected dashboard → Auth API client: checks session
frontend/src/components/dashboard/ProtectedDashboard.jsx - Protected dashboard → Dashboard: renders
frontend/src/components/dashboard/ProtectedDashboard.jsx - Dashboard → Dashboard navigation: renders
- Dashboard → Dashboard pages: renders
- Login page → Auth API client: submits credentials
frontend/src/components/login/LoginPage.jsx - Auth API client → Authentication routes: HTTP requests
- Dashboard → Academic-year management: offers management
- Academic-year management → Academic-year API client: requests records
frontend/src/components/academic-years/AcademicYearsPage.jsx - Academic-year management → Semester view: renders
frontend/src/components/academic-years/AcademicYearsPage.jsx - Classroom management → School-record interface: uses
frontend/src/components/classrooms/ClassroomsPage.jsx - Classroom management → Academic-year API client: loads year context
frontend/src/components/classrooms/ClassroomsPage.jsx - Semester view → School-record interface: uses
frontend/src/components/academic-years/Semesters.jsx - School-record interface → School-record API client: loads and saves
frontend/src/components/shared/SchoolRecords.jsx - School-record interface → Shared icons: uses icons
- Academic-year API client → Academic-year routes: HTTP requests
- School-record API client → School-record routes: HTTP requests
- Express app → Health route: mounts
backend/src/app.js - Express app → Authentication routes: mounts
backend/src/app.js - Express app → Academic-year routes: mounts
backend/src/app.js - Express app → School-record routes: mounts
backend/src/app.js - Academic-year routes → Academic-year controller: dispatches
backend/src/routes/academic-year.routes.js - Academic-year controller → Academic-year rules: calls
backend/src/controllers/academic-year.controller.js - Academic-year rules → Academic-year repository: delegates
- School-record routes → Semester rules: dispatches
backend/src/app.js - School-record routes → Classroom rules: dispatches
backend/src/app.js - Semester rules → Semester repository: uses
- Classroom rules → Classroom repository: uses
- Authentication routes → Authentication controller: dispatches
- Authentication controller → Credential verification: verifies credentials
backend/src/controllers/auth.controller.js - Authentication controller → Session handling: manages sessions
backend/src/controllers/auth.controller.js - Authentication controller → Account repository: checks account
backend/src/controllers/auth.controller.js - Credential verification → Account repository: looks up account
backend/src/services/auth.service.js - Academic-year repository → MySQL connection pool: queries MySQL
- Semester repository → MySQL connection pool: queries MySQL
- Classroom repository → MySQL connection pool: queries MySQL
- Account repository → MySQL connection pool: queries MySQL