# nhuquynh5654/duan_nhom3 architecture

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

- Interactive diagram: https://gitdiagram.com/nhuquynh5654/duan_nhom3
- Repository: https://github.com/nhuquynh5654/duan_nhom3

## Overview

##### Project type and purpose
- This is an ASP .NET Core Web-API project (no UI code here) whose domain is a school management system. It exposes REST endpoints for entities like Class, Department, Subject, Teacher, SchoolYear, etc.
- Key indicators:
- A `*.sln` and `*.csproj` for .NET 6.0
- A `Controllers` folder full of `*Controller.cs` classes
- An `ApplicationDbContext` in `Data/` plus EF Core migrations
- A service layer under `Service/` and matching interfaces under `Irepository/`

##### File structure
- Top-level: Solution file `DuAnThucTap.sln`, project folder `DuAnThucTap/`, README
- Under `DuAnThucTap/` you have:
- Controllers/ – Web-API entry points
- Service/ – business logic implementations
- Irepository/ – service interfaces for DI
- Data/ – EF Core `ApplicationDbContext`
- Migrations/ – EF Core schema evolution
- Model/ – domain entities (Class, Department, Teacher, etc.)
- Program.cs & appsettings.json – host set-up and configuration

##### README
- It simply lists typical ignores (`bin/`, `obj/`, IDE-files). No architectural guidance is present.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Clients"
        Client["REST Client/Browser"]:::client
    end

    subgraph "Hosting Layer"
        Program["Program.cs"]:::config
        Config["appsettings.json"]:::config
        Host["Kestrel / ASP.NET Core Host"]:::host
    end

    subgraph "Presentation Layer"
        ControllersSub["Controllers"]:::controllers
    end

    subgraph "Business Layer"
        ServicesSub["Services"]:::service
        InterfacesSub["Repository Interfaces"]:::service
    end

    subgraph "Data Layer"
        DbContext["ApplicationDbContext"]:::data
        MigrationsSub["Migrations"]:::data
        Models["Domain Models"]:::data
    end

    Database["Relational Database"]:::database

    Client -->|"HTTP GET/POST"| Host
    Program -->|"configures"| Host
    Config -->|"provides JSON config"| Host
    Host -->|"Routes request"| ControllersSub
    ControllersSub -->|"await _service.Method()"| ServicesSub
    ServicesSub -->|"calls interface methods"| InterfacesSub
    InterfacesSub -->|"uses DbContext"| DbContext
    DbContext -->|"CRUD operations / EF Core"| Database
    MigrationsSub -->|"manage schema"| Database
    Models -->|"entity mapping"| DbContext

    click ControllersSub "https://github.com/nhuquynh5654/duan_nhom3/tree/main/DuAnThucTap/Controllers/"
    click ServicesSub "https://github.com/nhuquynh5654/duan_nhom3/tree/main/DuAnThucTap/Service/"
    click InterfacesSub "https://github.com/nhuquynh5654/duan_nhom3/tree/main/DuAnThucTap/Irepository/"
    click DbContext "https://github.com/nhuquynh5654/duan_nhom3/blob/main/DuAnThucTap/Data/ApplicationDbContext.cs"
    click MigrationsSub "https://github.com/nhuquynh5654/duan_nhom3/tree/main/DuAnThucTap/Migrations/"
    click Models "https://github.com/nhuquynh5654/duan_nhom3/tree/main/DuAnThucTap/Model/"
    click Program "https://github.com/nhuquynh5654/duan_nhom3/blob/main/DuAnThucTap/Program.cs"
    click Config "https://github.com/nhuquynh5654/duan_nhom3/blob/main/DuAnThucTap/appsettings.json"

    classDef client fill:#f9f,stroke:#333,stroke-width:1px
    classDef host fill:#bbf,stroke:#333,stroke-width:1px
    classDef controllers fill:#afa,stroke:#333,stroke-width:1px
    classDef service fill:#aaf,stroke:#333,stroke-width:1px
    classDef data fill:#fab,stroke:#333,stroke-width:1px
    classDef database fill:#ccc,stroke:#333,stroke-width:2px
    classDef config fill:#fd0,stroke:#333,stroke-width:1px
```
