# abdelbasset-blip/khawa-felkhir architecture

> Architecture diagram of the GitHub repository abdelbasset-blip/khawa-felkhir, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/abdelbasset-blip/khawa-felkhir
- Repository: https://github.com/abdelbasset-blip/khawa-felkhir

## Overview

Khawa Felkhir is a charitable platform with a public-facing showcase and a secured administration area. Visitors browse impact and events, then can submit volunteer registrations or contact messages; administrators sign in to review dashboard information and manage beneficiaries, events, association settings, and team access. The backend exposes public and authenticated API routes, with controllers using Prisma for persistent data. The graph reflects the documented capabilities, but several frontend service and page implementations were not sampled, so some integration links remain unverified.

Main entry points: [`frontend/src/App.tsx`](https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/frontend/src/App.tsx) (Web app routes), [`backend/src/config/prisma.ts`](https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/backend/src/config/prisma.ts) (Prisma client), [`backend/src/app.ts`](https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/backend/src/app.ts) (Express API), [`frontend/src/lib/api-client.ts`](https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/frontend/src/lib/api-client.ts) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_web_app["Web app routes<br/>[App.tsx]"]
  node_public_experience["Public showcase<br/>[HomePage.tsx]"]
  node_public_events["Public events and contact"]
  node_admin_dashboard["Admin dashboard"]
  node_admin_beneficiaries["Beneficiary management"]
  node_admin_events["Event management<br/>[EvenementsPage.tsx]"]
  node_admin_settings["Association settings<br/>[SettingsPage.tsx]"]
  node_api_client["API client<br/>[api-client.ts]"]
  node_auth_hook["Auth workflow<br/>[useAuth.ts]"]
  node_auth_store["Auth state<br/>[auth.store.ts]"]
end

subgraph group_api["API and routing"]
  node_api_app["Express API<br/>[app.ts]"]
  node_public_routes["Public routes<br/>[public.routes.ts]"]
  node_auth_routes["Auth routes<br/>[auth.routes.ts]"]
  node_beneficiary_routes["Beneficiary routes"]
  node_event_routes["Event routes"]
  node_settings_routes["Settings routes<br/>[settings.routes.ts]"]
end

subgraph group_domain["Domain workflows"]
  node_public_workflow["Public events, signups, contact"]
  node_beneficiary_workflow["Beneficiary CRUD and export"]
  node_event_workflow["Event CRUD and publishing"]
  node_settings_workflow["Association and team settings"]
  node_share_links["Social share links<br/>[shareLinks.ts]"]
end

subgraph group_security["Authentication"]
  node_auth_workflow["Login and sessions<br/>[auth.controller.ts]"]
  node_auth_middleware["Access verification<br/>[auth.middleware.ts]"]
  node_token_utils["Token utilities<br/>[token.utils.ts]"]
end

subgraph group_persistence["Data access"]
  node_prisma_client["Prisma client<br/>[prisma.ts]"]
  node_postgres[("PostgreSQL")]
end

node_visitor(("Visitor"))
node_administrator(("Administrator"))

node_visitor -->|"browses"| node_web_app
node_administrator -->|"uses"| node_web_app
node_web_app -->|"routes to"| node_public_experience
node_web_app -->|"routes to"| node_public_events
node_web_app -->|"routes to"| node_admin_dashboard
node_web_app -->|"routes to"| node_admin_beneficiaries
node_web_app -->|"routes to"| node_admin_events
node_web_app -->|"routes to"| node_admin_settings
node_admin_beneficiaries -->|"uses via API"| node_api_client
node_admin_settings -.->|"uses via API"| node_api_client
node_public_experience -.->|"uses via API"| node_api_client
node_auth_hook -->|"calls"| node_api_client
node_auth_hook -->|"updates"| node_auth_store
node_api_client -->|"reads and updates"| node_auth_store
node_api_client -.->|"sends API requests"| node_api_app
node_api_app -->|"mounts"| node_public_routes
node_api_app -->|"mounts"| node_auth_routes
node_api_app -->|"mounts"| node_beneficiary_routes
node_api_app -->|"mounts"| node_event_routes
node_api_app -->|"mounts"| node_settings_routes
node_public_routes -->|"dispatches"| node_public_workflow
node_beneficiary_routes -->|"dispatches"| node_beneficiary_workflow
node_event_routes -->|"dispatches"| node_event_workflow
node_settings_routes -->|"dispatches"| node_settings_workflow
node_auth_routes -->|"dispatches"| node_auth_workflow
node_settings_routes -->|"requires"| node_auth_middleware
node_auth_middleware -->|"verifies token"| node_token_utils
node_auth_middleware -->|"checks user"| node_prisma_client
node_public_workflow -->|"reads and writes"| node_prisma_client
node_beneficiary_workflow -->|"reads and writes"| node_prisma_client
node_event_workflow -->|"reads and writes"| node_prisma_client
node_settings_workflow -->|"uses"| node_prisma_client
node_auth_workflow -->|"uses"| node_prisma_client
node_event_workflow -->|"builds links"| node_share_links
node_public_workflow -->|"builds links"| node_share_links
node_prisma_client -->|"persists data"| node_postgres

