How kdb04/attendance-mgmt works
Project type and purpose
• This is a full-stack Attendance Management System.
• Purpose: provide administrators, teachers, and students with a web interface to manage and view attendance data.
File structure
Top-level directories:
• backend – Spring Boot API project (“AttendanceManagementSystem”)
• backend/db – SQL schema, triggers, and helper scripts
• frontend – React.js SPA built with Vite
• documentation – design report PDF
Backend sub-structure follows a layered MVC pattern:
• controller – REST endpoints by role (AdminController, TeacherController, etc.)
• service – business logic (CourseService, SessionService, etc.)
• repository – Spring Data JDBC/JPA interfaces
• model – domain entities (User, Student, Teacher, Course, AttendanceRecord, etc.)
• facade & factory – authentication and user object creation
• util – low-level DBConnection helper
• resources – application.properties for DB URL, credentials
Frontend structure:
• public/index.html, vite.config.js – project entry
• src/ – components for Login, Dashboards (Admin, Teacher, Student), shared CSS, assets
• src/services/api.js – Axios HTTP client
README for additional insights
• Confirms Java 17 + Maven, Node.js + npm, MySQL.
• Mentions design patterns: Factory Method, Repository, Facade.
• Database uses triggers for automated attendance updates.
a. Main components to include:
• Client (Browser/React app)
• API Gateway / Web Server (Vite dev server or static file host)
• Spring Boot Application (Controllers, Services, Facades)
• MySQL Database (with schema, triggers, stored procedures)
• External/Support components (DBConnection util, SQL script loader)
b. Relationships and interactions:
1. User interacts with React UI in the browser.
2. UI calls REST endpoints on Spring Boot (via api.js).
3. Dispatcher servlet routes to Controllers.
4. Controllers invoke Services or Facades.
5. Services call Repositories for CRUD operations.
6. Repositories execute SQL on MySQL.
7. Database triggers enforce attendance logic.
8. Responses bubble back to UI.
c. Architectural patterns and design principles:
• MVC / Layered Architecture (Controllers → Services → Repositories)
• Factory Method for user creation (UserFactory)
• Facade to encapsulate authentication complexity (LoginFacade)
• Repository pattern for data access abstraction
• Single-Page Application for frontend
• Clean separation of concerns & dependency injection via Spring
d. Key technologies, frameworks, libraries:
• React.js, Vite, Axios (frontend)
• Java Spring Boot, Maven (backend)
• Spring Web MVC, Spring Data JDBC/JPA
• MySQL, SQL triggers
• CSS modules for styling
Elements
• UI → Controller (HTTP request)
• Controller → Service → Repository → Database
• Database → Repository → Controller → UI (responses)
• Blue for frontend components
• Green for backend application layers
• Orange for database and scripts
• Annotations:
• Patterns (Factory, Facade) with small badges or labels