# developmentt910/quanlysinhvien architecture

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

- Interactive diagram: https://gitdiagram.com/developmentt910/quanlysinhvien
- Repository: https://github.com/developmentt910/quanlysinhvien

## Overview

##### Project type and purpose
- This is a desktop, full-stack (client + local database) student-management application built on .NET (C# WinForms).
- The README calls out four main folders—DuLieu (data access), LopDoiTuong (domain objects), GiaoDien (UI forms), TienIch (utility code)—plus the entry point (Program.cs) and configuration (App.config).

##### File structure
Top-level items:
- Program.cs / App.config – application entry point & configuration
- DuLieu/ – Data Access Layer (DAL) classes
- LopDoiTuong/ – Domain Model classes (Student, Course, etc.)
- GiaoDien/ – Presentation Layer (WinForms UI)
- TienIch/ – Helpers & utilities (logging, validation, common routines)
- Properties/ and *.csproj/*.sln – Visual Studio metadata

##### README insights
- Mentions a three-layer separation: data access, domain objects, UI.

##### Main components and their roles
a. Presentation Layer (GiaoDien)
– WinForms UI Forms (AddStudentForm, EditCourseForm, MainDashboard)
– References Domain and Utilities
b. Domain Layer (LopDoiTuong)
– POCO classes: SinhVien, MonHoc, Enrollment, etc.
– Encapsulate business rules and object state
c. Data Access Layer (DuLieu)
– Repository or DAO classes: StudentRepository, CourseRepository
– Implements CRUD operations against the database (via ADO.NET / Entity Framework)
d. Utility Layer (TienIch)
– Static helper classes: ValidationHelper, Logger, ConfigurationManager
e. External Database
– SQL Server or local DB (specified in App.config connection string)

##### Relationships and interactions
- UI calls into Domain objects (e.g., create a SinhVien instance), then invokes Data Access methods to persist or retrieve data.
- Data Access uses App.config settings to connect to the database.
- Utility classes are used by all layers for logging, string formatting, validation, etc.

##### Architectural patterns & principles
- Three-tier architecture (Presentation / Domain / Data Access).
- Separation of concerns: each layer has its own responsibility.
- Dependency direction: UI → Domain → DAL → Database.
- Single Responsibility: each class or form has a focused role.
- Config-driven connection strings (App.config).

## Diagram (Mermaid)

```mermaid
graph TB
    %% Presentation Layer
    subgraph "Presentation Layer"
        direction TB
        MainDashboard["MainDashboard"]:::ui
        AddStudentForm["AddStudentForm"]:::ui
        EditCourseForm["EditCourseForm"]:::ui
        ProgramEntry["Program.cs"]:::metadata
    end

    %% Domain Layer
    subgraph "Domain Model Layer"
        direction TB
        SinhVien["SinhVien"]:::domain
        MonHoc["MonHoc"]:::domain
        Enrollment["Enrollment"]:::domain
    end

    %% Data Access Layer
    subgraph "Data Access Layer"
        direction TB
        StudentRepo["StudentRepository"]:::dal
        CourseRepo["CourseRepository"]:::dal
        AppConfig["App.config"]:::metadata
    end

    %% Database
    subgraph "External Database"
        direction TB
        SQLServerDB(("SQL Server DB")):::db
    end

    %% Utilities Layer
    subgraph "Utilities Layer"
        direction TB
        ValidationHelper["ValidationHelper"]:::util
        Logger["Logger"]:::util
        ConfigManager["ConfigurationManager"]:::util
    end

    %% Metadata / Project Files
    subgraph "Project Meta"
        direction TB
        Solution["StudentCourseManagement.sln"]:::metadata
        ProjectFile["QuanLySinhVien.csproj"]:::metadata
        PropertiesFolder["Properties"]:::metadata
        Readme["README.md"]:::metadata
    end

    %% Relationships
    MainDashboard -->|"uses"| SinhVien
    AddStudentForm -->|"uses"| SinhVien
    EditCourseForm -->|"uses"| MonHoc
    MainDashboard -->|"calls Validate() on"| ValidationHelper
    AddStudentForm -->|"calls Validate() on"| ValidationHelper
    EditCourseForm -->|"logs via"| Logger

    SinhVien -->|"Save()/Load() via"| StudentRepo
    MonHoc -->|"Save()/Load() via"| CourseRepo
    Enrollment -->|"handled by"| StudentRepo

    StudentRepo -->|"reads/writes| App.config"| SQLServerDB
    CourseRepo -->|"reads/writes| App.config"| SQLServerDB

    ValidationHelper -->|"utilized by"| MainDashboard
    ValidationHelper -->|"utilized by"| AddStudentForm
    ValidationHelper -->|"utilized by"| EditCourseForm
    Logger -->|"utilized by"| StudentRepo
    ConfigManager -->|"provides settings to"| StudentRepo
    ConfigManager -->|"provides settings to"| CourseRepo

    %% Click Events
    click ProgramEntry "https://github.com/developmentt910/quanlysinhvien/blob/main/Program.cs"
    click AppConfig "https://github.com/developmentt910/quanlysinhvien/blob/main/App.config"
    click PropertiesFolder "https://github.com/developmentt910/quanlysinhvien/tree/main/Properties"
    click ProjectFile "https://github.com/developmentt910/quanlysinhvien/blob/main/QuanLySinhVien.csproj"
    click Solution "https://github.com/developmentt910/quanlysinhvien/blob/main/StudentCourseManagement.sln"
    click Readme "https://github.com/developmentt910/quanlysinhvien/blob/main/README.md"

    %% Styling
    classDef ui fill:#D6E9FF,stroke:#000,stroke-width:1px;
    classDef domain fill:#DFF0D8,stroke:#000,stroke-width:1px;
    classDef dal fill:#FCF8E3,stroke:#000,stroke-width:1px;
    classDef util fill:#F2DEDE,stroke:#000,stroke-width:1px;
    classDef db fill:#EEEEEE,stroke:#000,stroke-width:1px,stroke-dasharray: 5 5;
    classDef metadata fill:#F0F0F0,stroke:#000,stroke-width:1px;
```
