# abdallah116294/edulink architecture

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

- Interactive diagram: https://gitdiagram.com/abdallah116294/edulink
- Repository: https://github.com/abdallah116294/edulink

## Overview

##### Project type and purpose
- EduLink is a backend‐focused, full-stack educational management system built as an ASP.NET Core Web API following Clean Architecture.
- It provides REST endpoints for user management, student/staff operations, academic processes (classes, subjects, exams, grades, attendance), and financial management (fees).

##### File structure
- Top-level solution (EduLink.API.sln) spans five main projects:
- EduLink.API (Presentation / Web API)
- EduLink.Core (Domain)
- EduLink.Repository (Data Access)
- EduLink.Service (Business Logic)
- EduLink.Utilities (DTOs & Helpers)
- Edulink.Tests (Testing)
- Patterns:
- Controllers → call Services (in Service layer)
- Services → orchestrate Repositories via IUnitOfWork / Repositories (in Repository layer)
- Repositories → use EF Core DbContext → SQL Server
- Domain Entities live in Core; DTOs in Utilities
- Specifications encapsulate query logic
- AutoMapper profiles (MappingProfile) used to map Entities↔DTOs
- Extensions bootstrap DI, Swagger, Configuration

##### README for additional insights
- Design patterns: Repository, Unit of Work, Specification, Dependency Injection, CQRS
- Technology stack: ASP.NET Core 8.0, EF Core, SQL Server, ASP.NET Identity, Swagger, XUnit, Serilog, FluentValidation