click node_web_app "https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/frontend/src/App.tsx"
click node_public_experience "https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/frontend/src/pages/public/HomePage.tsx"
click node_public_events "https://github.com/abdelbasset-blip/khawa-felkhir/tree/main/frontend/src/pages/public"
click node_admin_dashboard "https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/frontend/src/pages/admin/DashboardOverviewPage.tsx"
click node_admin_beneficiaries "https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/frontend/src/pages/admin/BeneficiairesPage.tsx"
click node_admin_events "https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/frontend/src/pages/admin/EvenementsPage.tsx"
click node_admin_settings "https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/frontend/src/pages/admin/SettingsPage.tsx"
click node_api_client "https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/frontend/src/lib/api-client.ts"
click node_auth_hook "https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/frontend/src/hooks/useAuth.ts"
click node_auth_store "https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/frontend/src/store/auth.store.ts"
click node_api_app "https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/backend/src/app.ts"
click node_public_routes "https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/backend/src/routes/public.routes.ts"
click node_auth_routes "https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/backend/src/routes/auth.routes.ts"
click node_beneficiary_routes "https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/backend/src/routes/beneficiaire.routes.ts"
click node_event_routes "https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/backend/src/routes/evenement.routes.ts"
click node_settings_routes "https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/backend/src/routes/settings.routes.ts"
click node_public_workflow "https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/backend/src/controllers/public.controller.ts"
click node_beneficiary_workflow "https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/backend/src/controllers/beneficiaire.controller.ts"
click node_event_workflow "https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/backend/src/controllers/evenement.controller.ts"
click node_settings_workflow "https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/backend/src/controllers/settings.controller.ts"
click node_auth_workflow "https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/backend/src/controllers/auth.controller.ts"
click node_auth_middleware "https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/backend/src/middlewares/auth.middleware.ts"
click node_token_utils "https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/backend/src/utils/token.utils.ts"
click node_share_links "https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/backend/src/utils/shareLinks.ts"
click node_prisma_client "https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/backend/src/config/prisma.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_web_app,node_public_experience,node_public_events,node_admin_dashboard,node_admin_beneficiaries,node_admin_events,node_admin_settings,node_api_client,node_auth_hook,node_auth_store toneBlue
class node_api_app,node_public_routes,node_auth_routes,node_beneficiary_routes,node_event_routes,node_settings_routes toneAmber
class node_public_workflow,node_beneficiary_workflow,node_event_workflow,node_settings_workflow,node_share_links toneMint
class node_auth_workflow,node_auth_middleware,node_token_utils toneRose
class node_prisma_client,node_postgres,node_visitor,node_administrator toneIndigo
```

## Components

### Web application

- [Web app routes](https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Public showcase](https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/frontend/src/pages/public/HomePage.tsx): `frontend/src/pages/public/HomePage.tsx`
- [Public events and contact](https://github.com/abdelbasset-blip/khawa-felkhir/tree/main/frontend/src/pages/public): `frontend/src/pages/public`
- [Admin dashboard](https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/frontend/src/pages/admin/DashboardOverviewPage.tsx): `frontend/src/pages/admin/DashboardOverviewPage.tsx`
- [Beneficiary management](https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/frontend/src/pages/admin/BeneficiairesPage.tsx): `frontend/src/pages/admin/BeneficiairesPage.tsx`
- [Event management](https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/frontend/src/pages/admin/EvenementsPage.tsx): `frontend/src/pages/admin/EvenementsPage.tsx`
- [Association settings](https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/frontend/src/pages/admin/SettingsPage.tsx): `frontend/src/pages/admin/SettingsPage.tsx`
- [API client](https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/frontend/src/lib/api-client.ts): `frontend/src/lib/api-client.ts`
- [Auth workflow](https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/frontend/src/hooks/useAuth.ts): `frontend/src/hooks/useAuth.ts`
- [Auth state](https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/frontend/src/store/auth.store.ts): `frontend/src/store/auth.store.ts`

### API and routing

- [Express API](https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/backend/src/app.ts): `backend/src/app.ts`
- [Public routes](https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/backend/src/routes/public.routes.ts): `backend/src/routes/public.routes.ts`
- [Auth routes](https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/backend/src/routes/auth.routes.ts): `backend/src/routes/auth.routes.ts`
- [Beneficiary routes](https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/backend/src/routes/beneficiaire.routes.ts): `backend/src/routes/beneficiaire.routes.ts`
- [Event routes](https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/backend/src/routes/evenement.routes.ts): `backend/src/routes/evenement.routes.ts`
- [Settings routes](https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/backend/src/routes/settings.routes.ts): `backend/src/routes/settings.routes.ts`

### Domain workflows

- [Public events, signups, contact](https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/backend/src/controllers/public.controller.ts): `backend/src/controllers/public.controller.ts`
- [Beneficiary CRUD and export](https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/backend/src/controllers/beneficiaire.controller.ts): `backend/src/controllers/beneficiaire.controller.ts`
- [Event CRUD and publishing](https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/backend/src/controllers/evenement.controller.ts): `backend/src/controllers/evenement.controller.ts`
- [Association and team settings](https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/backend/src/controllers/settings.controller.ts): `backend/src/controllers/settings.controller.ts`
- [Social share links](https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/backend/src/utils/shareLinks.ts): `backend/src/utils/shareLinks.ts`

### Authentication

- [Login and sessions](https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/backend/src/controllers/auth.controller.ts): `backend/src/controllers/auth.controller.ts`
- [Access verification](https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/backend/src/middlewares/auth.middleware.ts): `backend/src/middlewares/auth.middleware.ts`
- [Token utilities](https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/backend/src/utils/token.utils.ts): `backend/src/utils/token.utils.ts`

### Data access

- [Prisma client](https://github.com/abdelbasset-blip/khawa-felkhir/blob/main/backend/src/config/prisma.ts): `backend/src/config/prisma.ts`
- **PostgreSQL**

### Other components

- **Visitor**
- **Administrator**

## Connections

- Visitor → Web app routes: browses (evidence: `README.md`)
- Administrator → Web app routes: uses (evidence: `README.md`)
- Web app routes → Public showcase: routes to (evidence: `frontend/src/App.tsx`)
- Web app routes → Public events and contact: routes to (evidence: `frontend/src/App.tsx`)
- Web app routes → Admin dashboard: routes to (evidence: `frontend/src/App.tsx`)
- Web app routes → Beneficiary management: routes to (evidence: `frontend/src/App.tsx`)
- Web app routes → Event management: routes to (evidence: `frontend/src/App.tsx`)
- Web app routes → Association settings: routes to (evidence: `frontend/src/App.tsx`)
- Beneficiary management → API client: uses via API
- Association settings → API client: uses via API
- Public showcase → API client: uses via API
- Auth workflow → API client: calls (evidence: `frontend/src/hooks/useAuth.ts`)
- Auth workflow → Auth state: updates (evidence: `frontend/src/hooks/useAuth.ts`)
- API client → Auth state: reads and updates (evidence: `frontend/src/lib/api-client.ts`)
- API client → Express API: sends API requests
- Express API → Public routes: mounts (evidence: `backend/src/app.ts`)
- Express API → Auth routes: mounts (evidence: `backend/src/app.ts`)
- Express API → Beneficiary routes: mounts (evidence: `backend/src/app.ts`)
- Express API → Event routes: mounts (evidence: `backend/src/app.ts`)
- Express API → Settings routes: mounts (evidence: `backend/src/app.ts`)
- Public routes → Public events, signups, contact: dispatches (evidence: `backend/src/routes/public.routes.ts`)
- Beneficiary routes → Beneficiary CRUD and export: dispatches (evidence: `backend/src/routes/beneficiaire.routes.ts`)
- Event routes → Event CRUD and publishing: dispatches (evidence: `backend/src/routes/evenement.routes.ts`)
- Settings routes → Association and team settings: dispatches (evidence: `backend/src/routes/settings.routes.ts`)
- Auth routes → Login and sessions: dispatches (evidence: `backend/src/routes/auth.routes.ts`)
- Settings routes → Access verification: requires (evidence: `backend/src/routes/settings.routes.ts`)
- Access verification → Token utilities: verifies token (evidence: `backend/src/middlewares/auth.middleware.ts`)
- Access verification → Prisma client: checks user (evidence: `backend/src/middlewares/auth.middleware.ts`)
- Public events, signups, contact → Prisma client: reads and writes (evidence: `backend/src/controllers/public.controller.ts`)
- Beneficiary CRUD and export → Prisma client: reads and writes (evidence: `backend/src/controllers/beneficiaire.controller.ts`)
- Event CRUD and publishing → Prisma client: reads and writes (evidence: `backend/src/controllers/evenement.controller.ts`)
- Association and team settings → Prisma client: uses (evidence: `backend/src/controllers/settings.controller.ts`)
- Login and sessions → Prisma client: uses (evidence: `backend/src/controllers/auth.controller.ts`)
- Event CRUD and publishing → Social share links: builds links (evidence: `backend/src/controllers/evenement.controller.ts`)
- Public events, signups, contact → Social share links: builds links (evidence: `backend/src/controllers/public.controller.ts`)
- Prisma client → PostgreSQL: persists data (evidence: `README.md`)
