# nguyenminhduc163/student_records_manager architecture

> Architecture diagram of the GitHub repository nguyenminhduc163/student_records_manager, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-02-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nguyenminhduc163/student_records_manager
- Repository: https://github.com/nguyenminhduc163/student_records_manager

## Overview

##### Main Components

a. Frontend Layer (Presentation)
- JavaFX UI Components
- FXML Views (located in src/main/resources/view)
- CSS Styling (located in src/main/resources/css)
- Controllers Package (src/main/java/controllers)

b. Service Layer
- Authentication Services (LoginHandler, RegisterHandler)
- Business Logic Services (UpdateDataHandle, ExportFileHandle)
- Email Service (EmailHandler)
- Network Services (Client, Server, ClientHandler)

c. Data Access Layer
- DAO Interfaces and Implementations
- JDBC Utility
- Database Connection Management

d. Model Layer
- Domain Objects (Student, Course, Grade, etc.)

e. External Systems
- MySQL Database
- Email Server
- Client-Server Communication

**[User Interface Layer]**
- ↑↓
**[Controller Layer]**
- ↑↓
**[Service Layer]**
- ↑↓
**[Data Access Layer]**
- ↑↓
**[Database]**

##### Key Relationships to Highlight

a. User Interface Flow:
- Login Screen → Main Screen
- Registration Flow
- Password Recovery Flow

b. Data Flow:
- Controller → Service → DAO → Database
- Email Notifications
- Client-Server Communication

##### Detailed Component Breakdown

Frontend:
**[JavaFX Views]**
- LoginScreen
- MainScreen
- RegisterScreen
- ForgotPassword
- ↓
**[Controllers]**
- LoginController
- MainScreenController
- RegisterController
- ForgotPassController

Service Layer:
**[Authentication]**
- LoginHandler
- RegisterHandler
- ForgotPasswordHandl
- ↓
**[Business Logic]**
- UpdateDataHandle
- ExportFileHandle
- EmailHandler
- ↓
**[Network]**
- Client
- Server
- ClientHandler

Data Access:
**[DAO Interface]**
- ↓
**[DAO Implementations]**
- StudentDAO
- CourseDAO
- GradeDAO
- TeacherDAO
- ↓
**[JDBC Utility]**

##### Additional Elements

