# hamzaomary/attendancesystem architecture

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

- Interactive diagram: https://gitdiagram.com/hamzaomary/attendancesystem
- Repository: https://github.com/hamzaomary/attendancesystem

## Overview

##### Project type and purpose
- This is a three-layered ASP.NET Core Web API project called “AttendanceSystem.”
- Its purpose is to manage attendance records, users, courses, classrooms, sections, etc., exposing endpoints for a front-end or external clients to consume.

##### File structure
- Top-level solution file (AttendanceSystem.sln) orchestrates three projects:
- AttendanceSystem.API – the presentation layer (Web API controllers, Program.cs, launch settings, appsettings).
- AttendanceSystem.Domain – the core domain and application logic (DbContext, entities, interfaces for repositories & services, service implementations).
- AttendanceSystem.Infra – the infrastructure/data-access layer (Entity Framework or ADO.NET repositories implementing domain interfaces).
- The Domain folder also contains the Local MDF database file.
- Patterns:
- Onion/Hexagonal architecture – layered separation.
- Repository Pattern – I*Repository interfaces in Domain.Interfaces.Repository and concrete implementations in Infra.Repository.
- Service Layer – I*Service in Domain.Interfaces.Service with implementations in Domain.Services.
- Configuration and DI happen in API/Program.cs using the csproj references.

##### README for additional insights
- README only contains the title, so no additional architecture guidance is provided. Use the code structure itself for insights.

##### Required elements
- Clear labels for each layer and component (e.g., Controllers, Services, Repositories, DbContext, Database).
External Client → Controller → Service → Repository → Database
Database → Repository → Service → Controller → External Client
- Blue for API layer
- Green for Domain layer
- Orange for Infra layer

## Diagram (Mermaid)

```mermaid
flowchart TB
    ExternalClient["External Client"]:::external

    subgraph "Solution Artifacts"
        SolutionFile["AttendanceSystem.sln"]:::artifact
        README["README.md"]:::artifact
    end

    subgraph "API Layer"
        Controllers["Controllers"]:::api
        Program["Program.cs"]:::api
        AppSettings["appsettings.json & appsettings.Development.json"]:::api
    end

    subgraph "Domain Layer"
        DbContext["AppDbContext"]:::domain
        DBFiles["Database1.mdf & Database1_log.ldf"]:::domain
        Entities["Entities"]:::domain
        RepoInterfaces["Repository Interfaces"]:::domain
        ServiceInterfaces["Service Interfaces"]:::domain
        ServiceImpl["Service Implementations"]:::domain
    end

    subgraph "Infrastructure Layer"
        RepoImpl["Repository Implementations"]:::infra
    end

    Database[(SQL Server MDF)]:::database

    ExternalClient -->|uses| Controllers
    Controllers -->|calls| ServiceInterfaces
    ServiceInterfaces -->|implemented by| ServiceImpl
    ServiceImpl -->|calls| RepoInterfaces
    RepoInterfaces -->|implemented by| RepoImpl
    RepoImpl -->|uses| DbContext
    DbContext -->|reads/writes| Database

    Program -->|configures DI for| ServiceInterfaces
    Program -->|configures DI for| RepoInterfaces
    Program -->|configures DI for| DbContext
    AppSettings -->|provides connection strings to| Program
    SolutionFile -->|orchestrates projects| Controllers
    SolutionFile -->|orchestrates projects| ServiceInterfaces
    SolutionFile -->|orchestrates projects| RepoImpl
    README -->|documents| Controllers

    click Controllers "https://github.com/hamzaomary/attendancesystem/tree/main/AttendanceSystem.API/Controllers"
    click Program "https://github.com/hamzaomary/attendancesystem/blob/main/AttendanceSystem.API/Program.cs"
    click AppSettings "https://github.com/hamzaomary/attendancesystem/blob/main/AttendanceSystem.API/appsettings.json"
    click DbContext "https://github.com/hamzaomary/attendancesystem/blob/main/AttendanceSystem.Domain/AppDbContext.cs"
    click DBFiles "https://github.com/hamzaomary/attendancesystem/blob/main/AttendanceSystem.Domain/Database1.mdf"
    click Entities "https://github.com/hamzaomary/attendancesystem/tree/main/AttendanceSystem.Domain/Entities"
    click RepoInterfaces "https://github.com/hamzaomary/attendancesystem/tree/main/AttendanceSystem.Domain/Interfaces/Repository"
    click ServiceInterfaces "https://github.com/hamzaomary/attendancesystem/tree/main/AttendanceSystem.Domain/Interfaces/Service"
    click ServiceImpl "https://github.com/hamzaomary/attendancesystem/tree/main/AttendanceSystem.Domain/Services"
    click RepoImpl "https://github.com/hamzaomary/attendancesystem/tree/main/AttendanceSystem.Infra/Repository"
    click SolutionFile "https://github.com/hamzaomary/attendancesystem/blob/main/AttendanceSystem.sln"
    click README "https://github.com/hamzaomary/attendancesystem/blob/main/README.md"

    classDef api fill:#ADD8E6,stroke:#333
    classDef domain fill:#90EE90,stroke:#333
    classDef infra fill:#FFA500,stroke:#333
    classDef database fill:#D3D3D3,stroke:#333,shape:cylinder
    classDef external fill:#DDA0DD,stroke:#333
    classDef artifact fill:#F0F0F0,stroke:#333
```
