# letuanthanh2203/windowprogrammingproject architecture

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

- Interactive diagram: https://gitdiagram.com/letuanthanh2203/windowprogrammingproject
- Repository: https://github.com/letuanthanh2203/windowprogrammingproject

## Overview

This is a Windows Forms student and academic administration application. Users authenticate, enter a role-aware main interface, and manage students, courses/classes, registrations, staff assignments, scores, schedules, contacts, and requests; reporting and AI chat provide additional workflows. Domain model classes execute SQL directly through the shared database connection. The graph reflects explicit model-to-database and sampled UI-to-service dependencies; several UI modules are represented from their filenames and index references, while unsampled wiring is omitted.

Main entry points: [`LoginForm/LoginForm/My_DB.cs`](https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/My_DB.cs) (SQL database), [`LoginForm/LoginForm/UI/f_EditScore.cs`](https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/UI/f_EditScore.cs) (Score editing and viewing), [`LoginForm/LoginForm/UI/f_ContactManage.cs`](https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/UI/f_ContactManage.cs) (Contact management), [`LoginForm/LoginForm/UI/f_LoginForm.cs`](https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/UI/f_LoginForm.cs) (Login and registration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and navigation"]
  node_login["Login and registration<br/>[f_LoginForm.cs]"]
  node_main["Main dashboard<br/>[f_Main.cs]"]
  node_session["Session state<br/>[Globals.cs]"]
  node_menu["Menu configuration"]
end

subgraph group_academics["Academic records"]
  node_studentui["Student management<br/>[f_AddStudent.cs]"]
  node_students["Student records<br/>[Student.cs]"]
  node_courseui["Course management<br/>[f_AddCourse.cs]"]
  node_courses["Course records<br/>[Course.cs]"]
  node_classui["Class management"]
  node_classes["Class records<br/>[Class.cs]"]
  node_registration["Course registration"]
  node_assignment["Staff assignments<br/>[Assign.cs]"]
  node_scores["Score records<br/>[Score.cs]"]
  node_scoreui["Score editing and viewing<br/>[f_EditScore.cs]"]
  node_schedule["Schedule<br/>[f_Schedule.cs]"]
end

subgraph group_operations["Campus operations"]
  node_contact["Contact management<br/>[f_ContactManage.cs]"]
  node_requests["Requests and approvals<br/>[f_Approve.cs]"]
  node_hr["HR management<br/>[HR.cs]"]
end

subgraph group_services["Shared services"]
  node_database[("SQL database<br/>[My_DB.cs]")]
  node_exports["Report export"]
  node_exportui["Export interface<br/>[f_ReportExport.cs]"]
  node_chatui["AI chat interface<br/>[f_ChatBotAI.cs]"]
  node_chat["AI chat service<br/>[AIChatService.cs]"]
  node_ai["AI student service<br/>[AIService.cs]"]
  node_validation["Input validation<br/>[ValidateData.cs]"]
  node_pagination["Pagination"]
  node_styles["UI styling<br/>[UIStyleHelper.cs]"]
end

node_user(("User"))
node_ai_api{{"AI API"}}

node_user -->|"signs in"| node_login
node_login -->|"sets session"| node_session
node_login -.->|"authenticates against"| node_database
node_user -.->|"opens app"| node_main
node_main -->|"loads menu"| node_menu
node_menu -->|"configures menu"| node_database
node_studentui -->|"manages"| node_students
node_students -->|"reads and writes"| node_database
node_courseui -.->|"manages"| node_courses
node_courses -->|"reads and writes"| node_database
node_classui -->|"manages"| node_classes
node_classes -->|"reads and writes"| node_database
node_registration -.->|"registers courses"| node_students
node_assignment -->|"assigns staff"| node_database
node_scoreui -->|"edits scores"| node_scores
node_scores -->|"reads and writes"| node_database
node_schedule -.->|"uses class data"| node_classes
node_contact -.->|"manages contacts"| node_database
node_requests -.->|"handles approvals"| node_database
node_hr -.->|"reads and writes"| node_database
node_exportui -->|"requests exports"| node_exports
node_scoreui -->|"exports scores"| node_exports
node_exports -.->|"exports records"| node_database
node_chatui -->|"sends messages"| node_chat
node_chat -.->|"sends requests"| node_ai_api
node_chat -->|"loads context"| node_database
node_ai -.->|"reads student data"| node_database
node_studentui -->|"validates input"| node_validation
node_scoreui -.->|"pages results"| node_pagination
node_scoreui -.->|"styles interface"| node_styles
node_contact -.->|"pages results"| node_pagination
node_contact -.->|"styles interface"| node_styles

click node_login "https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/UI/f_LoginForm.cs"
click node_main "https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/UI/f_Main.cs"
click node_session "https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/Helpers/Globals.cs"
click node_menu "https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/Helpers/MenuConfigDbHelper.cs"
click node_studentui "https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/UI/f_AddStudent.cs"
click node_students "https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/Models/Student.cs"
click node_courseui "https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/UI/f_AddCourse.cs"
click node_courses "https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/Models/Course.cs"
click node_classui "https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/UI/f_EditDeleteClass.cs"
click node_classes "https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/Models/Class.cs"
click node_registration "https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/UI/f_CourseRegistration.cs"
click node_assignment "https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/Models/Assign.cs"
click node_scores "https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/Models/Score.cs"
click node_scoreui "https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/UI/f_EditScore.cs"
click node_schedule "https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/UI/f_Schedule.cs"
click node_contact "https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/UI/f_ContactManage.cs"
click node_requests "https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/UI/f_Approve.cs"
click node_hr "https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/Models/HR.cs"
click node_database "https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/My_DB.cs"
click node_exports "https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/Services/ReportExportService.cs"
click node_exportui "https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/UI/f_ReportExport.cs"
click node_chatui "https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/UI/f_ChatBotAI.cs"
click node_chat "https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/AIChatService.cs"
click node_ai "https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/AIService.cs"
click node_validation "https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/ValidationLibrary/ValidateData.cs"
click node_pagination "https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/Helpers/PaginationHelper.cs"
click node_styles "https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/Helpers/UIStyleHelper.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_login,node_main,node_session,node_menu,node_user toneBlue
class node_studentui,node_students,node_courseui,node_courses,node_classui,node_classes,node_registration,node_assignment,node_scores,node_scoreui,node_schedule toneAmber
class node_contact,node_requests,node_hr,node_ai_api toneMint
class node_database,node_exports,node_exportui,node_chatui,node_chat,node_ai,node_validation,node_pagination,node_styles toneRose
```

## Components

### Access and navigation

- [Login and registration](https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/UI/f_LoginForm.cs): `LoginForm/LoginForm/UI/f_LoginForm.cs`
- [Main dashboard](https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/UI/f_Main.cs): `LoginForm/LoginForm/UI/f_Main.cs`
- [Session state](https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/Helpers/Globals.cs): `LoginForm/LoginForm/Helpers/Globals.cs`
- [Menu configuration](https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/Helpers/MenuConfigDbHelper.cs): `LoginForm/LoginForm/Helpers/MenuConfigDbHelper.cs`

### Academic records

- [Student management](https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/UI/f_AddStudent.cs): `LoginForm/LoginForm/UI/f_AddStudent.cs`
- [Student records](https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/Models/Student.cs): `LoginForm/LoginForm/Models/Student.cs`
- [Course management](https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/UI/f_AddCourse.cs): `LoginForm/LoginForm/UI/f_AddCourse.cs`
- [Course records](https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/Models/Course.cs): `LoginForm/LoginForm/Models/Course.cs`
- [Class management](https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/UI/f_EditDeleteClass.cs): `LoginForm/LoginForm/UI/f_EditDeleteClass.cs`
- [Class records](https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/Models/Class.cs): `LoginForm/LoginForm/Models/Class.cs`
- [Course registration](https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/UI/f_CourseRegistration.cs): `LoginForm/LoginForm/UI/f_CourseRegistration.cs`
- [Staff assignments](https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/Models/Assign.cs): `LoginForm/LoginForm/Models/Assign.cs`
- [Score records](https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/Models/Score.cs): `LoginForm/LoginForm/Models/Score.cs`
- [Score editing and viewing](https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/UI/f_EditScore.cs): `LoginForm/LoginForm/UI/f_EditScore.cs`
- [Schedule](https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/UI/f_Schedule.cs): `LoginForm/LoginForm/UI/f_Schedule.cs`

### Campus operations

- [Contact management](https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/UI/f_ContactManage.cs): `LoginForm/LoginForm/UI/f_ContactManage.cs`
- [Requests and approvals](https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/UI/f_Approve.cs): `LoginForm/LoginForm/UI/f_Approve.cs`
- [HR management](https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/Models/HR.cs): `LoginForm/LoginForm/Models/HR.cs`

### Shared services

- [SQL database](https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/My_DB.cs): `LoginForm/LoginForm/My_DB.cs`
- [Report export](https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/Services/ReportExportService.cs): `LoginForm/LoginForm/Services/ReportExportService.cs`
- [Export interface](https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/UI/f_ReportExport.cs): `LoginForm/LoginForm/UI/f_ReportExport.cs`
- [AI chat interface](https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/UI/f_ChatBotAI.cs): `LoginForm/LoginForm/UI/f_ChatBotAI.cs`
- [AI chat service](https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/AIChatService.cs): `LoginForm/LoginForm/AIChatService.cs`
- [AI student service](https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/AIService.cs): `LoginForm/LoginForm/AIService.cs`
- [Input validation](https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/ValidationLibrary/ValidateData.cs): `LoginForm/ValidationLibrary/ValidateData.cs`
- [Pagination](https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/Helpers/PaginationHelper.cs): `LoginForm/LoginForm/Helpers/PaginationHelper.cs`
- [UI styling](https://github.com/letuanthanh2203/windowprogrammingproject/blob/master/LoginForm/LoginForm/Helpers/UIStyleHelper.cs): `LoginForm/LoginForm/Helpers/UIStyleHelper.cs`

### Other components

- **User**
- **AI API**

## Connections

- User → Login and registration: signs in (evidence: `LoginForm/LoginForm/UI/f_LoginForm.cs`)
- Login and registration → Session state: sets session (evidence: `LoginForm/LoginForm/Helpers/Globals.cs`)
- Login and registration → SQL database: authenticates against
- User → Main dashboard: opens app
- Main dashboard → Menu configuration: loads menu (evidence: `LoginForm/LoginForm/UI/f_Main.cs`)
- Menu configuration → SQL database: configures menu (evidence: `LoginForm/LoginForm/Helpers/MenuConfigDbHelper.cs`)
- Student management → Student records: manages (evidence: `LoginForm/LoginForm/UI/f_AddStudent.cs`)
- Student records → SQL database: reads and writes (evidence: `LoginForm/LoginForm/Models/Student.cs`)
- Course management → Course records: manages
- Course records → SQL database: reads and writes (evidence: `LoginForm/LoginForm/Models/Course.cs`)
- Class management → Class records: manages (evidence: `LoginForm/LoginForm/UI/f_EditDeleteClass.cs`)
- Class records → SQL database: reads and writes (evidence: `LoginForm/LoginForm/Models/Class.cs`)
- Course registration → Student records: registers courses
- Staff assignments → SQL database: assigns staff (evidence: `LoginForm/LoginForm/Models/Assign.cs`)
- Score editing and viewing → Score records: edits scores (evidence: `LoginForm/LoginForm/UI/f_EditScore.cs`)
- Score records → SQL database: reads and writes (evidence: `LoginForm/LoginForm/Models/Score.cs`)
- Schedule → Class records: uses class data (evidence: `LoginForm/LoginForm/UI/f_Schedule.cs`)
- Contact management → SQL database: manages contacts
- Requests and approvals → SQL database: handles approvals
- HR management → SQL database: reads and writes
- Export interface → Report export: requests exports (evidence: `LoginForm/LoginForm/UI/f_ReportExport.cs`)
- Score editing and viewing → Report export: exports scores (evidence: `LoginForm/LoginForm/UI/f_EditScore.cs`)
- Report export → SQL database: exports records
- AI chat interface → AI chat service: sends messages (evidence: `LoginForm/LoginForm/UI/f_ChatBotAI.cs`)
- AI chat service → AI API: sends requests
- AI chat service → SQL database: loads context (evidence: `LoginForm/LoginForm/AIChatService.cs`)
- AI student service → SQL database: reads student data
- Student management → Input validation: validates input (evidence: `LoginForm/LoginForm/UI/f_AddStudent.cs`)
- Score editing and viewing → Pagination: pages results (evidence: `LoginForm/LoginForm/UI/f_EditScore.cs`)
- Score editing and viewing → UI styling: styles interface (evidence: `LoginForm/LoginForm/UI/f_EditScore.cs`)
- Contact management → Pagination: pages results (evidence: `LoginForm/LoginForm/UI/f_ContactManage.cs`)
- Contact management → UI styling: styles interface (evidence: `LoginForm/LoginForm/UI/f_ContactManage.cs`)
