# mostafa-aljazar/graduation_project architecture

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

- Interactive diagram: https://gitdiagram.com/mostafa-aljazar/graduation_project
- Repository: https://github.com/mostafa-aljazar/graduation_project

## Overview

##### Project type and purpose
- Full-stack Next.js (App Router) web application written in TypeScript
- Domain: humanitarian aid management with four actor types (delegates, displaceds, managers, security) plus public landing and auth flows
- Client-side routing, SSR/SSG where appropriate, file uploads, email notifications

##### File structure
- src/app – Next.js pages organized by route folders (landing, auth, actor/(…))
- src/components – UI components split by domain and reusables (common, landing, actors/….)
- src/actions – Domain-driven “useCase” functions that wrap API calls (e.g. getDelegateProfile)
- src/services – Low-level HTTP client abstraction managing base URLs, headers
- src/hooks – Custom React hooks (e.g. useGetDelegatesNames) that compose actions + React Query
- src/providers – Context/providers (React Query, Mantine UI, auth adapter)
- src/utils – Generic utilities (auth session, upload thing, formatting)
- app/api – Next.js API route(s) (UploadThing file upload handler)
- config files – next.config.ts, tailwind.config.ts, tsconfig.json

##### README for additional insights
- Bootstrapped with create-next-app
- Uses next/font, deploys to Vercel
- No built-in backend besides the UploadThing route; primary data lives in external REST APIs

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Client Layer
    subgraph "Frontend (Client)"
        direction TB
        Browser["Browser/Client"]:::external
        Providers["Providers\n(src/providers)"]:::provider
        Pages["Pages\n(src/app)"]:::ui
        Components["Components\n(src/components)"]:::ui
        Hooks["Custom Hooks\n(src/hooks)"]:::data
    end

    %% Business Logic Layer
    subgraph "Business Logic Layer"
        direction TB
        Actions["Actions (useCases)\n(src/actions)"]:::logic
    end

    %% Data Access Layer
    subgraph "Data Access Layer"
        direction TB
        Services["Services\n(src/services/index.ts)"]:::service
    end

    %% Utility Functions
    subgraph "Utility Functions"
        direction TB
        Utils["Utils\n(src/utils)"]:::util
    end

    %% Backend/API Layer
    subgraph "Backend/API (Next.js Server)"
        direction TB
        API["UploadThing API\n(src/app/api/uploadthing/route.ts, core.ts)"]:::api
        ConfigNext["next.config.ts"]:::config
        ConfigTailwind["tailwind.config.ts"]:::config
        ConfigTS["tsconfig.json"]:::config
    end

    %% External Services
    subgraph "External Services"
        direction TB
        REST["External REST APIs"]:::external
        UploadThing["UploadThing CDN/Storage"]:::external
        Email["Email Service"]:::external
    end

    %% Data Flow Connections
    Browser --> Providers
    Providers --> Pages
    Pages --> Components
    Pages --> Hooks
    Components --> Hooks
    Hooks --> Actions
    Actions --> Services
    Services --> REST
    Services --> Utils
    Actions --> Utils
    Utils --> Email
    Pages --> API
    API --> UploadThing

    %% Click Events
    click Pages "https://github.com/mostafa-aljazar/graduation_project/tree/main/src/app"
    click Components "https://github.com/mostafa-aljazar/graduation_project/tree/main/src/components"
    click Actions "https://github.com/mostafa-aljazar/graduation_project/tree/main/src/actions"
    click Services "https://github.com/mostafa-aljazar/graduation_project/blob/main/src/services/index.ts"
    click Hooks "https://github.com/mostafa-aljazar/graduation_project/tree/main/src/hooks"
    click Providers "https://github.com/mostafa-aljazar/graduation_project/tree/main/src/providers"
    click Utils "https://github.com/mostafa-aljazar/graduation_project/tree/main/src/utils"
    click API "https://github.com/mostafa-aljazar/graduation_project/blob/main/src/app/api/uploadthing/route.ts"
    click ConfigNext "https://github.com/mostafa-aljazar/graduation_project/blob/main/next.config.ts"
    click ConfigTailwind "https://github.com/mostafa-aljazar/graduation_project/blob/main/tailwind.config.ts"
    click ConfigTS "https://github.com/mostafa-aljazar/graduation_project/blob/main/tsconfig.json"

    %% Styles
    classDef ui fill:#D6EAF8,stroke:#21618C,color:#1B4F72;
    classDef data fill:#FCF3CF,stroke:#B7950B,color:#7D6608;
    classDef logic fill:#FADBD8,stroke:#C0392B,color:#78281F;
    classDef service fill:#D5F5E3,stroke:#27AE60,color:#1E8449;
    classDef provider fill:#E8DAEF,stroke:#8E44AD,color:#4A235A;
    classDef util fill:#F5CBA7,stroke:#D35400,color:#784212;
    classDef api fill:#FDEBD0,stroke:#E67E22,color:#87431D;
    classDef external fill:#EBF5FB,stroke:#5DADE2,color:#1B4F72;
    classDef config fill:#F2F3F4,stroke:#A6ACAF,color:#566573;
```
