# ibtikar-syria/tanzeem architecture

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

- Interactive diagram: https://gitdiagram.com/ibtikar-syria/tanzeem
- Repository: https://github.com/ibtikar-syria/tanzeem

## Overview

##### Main System Components

a. Frontend Layer (Multiple Clients)
- Next.js Application (Modern frontend)
- Angular Application (Legacy/Alternative frontend)
- Both clients connecting to the backend via HTTP API

b. Backend Layer (ASP.NET Core)
- HTTP API Host (Main API entry point)
- Application Layer (Business logic)
- Domain Layer (Core business rules)
- Infrastructure Layer (Data access)

c. Database Layer
- Entity Framework Core
- Database (likely SQL Server based on the migrations)

##### Detailed Component Breakdown

a. Frontend Section:
- Shared components and routing structures

b. Backend Section (apps/server):
- API Gateway Layer (Tanzeem.HttpApi.Host)
- Application Services Layer (Tanzeem.Application)
- Domain Services Layer (Tanzeem.Domain)
- Data Access Layer (Tanzeem.EntityFrameworkCore)

c. Cross-Cutting Concerns:
- Authentication/Authorization (OpenIddict)
- Localization (Multiple language support)
- Health Checks
- Multi-tenancy support

Following interactions:
- Frontend clients → HTTP API Host
- HTTP API → Application Services
- Application Services → Domain Services
- Domain Services → Entity Framework Core
- Entity Framework Core → Database

##### Additional Elements

Supporting components:
- Docker container boundaries (based on Dockerfile presence)
- External service integrations
- Development tools and configuration
- CI/CD workflow connections (.github/workflows)

## Diagram (Mermaid)

```mermaid
graph TB
    %% Frontend Layer
    subgraph Clients
        Next["Next.js Client"]:::frontend
        Angular["Angular Client"]:::frontend
    end

    %% Backend Layer
    subgraph "Backend Services"
        API["HTTP API Host"]:::api
        Auth["OpenIddict Auth"]:::security
        Health["Health Checks"]:::service
        Local["Localization"]:::service
        MTenancy["Multi-tenancy"]:::service

        subgraph "Application Layer"
            AppServices["Application Services"]:::application
        end

        subgraph "Domain Layer"
            DomainServices["Domain Services"]:::domain
        end
    end

    %% Data Layer
    subgraph "Data Access"
        EFCore["Entity Framework Core"]:::data
        Migrations["Database Migrations"]:::data
        DBMigrator["DB Migrator"]:::data
        DB[(Database)]:::database
    end

    %% Connections
    Next --> |HTTP| API
    Angular --> |HTTP| API
    API --> Auth
    API --> Health
    API --> Local
    API --> MTenancy
    API --> AppServices
    AppServices --> DomainServices
    DomainServices --> EFCore
    EFCore --> DB
    DBMigrator --> DB
    Migrations --> DB

    %% Styles
    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef api fill:#2ecc71,stroke:#27ae60,color:white
    classDef application fill:#2ecc71,stroke:#27ae60,color:white
    classDef domain fill:#f1c40f,stroke:#f39c12,color:black
    classDef data fill:#9b59b6,stroke:#8e44ad,color:white
    classDef security fill:#e74c3c,stroke:#c0392b,color:white
    classDef service fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef database fill:#34495e,stroke:#2c3e50,color:white

    %% Click Events
    click Next "https://github.com/ibtikar-syria/tanzeem/tree/main/apps/frontend/"
    click Angular "https://github.com/ibtikar-syria/tanzeem/tree/main/apps/server/angular/"
    click API "https://github.com/ibtikar-syria/tanzeem/tree/main/apps/server/src/Tanzeem.HttpApi.Host/"
    click AppServices "https://github.com/ibtikar-syria/tanzeem/tree/main/apps/server/src/Tanzeem.Application/"
    click DomainServices "https://github.com/ibtikar-syria/tanzeem/tree/main/apps/server/src/Tanzeem.Domain/"
    click EFCore "https://github.com/ibtikar-syria/tanzeem/tree/main/apps/server/src/Tanzeem.EntityFrameworkCore/"
    click Auth "https://github.com/ibtikar-syria/tanzeem/tree/main/apps/server/src/Tanzeem.Domain/OpenIddict/"
    click Local "https://github.com/ibtikar-syria/tanzeem/tree/main/apps/server/src/Tanzeem.Domain.Shared/Localization/"
    click Health "https://github.com/ibtikar-syria/tanzeem/tree/main/apps/server/src/Tanzeem.HttpApi.Host/HealthChecks/"
    click MTenancy "https://github.com/ibtikar-syria/tanzeem/tree/main/apps/server/src/Tanzeem.Domain.Shared/MultiTenancy/"
    click Migrations "https://github.com/ibtikar-syria/tanzeem/tree/main/apps/server/src/Tanzeem.EntityFrameworkCore/Migrations/"
    click DBMigrator "https://github.com/ibtikar-syria/tanzeem/tree/main/apps/server/src/Tanzeem.DbMigrator/"
```