- Version information and technology stack details
- Database schema relationships
- Error handling and logging flows
- Document the file export process

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles
    classDef ui fill:#3498db,stroke:#2980b9,color:white
    classDef controller fill:#2ecc71,stroke:#27ae60,color:white
    classDef service fill:#f1c40f,stroke:#f39c12,color:black
    classDef dao fill:#e67e22,stroke:#d35400,color:white
    classDef model fill:#9b59b6,stroke:#8e44ad,color:white
    classDef external fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef network fill:#1abc9c,stroke:#16a085,color:white

    %% User Interface Layer
    subgraph UI
        Login["Login Screen"]:::ui
        Main["Main Screen"]:::ui
        Register["Register Screen"]:::ui
        ForgotPass["Forgot Password"]:::ui
        
        CSS["Styling (CSS)"]:::ui
    end

    %% Controller Layer
    subgraph Controllers
        LoginCtrl["Login Controller"]:::controller
        MainCtrl["Main Screen Controller"]:::controller
        RegCtrl["Register Controller"]:::controller
        ForgotCtrl["Forgot Password Controller"]:::controller
    end

    %% Service Layer
    subgraph Services
        AuthServices["Authentication Services"]:::service
        BusinessLogic["Business Logic Services"]:::service
        EmailService["Email Service"]:::service
    end

    %% Network Layer
    subgraph Network
        Client["Client"]:::network
        Server["Server"]:::network
        ClientHandler["Client Handler"]:::network
    end

    %% Data Access Layer
    subgraph DataAccess
        DAOInterface["DAO Interface"]:::dao
        JDBCUtil["JDBC Utility"]:::dao
        StudentDAO["Student DAO"]:::dao
        CourseDAO["Course DAO"]:::dao
        GradeDAO["Grade DAO"]:::dao
        TeacherDAO["Teacher DAO"]:::dao
    end

    %% Model Layer
    subgraph Models
        Student["Student"]:::model
        Course["Course"]:::model
        Grade["Grade"]:::model
        Teacher["Teacher"]:::model
        Schedule["Class Schedule"]:::model
    end

    %% External Systems
    Database[(MySQL Database)]:::external
    EmailServer["Email Server"]:::external

    %% Relationships
    UI --> Controllers
    Controllers --> Services
    Services --> Network
    Network --> DataAccess
    DataAccess --> Database
    Services --> EmailServer
    Models --> DataAccess

    %% Click Events
    click Login "https://github.com/NguyenMinhDuc163/Student_Records_Manager/blob/main/src/main/resources/view/loginScreen.fxml"
    click Main "https://github.com/NguyenMinhDuc163/Student_Records_Manager/blob/main/src/main/resources/view/MainScreens.fxml"
    click Register "https://github.com/NguyenMinhDuc163/Student_Records_Manager/blob/main/src/main/resources/view/RegisterScreen.fxml"
    click ForgotPass "https://github.com/NguyenMinhDuc163/Student_Records_Manager/blob/main/src/main/resources/view/ForgotPassword.fxml"
    click CSS "https://github.com/NguyenMinhDuc163/Student_Records_Manager/tree/main/src/main/resources/css"
    click LoginCtrl "https://github.com/NguyenMinhDuc163/Student_Records_Manager/blob/main/src/main/java/controllers/LoginController.java"
    click MainCtrl "https://github.com/NguyenMinhDuc163/Student_Records_Manager/blob/main/src/main/java/controllers/MainScreenController.java"
    click RegCtrl "https://github.com/NguyenMinhDuc163/Student_Records_Manager/blob/main/src/main/java/controllers/RegisterController.java"
    click ForgotCtrl "https://github.com/NguyenMinhDuc163/Student_Records_Manager/blob/main/src/main/java/controllers/ForgotPassController.java"
    click AuthServices "https://github.com/NguyenMinhDuc163/Student_Records_Manager/tree/main/src/main/java/service"
    click EmailService "https://github.com/NguyenMinhDuc163/Student_Records_Manager/blob/main/src/main/java/util/EmailHandler.java"
    click Client "https://github.com/NguyenMinhDuc163/Student_Records_Manager/blob/main/src/main/java/util/Client.java"
    click Server "https://github.com/NguyenMinhDuc163/Student_Records_Manager/blob/main/src/main/java/util/Server.java"
    click ClientHandler "https://github.com/NguyenMinhDuc163/Student_Records_Manager/blob/main/src/main/java/util/ClientHandler.java"
    click DAOInterface "https://github.com/NguyenMinhDuc163/Student_Records_Manager/blob/main/src/main/java/dao/DAOInterface.java"
    click JDBCUtil "https://github.com/NguyenMinhDuc163/Student_Records_Manager/blob/main/src/main/java/dao/JDBCUtil.java"
    click StudentDAO "https://github.com/NguyenMinhDuc163/Student_Records_Manager/blob/main/src/main/java/dao/StudentDAO.java"
    click CourseDAO "https://github.com/NguyenMinhDuc163/Student_Records_Manager/blob/main/src/main/java/dao/CourseDAO.java"
    click GradeDAO "https://github.com/NguyenMinhDuc163/Student_Records_Manager/blob/main/src/main/java/dao/GradeDAO.java"
    click TeacherDAO "https://github.com/NguyenMinhDuc163/Student_Records_Manager/blob/main/src/main/java/dao/TeacherDao.java"
    click Student "https://github.com/NguyenMinhDuc163/Student_Records_Manager/blob/main/src/main/java/model/Student.java"
    click Course "https://github.com/NguyenMinhDuc163/Student_Records_Manager/blob/main/src/main/java/model/Course.java"
    click Grade "https://github.com/NguyenMinhDuc163/Student_Records_Manager/blob/main/src/main/java/model/Grade.java"
    click Teacher "https://github.com/NguyenMinhDuc163/Student_Records_Manager/blob/main/src/main/java/model/Teachers.java"
    click Schedule "https://github.com/NguyenMinhDuc163/Student_Records_Manager/blob/main/src/main/java/model/ClassSchedule.java"
```
