# uzairbi/uzair_ngo_v17 architecture

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

- Interactive diagram: https://gitdiagram.com/uzairbi/uzair_ngo_v17
- Repository: https://github.com/uzairbi/uzair_ngo_v17

## Overview

Sahara Jan Kalyan Samiti is a dynamic NGO website with a public information and engagement experience, plus an admin panel and a Node server for managing operational data. Visitors browse programmes, reports, news and events, then can donate or submit forms; admins manage content and submissions. The README documents the major capabilities, while the excerpts show routing, live-data loading, admin dispatch and selected server behavior. Many page and route implementations were not sampled, so some documented subsystem links are shown as unverified.

Main entry points: [`src/App.tsx`](https://github.com/uzairbi/uzair_ngo_v17/blob/main/src/App.tsx) (Website routes), [`server/index.js`](https://github.com/uzairbi/uzair_ngo_v17/blob/main/server/index.js) (HTTP server), [`src/hooks/useLiveData.ts`](https://github.com/uzairbi/uzair_ngo_v17/blob/main/src/hooks/useLiveData.ts) (Live data loader), [`admin/js/app.js`](https://github.com/uzairbi/uzair_ngo_v17/blob/main/admin/js/app.js) (Admin panel)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public website"]
  node_webapp["Website routes<br/>[App.tsx]"]
  node_layout["Shared layout<br/>[Layout.tsx]"]
  node_i18n["Language context<br/>[LangContext.tsx]"]
end

subgraph group_content["Content and engagement"]
  node_home["Home experience<br/>[Home.tsx]"]
  node_programmes["Programmes and projects<br/>[Projects.tsx]"]
  node_impact["Impact and reports<br/>[Transparency.tsx]"]
  node_news["News and stories<br/>[News.tsx]"]
  node_media["Gallery and media<br/>[Media.tsx]"]
  node_events["Events calendar<br/>[Events.tsx]"]
  node_live["Live data loader<br/>[useLiveData.ts]"]
  node_contentdata["Programme content<br/>[content.ts]"]
  node_newsdata["News content<br/>[news.ts]"]
  node_forms["Visitor forms<br/>[forms.ts]"]
  node_donate["Donation page<br/>[Donate.tsx]"]
end

subgraph group_admin["Administration"]
  node_adminapp["Admin panel<br/>[app.js]"]
  node_adminpanels["Management panels"]
  node_adminauth["Admin authentication<br/>[supabase.js]"]
end

subgraph group_backend["Server and persistence"]
  node_server["HTTP server<br/>[index.js]"]
  node_routes["API route handlers"]
  node_auth["Session authentication<br/>[auth.js]"]
  node_database[("SQLite database<br/>[db.js]")]
  node_http["HTTP utilities<br/>[http.js]"]
  node_webhook["Payment webhook<br/>[webhooks.js]"]
end

node_visitor(("Visitor"))
node_payment["Razorpay"]
node_adminuser(("Administrator"))
node_supabase["Supabase services<br/>[supabase.ts]"]
node_livejson["Live JSON data"]

node_visitor -->|"browses"| node_webapp
node_webapp -->|"wraps routes"| node_layout
node_webapp -->|"routes to"| node_home
node_webapp -->|"routes to"| node_programmes
node_webapp -->|"routes to"| node_impact
node_webapp -->|"routes to"| node_news
node_webapp -->|"routes to"| node_media
node_webapp -->|"routes to"| node_events
node_home -->|"renders content"| node_contentdata
node_home -->|"loads live data"| node_live
node_news -->|"renders stories"| node_newsdata
node_events -.->|"loads event data"| node_live
node_live -->|"fetches"| node_livejson
node_live -->|"requests public events"| node_server
node_live -->|"loads fallback events"| node_supabase
node_webapp -->|"provides language"| node_i18n
node_visitor -.->|"submits details"| node_forms
node_forms -.->|"saves requests"| node_server
node_visitor -->|"opens donation page"| node_donate
node_donate -->|"opens payment page"| node_payment
node_adminuser -->|"signs in"| node_adminapp
node_adminapp -->|"authenticates with"| node_adminauth
node_adminapp -->|"dispatches panels"| node_adminpanels
node_adminapp -.->|"manages submissions"| node_server
node_server -->|"checks sessions"| node_auth
node_server -->|"dispatches requests"| node_routes
node_server -->|"sends responses"| node_http
node_routes -->|"reads and writes"| node_database
node_webhook -->|"upserts donations"| node_database

click node_webapp "https://github.com/uzairbi/uzair_ngo_v17/blob/main/src/App.tsx"
click node_layout "https://github.com/uzairbi/uzair_ngo_v17/blob/main/src/components/Layout.tsx"
click node_home "https://github.com/uzairbi/uzair_ngo_v17/blob/main/src/pages/Home.tsx"
click node_programmes "https://github.com/uzairbi/uzair_ngo_v17/blob/main/src/pages/Projects.tsx"
click node_impact "https://github.com/uzairbi/uzair_ngo_v17/blob/main/src/pages/Transparency.tsx"
click node_news "https://github.com/uzairbi/uzair_ngo_v17/blob/main/src/pages/News.tsx"
click node_media "https://github.com/uzairbi/uzair_ngo_v17/blob/main/src/pages/Media.tsx"
click node_events "https://github.com/uzairbi/uzair_ngo_v17/blob/main/src/pages/Events.tsx"
click node_live "https://github.com/uzairbi/uzair_ngo_v17/blob/main/src/hooks/useLiveData.ts"
click node_contentdata "https://github.com/uzairbi/uzair_ngo_v17/blob/main/src/data/content.ts"
click node_newsdata "https://github.com/uzairbi/uzair_ngo_v17/blob/main/src/data/news.ts"
click node_i18n "https://github.com/uzairbi/uzair_ngo_v17/blob/main/src/i18n/LangContext.tsx"
click node_forms "https://github.com/uzairbi/uzair_ngo_v17/blob/main/src/lib/forms.ts"
click node_donate "https://github.com/uzairbi/uzair_ngo_v17/blob/main/src/pages/Donate.tsx"
click node_adminapp "https://github.com/uzairbi/uzair_ngo_v17/blob/main/admin/js/app.js"
click node_adminpanels "https://github.com/uzairbi/uzair_ngo_v17/tree/main/admin/js"
click node_adminauth "https://github.com/uzairbi/uzair_ngo_v17/blob/main/admin/js/supabase.js"
click node_server "https://github.com/uzairbi/uzair_ngo_v17/blob/main/server/index.js"
click node_routes "https://github.com/uzairbi/uzair_ngo_v17/tree/main/server/routes"
click node_auth "https://github.com/uzairbi/uzair_ngo_v17/blob/main/server/auth.js"
click node_database "https://github.com/uzairbi/uzair_ngo_v17/blob/main/server/db.js"
click node_http "https://github.com/uzairbi/uzair_ngo_v17/blob/main/server/http.js"
click node_webhook "https://github.com/uzairbi/uzair_ngo_v17/blob/main/server/routes/webhooks.js"
click node_supabase "https://github.com/uzairbi/uzair_ngo_v17/blob/main/src/lib/supabase.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_webapp,node_layout,node_i18n toneBlue
class node_home,node_programmes,node_impact,node_news,node_media,node_events,node_live,node_contentdata,node_newsdata,node_forms,node_donate toneAmber
class node_adminapp,node_adminpanels,node_adminauth toneMint
class node_server,node_routes,node_auth,node_database,node_http,node_webhook toneRose
class node_visitor,node_payment,node_adminuser,node_livejson toneIndigo
class node_supabase toneTeal
```

## Components

### Public website

- [Website routes](https://github.com/uzairbi/uzair_ngo_v17/blob/main/src/App.tsx): `src/App.tsx`
- [Shared layout](https://github.com/uzairbi/uzair_ngo_v17/blob/main/src/components/Layout.tsx): `src/components/Layout.tsx`
- [Language context](https://github.com/uzairbi/uzair_ngo_v17/blob/main/src/i18n/LangContext.tsx): `src/i18n/LangContext.tsx`

### Content and engagement

- [Home experience](https://github.com/uzairbi/uzair_ngo_v17/blob/main/src/pages/Home.tsx): `src/pages/Home.tsx`
- [Programmes and projects](https://github.com/uzairbi/uzair_ngo_v17/blob/main/src/pages/Projects.tsx): `src/pages/Projects.tsx`
- [Impact and reports](https://github.com/uzairbi/uzair_ngo_v17/blob/main/src/pages/Transparency.tsx): `src/pages/Transparency.tsx`
- [News and stories](https://github.com/uzairbi/uzair_ngo_v17/blob/main/src/pages/News.tsx): `src/pages/News.tsx`
- [Gallery and media](https://github.com/uzairbi/uzair_ngo_v17/blob/main/src/pages/Media.tsx): `src/pages/Media.tsx`
- [Events calendar](https://github.com/uzairbi/uzair_ngo_v17/blob/main/src/pages/Events.tsx): `src/pages/Events.tsx`
- [Live data loader](https://github.com/uzairbi/uzair_ngo_v17/blob/main/src/hooks/useLiveData.ts): `src/hooks/useLiveData.ts`
- [Programme content](https://github.com/uzairbi/uzair_ngo_v17/blob/main/src/data/content.ts): `src/data/content.ts`
- [News content](https://github.com/uzairbi/uzair_ngo_v17/blob/main/src/data/news.ts): `src/data/news.ts`
- [Visitor forms](https://github.com/uzairbi/uzair_ngo_v17/blob/main/src/lib/forms.ts): `src/lib/forms.ts`
- [Donation page](https://github.com/uzairbi/uzair_ngo_v17/blob/main/src/pages/Donate.tsx): `src/pages/Donate.tsx`

### Administration

- [Admin panel](https://github.com/uzairbi/uzair_ngo_v17/blob/main/admin/js/app.js): `admin/js/app.js`
- [Management panels](https://github.com/uzairbi/uzair_ngo_v17/tree/main/admin/js): `admin/js`
- [Admin authentication](https://github.com/uzairbi/uzair_ngo_v17/blob/main/admin/js/supabase.js): `admin/js/supabase.js`

### Server and persistence

- [HTTP server](https://github.com/uzairbi/uzair_ngo_v17/blob/main/server/index.js): `server/index.js`
- [API route handlers](https://github.com/uzairbi/uzair_ngo_v17/tree/main/server/routes): `server/routes`
- [Session authentication](https://github.com/uzairbi/uzair_ngo_v17/blob/main/server/auth.js): `server/auth.js`
- [SQLite database](https://github.com/uzairbi/uzair_ngo_v17/blob/main/server/db.js): `server/db.js`
- [HTTP utilities](https://github.com/uzairbi/uzair_ngo_v17/blob/main/server/http.js): `server/http.js`
- [Payment webhook](https://github.com/uzairbi/uzair_ngo_v17/blob/main/server/routes/webhooks.js): `server/routes/webhooks.js`

### Other components

- **Visitor**
- **Razorpay**
- **Administrator**
- [Supabase services](https://github.com/uzairbi/uzair_ngo_v17/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- **Live JSON data**

## Connections

- Visitor → Website routes: browses (evidence: `src/App.tsx`)
- Website routes → Shared layout: wraps routes (evidence: `src/App.tsx`)
- Website routes → Home experience: routes to (evidence: `src/App.tsx`)
- Website routes → Programmes and projects: routes to (evidence: `src/App.tsx`)
- Website routes → Impact and reports: routes to (evidence: `src/App.tsx`)
- Website routes → News and stories: routes to (evidence: `src/App.tsx`)
- Website routes → Gallery and media: routes to (evidence: `src/App.tsx`)
- Website routes → Events calendar: routes to (evidence: `src/App.tsx`)
- Home experience → Programme content: renders content (evidence: `src/pages/Home.tsx`)
- Home experience → Live data loader: loads live data (evidence: `src/pages/Home.tsx`)
- News and stories → News content: renders stories (evidence: `src/pages/News.tsx`)
- Events calendar → Live data loader: loads event data
- Live data loader → Live JSON data: fetches (evidence: `src/hooks/useLiveData.ts`)
- Live data loader → HTTP server: requests public events (evidence: `src/hooks/useLiveData.ts`)
- Live data loader → Supabase services: loads fallback events (evidence: `src/hooks/useLiveData.ts`)
- Website routes → Language context: provides language (evidence: `src/i18n/LangContext.tsx`)
- Visitor → Visitor forms: submits details (evidence: `README.md`)
- Visitor forms → HTTP server: saves requests (evidence: `README.md`)
- Visitor → Donation page: opens donation page (evidence: `README.md`)
- Donation page → Razorpay: opens payment page (evidence: `README.md`)
- Administrator → Admin panel: signs in (evidence: `admin/js/app.js`)
- Admin panel → Admin authentication: authenticates with (evidence: `admin/js/app.js`)
- Admin panel → Management panels: dispatches panels (evidence: `admin/js/app.js`)
- Admin panel → HTTP server: manages submissions
- HTTP server → Session authentication: checks sessions (evidence: `server/index.js`)
- HTTP server → API route handlers: dispatches requests (evidence: `server/index.js`)
- HTTP server → HTTP utilities: sends responses (evidence: `server/index.js`)
- API route handlers → SQLite database: reads and writes (evidence: `server/routes/webhooks.js`)
- Payment webhook → SQLite database: upserts donations (evidence: `server/routes/webhooks.js`)
