# adel99sb/automatedreport architecture

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

- Interactive diagram: https://gitdiagram.com/adel99sb/automatedreport
- Repository: https://github.com/adel99sb/automatedreport

## Overview

##### Key Architectural Components

a. API Layer (Show as modules):
- Admin Dashboard Controllers
- Entity Services
- Background Jobs
- WhatsApp Integration Service

b. Core Business Modules (Group related components):
- Student Management
- Attendance Tracking
- Session Management
- Test/Grades Management
- Teacher Management
- Payment Processing

a. Client-Server Communication:
- Dashboard → API (HTTP/HTTPS requests)
- API → Database (Entity Framework Core)
- WhatsApp Service → External WhatsApp API

b. Service Layer Interactions:
- Controllers → Services
- Services → Unit of Work
- Unit of Work → Database Context

##### Cross-Cutting Concerns (Overlay across components)
- Authentication/Authorization
- Background Job Processing
- DTOs for data transfer
- Infrastructure services

##### Component Details

- Model classes (Student, Teacher, Class, etc.)
- Service interfaces and implementations
- Controllers and their responsibilities
- External integrations (WhatsApp)

##### Specific Implementation Notes

Callouts or notes for:
- Entity Framework Core usage
- MAUI Blazor architecture
- Service registration patterns
- Background job implementation

##### Data Model Relationships

A simplified ERD showing key entities:
- Students
- Teachers
- Classes
- Attendance
- Sessions
- Tests/Grades

- UI Layer at top
- API Layer in middle
- Data Layer at bottom

##### Related components
- Related services together
- Controllers by functionality
- Cluster related models

##### Important technical details
- .NET version
- Key frameworks used
- Database technology
- Authentication mechanism

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Frontend
        MAUI[".NET MAUI Blazor App"]:::frontend
        Pages["UI Pages & Components"]:::frontend
        Platform["Platform Implementations"]:::frontend
        Layout["Layout Components"]:::frontend
        
        MAUI --> Pages
        MAUI --> Platform
        MAUI --> Layout
    end

    subgraph API
        Controllers["API Controllers"]:::api
        Services["Entity Services"]:::service
        Contracts["Service Contracts"]:::service
        BGJobs["Background Jobs"]:::service
        WhatsApp["WhatsApp Integration"]:::service
        Infrastructure["Infrastructure Layer"]:::service
        ServiceReg["Service Registration"]:::service

        Controllers --> Services
        Services --> Contracts
        Services --> BGJobs
        Services --> WhatsApp
        Services --> Infrastructure
        ServiceReg --> Services
    end

    subgraph Data
        Context["Database Context"]:::data
        Models["Data Models"]:::data
        DTOs["Data Transfer Objects"]:::data
        Migrations["Database Migrations"]:::data

        Context --> Models
        Services --> DTOs
        Context --> Migrations
    end

    Frontend --> API
    API --> Data

    %% Component Mappings
    click MAUI "https://github.com/adel99sb/AutomatedReport/tree/master/AutomatedReportDashboard/"
    click Pages "https://github.com/adel99sb/AutomatedReport/tree/master/AutomatedReportDashboard/Components/Pages/"
    click Platform "https://github.com/adel99sb/AutomatedReport/tree/master/AutomatedReportDashboard/Platforms/"
    click Layout "https://github.com/adel99sb/AutomatedReport/tree/master/AutomatedReportDashboard/Components/Layout/"
    click Controllers "https://github.com/adel99sb/AutomatedReport/tree/master/AutomatedReportAPI/Controllers/AdminDashboard/"
    click Services "https://github.com/adel99sb/AutomatedReport/tree/master/AutomatedReportAPI/Services/EntityServices/Service/"
    click Contracts "https://github.com/adel99sb/AutomatedReport/tree/master/AutomatedReportAPI/Services/EntityServices/Contracts/"
    click BGJobs "https://github.com/adel99sb/AutomatedReport/tree/master/AutomatedReportAPI/Services/BackgroundJobs/"
    click WhatsApp "https://github.com/adel99sb/AutomatedReport/tree/master/AutomatedReportAPI/Services/WhatsAppSetting/"
    click Infrastructure "https://github.com/adel99sb/AutomatedReport/tree/master/AutomatedReportAPI/Infrastructure/"
    click Context "https://github.com/adel99sb/AutomatedReport/blob/master/AutomatedReportAPI/AppData/Context/ApplicationDbContext.cs"
    click Models "https://github.com/adel99sb/AutomatedReport/tree/master/AutomatedReportAPI/AppData/Models/"
    click DTOs "https://github.com/adel99sb/AutomatedReport/tree/master/AutomatedReport_DTOs/"
    click ServiceReg "https://github.com/adel99sb/AutomatedReport/blob/master/AutomatedReportAPI/Services/ServiceRegistrationExtensions.cs"
    click Migrations "https://github.com/adel99sb/AutomatedReport/tree/master/AutomatedReportAPI/Migrations/"

    %% Styling
    classDef frontend fill:#2196F3,stroke:#1565C0,color:white
    classDef api fill:#4CAF50,stroke:#2E7D32,color:white
    classDef service fill:#FF9800,stroke:#EF6C00,color:white
    classDef data fill:#9E9E9E,stroke:#616161,color:white

    %% Legend
    subgraph Legend
        Frontend_L[Frontend Components]:::frontend
        API_L[API Layer]:::api
        Service_L[Services]:::service
        Data_L[Data Layer]:::data
    end
```