##### Elements
- Rectangles for components

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Presentation Layer
    subgraph "Presentation Layer" 
        direction TB
        Controllers["Controllers"]:::presentation
        Swagger["Swagger/OpenAPI"]:::presentation
        AppServices["Dependency Injection Setup"]:::presentation
        AppConnectionString["Connection String Extension"]:::presentation
        Program["Program & Startup"]:::presentation
        MappingProfile["AutoMapper Profile"]:::presentation
    end

    %% Business Logic Layer
    subgraph "Business Logic Layer" 
        direction TB
        Services["Service Classes (AcademicStaffService, etc.)"]:::business
        UserService["UserService"]:::business
        EmailService["EmailService"]:::business
        RoleSeederService["RoleSeederService"]:::business
    end

    %% Data Access Layer
    subgraph "Data Access Layer"
        direction TB
        GenericRepo["GenericRepository"]:::data
        UnitOfWork["UnitOfWork"]:::data
        UserRepo["UserRepository"]:::data
        SpecEvaluator["SpecificationEvaluator"]:::data
        DbContext["EF Core DbContext"]:::data
        EntityConfigs["Entity Configurations"]:::data
        Migrations["EF Core Migrations"]:::data
    end

    %% Domain Layer (Core)
    subgraph "Domain Layer (Core)"
        direction TB
        Entities["Entities"]:::core
        RepoInterfaces["Repository Interfaces"]:::core
        ServiceInterfaces["Service Interfaces"]:::core
        Specifications["Specifications"]:::core
        SpecParams["Specification Parameters"]:::core
    end

    %% Shared Utilities
    subgraph "Shared Utilities"
        direction TB
        DTOs["DTOs"]:::util
        TokenHelper["TokenHelper"]:::util
    end

    %% External Systems
    subgraph "External Systems"
        direction TB
        SQLDB[(SQL Server)]:::external
        SMTP[(SMTP / Email Provider)]:::external
    end

    %% Relationships
    Client["Client"]:::external -->|HTTP Request| Controllers
    Controllers -->|calls IXXXService| Services
    Services -->|uses IUnitOfWork / Repositories| UnitOfWork
    UnitOfWork -->|provides| GenericRepo
    GenericRepo -->|operates on| DbContext
    DbContext -->|reads/writes| SQLDB
    Services -->|calls| EmailService
    EmailService -->|sends email via| SMTP
    Controllers -->|maps DTOs via| MappingProfile
    Controllers -->|DI registered in| AppServices
    Controllers -->|configures DB via| AppConnectionString
    Controllers -->|startup in| Program
    Services -->|interfaces defined in| ServiceInterfaces
    GenericRepo -->|interfaces defined in| RepoInterfaces
    SpecEvaluator -->|evaluates| Specifications
    Specifications -->|parametrized by| SpecParams
    Services -->|map Entities↔DTOs| DTOs
    TokenHelper -->|used by| Controllers
    TokenHelper -->|used by| Services

    %% Click Events - Presentation Layer
    click Controllers "https://github.com/abdallah116294/edulink/tree/master/EduLink.API/Controllers/"
    click Swagger "https://github.com/abdallah116294/edulink/blob/master/EduLink.API/Extensions/SwaggerGenExtension.cs"
    click AppServices "https://github.com/abdallah116294/edulink/blob/master/EduLink.API/Extensions/AppServices.cs"
    click AppConnectionString "https://github.com/abdallah116294/edulink/blob/master/EduLink.API/Extensions/AppConnectionString.cs"
    click Program "https://github.com/abdallah116294/edulink/blob/master/EduLink.API/Program.cs"
    click MappingProfile "https://github.com/abdallah116294/edulink/blob/master/EduLink.API/MappingProfile.cs"

    %% Click Events - Business Logic Layer
    click UserService "https://github.com/abdallah116294/edulink/blob/master/EduLink.Service/UserService/UserService.cs"
    click EmailService "https://github.com/abdallah116294/edulink/blob/master/EduLink.Service/UserService/EmailService.cs"
    click RoleSeederService "https://github.com/abdallah116294/edulink/blob/master/EduLink.Service/UserService/RoleSeederService.cs"

    %% Click Events - Data Access Layer
    click GenericRepo "https://github.com/abdallah116294/edulink/blob/master/EduLink.Repository/Repositories/GenericRepository.cs"
    click UnitOfWork "https://github.com/abdallah116294/edulink/blob/master/EduLink.Repository/Repositories/UnitOfWork.cs"
    click UserRepo "https://github.com/abdallah116294/edulink/blob/master/EduLink.Repository/Repositories/UserRepository.cs"
    click SpecEvaluator "https://github.com/abdallah116294/edulink/blob/master/EduLink.Repository/Repositories/SpecificationEvalutor.cs"
    click DbContext "https://github.com/abdallah116294/edulink/blob/master/EduLink.Repository/Data/EduLinkDbContext.cs"
    click EntityConfigs "https://github.com/abdallah116294/edulink/tree/master/EduLink.Repository/Data/Configurations/"
    click Migrations "https://github.com/abdallah116294/edulink/tree/master/EduLink.Repository/Data/Migrations/"

    %% Click Events - Domain Layer
    click Entities "https://github.com/abdallah116294/edulink/tree/master/EduLink.Core/Entities/"
    click RepoInterfaces "https://github.com/abdallah116294/edulink/tree/master/EduLink.Core/IRepositories/"
    click ServiceInterfaces "https://github.com/abdallah116294/edulink/tree/master/EduLink.Core/IServices/"
    click Specifications "https://github.com/abdallah116294/edulink/tree/master/EduLink.Core/Specifications/"
    click SpecParams "https://github.com/abdallah116294/edulink/tree/master/EduLink.Core/Specifications/Parames/"

    %% Click Events - Utilities
    click DTOs "https://github.com/abdallah116294/edulink/tree/master/EduLink.Utilities/DTO/"
    click TokenHelper "https://github.com/abdallah116294/edulink/blob/master/EduLink.Utilities/Helpers/TokenHelper.cs"

    %% Styles
    classDef presentation fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef business fill:#90EE90,stroke:#000,stroke-width:1px
    classDef data fill:#FFA500,stroke:#000,stroke-width:1px
    classDef core fill:#D3D3D3,stroke:#000,stroke-width:1px
    classDef util fill:#E0FFFF,stroke:#000,stroke-width:1px
    classDef external fill:#FFFACD,stroke:#000,stroke-dasharray: 5 5,stroke-width:1px
```
