# tmkuaewelfarecommunityadmin/tmk-uae-welfare-community architecture

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

- Interactive diagram: https://gitdiagram.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community
- Repository: https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community

## Overview

Village Welfare Fund is a role-governed community finance application for member contributions, assistance requests and payouts, audit, and multi-currency treasury oversight. Users enter through sign-in or public assistance tracking, then use role-specific screens; those screens call the API for operational work, while server routes coordinate persistence and domain helpers. The graph preserves major UI and domain branches named in the source index. Several server and client modules were not excerpted, so uncertain API-to-route and subsystem wiring is left unverified rather than inferred.

Main entry points: [`src/App.tsx`](https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/App.tsx) (Application shell), [`src/server/routes.ts`](https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/server/routes.ts) (HTTP API routes), [`src/shared/api/client.ts`](https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/shared/api/client.ts) (API client), [`src/server/seed.ts`](https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/server/seed.ts) (Reference and bootstrap data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Application workflows"]
  node_app["Application shell<br/>[App.tsx]"]
  node_authui["Sign-in and tracking<br/>[AuthPortal.tsx]"]
  node_members["Member management<br/>[MembersView.tsx]"]
  node_contributions["Contribution workflow"]
  node_assistance["Assistance workflow<br/>[AssistanceView.tsx]"]
  node_dashboard["Financial dashboard<br/>[DashboardView.tsx]"]
  node_treasury["Treasury operations<br/>[TreasuryView.tsx]"]
  node_auditui["Audit views<br/>[AuditView.tsx]"]
  node_adminui["Site and street admin"]
  node_profile["Account profile"]
  node_monthly["Contribution trends chart"]
  node_requests_chart["Request status chart"]
end

subgraph group_server["Server operations"]
  node_routes["HTTP API routes<br/>[routes.ts]"]
  node_auth["Session resolution<br/>[auth.ts]"]
  node_ledger["Ledger calculations<br/>[ledger.ts]"]
  node_seed["Reference and bootstrap data<br/>[seed.ts]"]
  node_audit["Audit recording<br/>[audit.ts]"]
  node_upload["Attachment handling<br/>[upload.ts]"]
end

subgraph group_data["Persistence and security"]
  node_crypto["Token and password crypto<br/>[crypto.ts]"]
  node_rate["Distributed rate limits<br/>[rateLimit.ts]"]
  node_schema["Domain schema<br/>[schema.ts]"]
  node_database[("Database access<br/>[index.ts]")]
end

subgraph group_shared["Shared client services"]
  node_api["API client<br/>[client.ts]"]
  node_attachments["Attachment preview"]
  node_sso["SSO notice"]
  node_status["Status and money<br/>[StatusText.tsx]"]
  node_translations["English and Tamil<br/>[translations.ts]"]
  node_pwa["Offline and install<br/>[PWAInstall.tsx]"]
  node_firebase["Firebase authentication<br/>[firebase.ts]"]
end

node_user(("Member or visitor"))
node_firebase_service{{"Firebase"}}

node_user -->|"uses"| node_app
node_app -->|"shows sign-in"| node_authui
node_app -->|"shows view"| node_members
node_app -->|"shows view"| node_contributions
node_app -->|"shows view"| node_assistance
node_app -->|"shows view"| node_dashboard
node_app -->|"shows view"| node_treasury
node_app -->|"shows view"| node_auditui
node_app -->|"shows view"| node_adminui
node_app -->|"shows modal"| node_profile
node_authui -->|"signs in with"| node_firebase
node_firebase -->|"authenticates"| node_firebase_service
node_authui -->|"tracks requests"| node_api
node_members -->|"sends updates"| node_api
node_contributions -->|"submits payments"| node_api
node_assistance -->|"updates reasons"| node_api
node_treasury -->|"loads operations"| node_api
node_dashboard -->|"loads summaries"| node_api
node_contributions -->|"opens preview"| node_attachments
node_attachments -->|"fetches attachment"| node_api
node_members -->|"displays notice"| node_sso
node_dashboard -->|"renders chart"| node_monthly
node_dashboard -->|"renders chart"| node_requests_chart
node_routes -->|"gets balances"| node_ledger
node_routes -->|"checks limits"| node_rate
node_routes -->|"ensures references"| node_seed
node_routes -->|"generates token"| node_crypto
node_routes -->|"reads and writes"| node_database
node_routes -->|"queries entities"| node_schema
node_auth -->|"verifies token"| node_crypto
node_auth -->|"ensures references"| node_seed
node_seed -->|"hashes password"| node_crypto
node_seed -->|"seeds records"| node_database
node_seed -->|"writes entities"| node_schema
node_api -.->|"calls API"| node_routes

click node_app "https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/App.tsx"
click node_authui "https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/features/auth/AuthPortal.tsx"
click node_members "https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/features/members/MembersView.tsx"
click node_contributions "https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/features/contributions/ContributionsView.tsx"
click node_assistance "https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/features/assistance/AssistanceView.tsx"
click node_dashboard "https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/features/dashboard/DashboardView.tsx"
click node_treasury "https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/features/treasury/TreasuryView.tsx"
click node_auditui "https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/features/audit/AuditView.tsx"
click node_adminui "https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/tree/main/src/features/admin"
click node_profile "https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/features/auth/AccountProfileModal.tsx"
click node_api "https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/shared/api/client.ts"
click node_attachments "https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/shared/components/AttachmentPreviewModal.tsx"
click node_sso "https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/shared/components/SsoRequiredBanner.tsx"
click node_status "https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/shared/components/StatusText.tsx"
click node_translations "https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/shared/i18n/translations.ts"
click node_pwa "https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/shared/pwa/PWAInstall.tsx"
click node_firebase "https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/lib/firebase.ts"
click node_routes "https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/server/routes.ts"
click node_auth "https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/server/auth.ts"
click node_ledger "https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/server/ledger.ts"
click node_seed "https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/server/seed.ts"
click node_audit "https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/server/audit.ts"
click node_crypto "https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/server/crypto.ts"
click node_rate "https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/server/rateLimit.ts"
click node_upload "https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/server/upload.ts"
click node_schema "https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/db/schema.ts"
click node_database "https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/db/index.ts"
click node_monthly "https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/features/dashboard/MonthlyContributionTrendsChart.tsx"
click node_requests_chart "https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/features/dashboard/SupportRequestsDoughnutChart.tsx"

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_app,node_authui,node_members,node_contributions,node_assistance,node_dashboard,node_treasury,node_auditui,node_adminui,node_profile,node_monthly,node_requests_chart toneBlue
class node_routes,node_auth,node_ledger,node_seed,node_audit,node_upload toneAmber
class node_crypto,node_rate,node_schema,node_database toneMint
class node_api,node_attachments,node_sso,node_status,node_translations,node_pwa,node_firebase toneRose
class node_user,node_firebase_service toneIndigo
```

## Components

### Application workflows

- [Application shell](https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/App.tsx): `src/App.tsx`
- [Sign-in and tracking](https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/features/auth/AuthPortal.tsx): `src/features/auth/AuthPortal.tsx`
- [Member management](https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/features/members/MembersView.tsx): `src/features/members/MembersView.tsx`
- [Contribution workflow](https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/features/contributions/ContributionsView.tsx): `src/features/contributions/ContributionsView.tsx`
- [Assistance workflow](https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/features/assistance/AssistanceView.tsx): `src/features/assistance/AssistanceView.tsx`
- [Financial dashboard](https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/features/dashboard/DashboardView.tsx): `src/features/dashboard/DashboardView.tsx`
- [Treasury operations](https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/features/treasury/TreasuryView.tsx): `src/features/treasury/TreasuryView.tsx`
- [Audit views](https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/features/audit/AuditView.tsx): `src/features/audit/AuditView.tsx`
- [Site and street admin](https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/tree/main/src/features/admin): `src/features/admin`
- [Account profile](https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/features/auth/AccountProfileModal.tsx): `src/features/auth/AccountProfileModal.tsx`
- [Contribution trends chart](https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/features/dashboard/MonthlyContributionTrendsChart.tsx): `src/features/dashboard/MonthlyContributionTrendsChart.tsx`
- [Request status chart](https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/features/dashboard/SupportRequestsDoughnutChart.tsx): `src/features/dashboard/SupportRequestsDoughnutChart.tsx`

### Server operations

- [HTTP API routes](https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/server/routes.ts): `src/server/routes.ts`
- [Session resolution](https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/server/auth.ts): `src/server/auth.ts`
- [Ledger calculations](https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/server/ledger.ts): `src/server/ledger.ts`
- [Reference and bootstrap data](https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/server/seed.ts): `src/server/seed.ts`
- [Audit recording](https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/server/audit.ts): `src/server/audit.ts`
- [Attachment handling](https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/server/upload.ts): `src/server/upload.ts`

### Persistence and security

- [Token and password crypto](https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/server/crypto.ts): `src/server/crypto.ts`
- [Distributed rate limits](https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/server/rateLimit.ts): `src/server/rateLimit.ts`
- [Domain schema](https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/db/schema.ts): `src/db/schema.ts`
- [Database access](https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/db/index.ts): `src/db/index.ts`

### Shared client services

- [API client](https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/shared/api/client.ts): `src/shared/api/client.ts`
- [Attachment preview](https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/shared/components/AttachmentPreviewModal.tsx): `src/shared/components/AttachmentPreviewModal.tsx`
- [SSO notice](https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/shared/components/SsoRequiredBanner.tsx): `src/shared/components/SsoRequiredBanner.tsx`
- [Status and money](https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/shared/components/StatusText.tsx): `src/shared/components/StatusText.tsx`
- [English and Tamil](https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/shared/i18n/translations.ts): `src/shared/i18n/translations.ts`
- [Offline and install](https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/shared/pwa/PWAInstall.tsx): `src/shared/pwa/PWAInstall.tsx`
- [Firebase authentication](https://github.com/tmkuaewelfarecommunityadmin/tmk-uae-welfare-community/blob/main/src/lib/firebase.ts): `src/lib/firebase.ts`

### Other components

- **Member or visitor**
- **Firebase**

## Connections

- Member or visitor → Application shell: uses (evidence: `src/App.tsx`)
- Application shell → Sign-in and tracking: shows sign-in (evidence: `src/App.tsx`)
- Application shell → Member management: shows view (evidence: `src/App.tsx`)
- Application shell → Contribution workflow: shows view (evidence: `src/App.tsx`)
- Application shell → Assistance workflow: shows view (evidence: `src/App.tsx`)
- Application shell → Financial dashboard: shows view (evidence: `src/App.tsx`)
- Application shell → Treasury operations: shows view (evidence: `src/App.tsx`)
- Application shell → Audit views: shows view (evidence: `src/App.tsx`)
- Application shell → Site and street admin: shows view (evidence: `src/App.tsx`)
- Application shell → Account profile: shows modal (evidence: `src/App.tsx`)
- Sign-in and tracking → Firebase authentication: signs in with (evidence: `src/features/auth/AuthPortal.tsx`)
- Firebase authentication → Firebase: authenticates (evidence: `src/lib/firebase.ts`)
- Sign-in and tracking → API client: tracks requests (evidence: `src/features/auth/AuthPortal.tsx`)
- Member management → API client: sends updates (evidence: `src/features/members/MembersView.tsx`)
- Contribution workflow → API client: submits payments (evidence: `src/features/contributions/ContributionsView.tsx`)
- Assistance workflow → API client: updates reasons (evidence: `src/features/assistance/AssistanceView.tsx`)
- Treasury operations → API client: loads operations (evidence: `src/features/treasury/TreasuryView.tsx`)
- Financial dashboard → API client: loads summaries (evidence: `src/features/dashboard/DashboardView.tsx`)
- Contribution workflow → Attachment preview: opens preview (evidence: `src/features/contributions/ContributionsView.tsx`)
- Attachment preview → API client: fetches attachment (evidence: `src/shared/components/AttachmentPreviewModal.tsx`)
- Member management → SSO notice: displays notice (evidence: `src/features/members/MembersView.tsx`)
- Financial dashboard → Contribution trends chart: renders chart (evidence: `src/features/dashboard/DashboardView.tsx`)
- Financial dashboard → Request status chart: renders chart (evidence: `src/features/dashboard/DashboardView.tsx`)
- HTTP API routes → Ledger calculations: gets balances (evidence: `src/server/routes.ts`)
- HTTP API routes → Distributed rate limits: checks limits (evidence: `src/server/routes.ts`)
- HTTP API routes → Reference and bootstrap data: ensures references (evidence: `src/server/routes.ts`)
- HTTP API routes → Token and password crypto: generates token (evidence: `src/server/routes.ts`)
- HTTP API routes → Database access: reads and writes (evidence: `src/server/routes.ts`)
- HTTP API routes → Domain schema: queries entities (evidence: `src/server/routes.ts`)
- Session resolution → Token and password crypto: verifies token (evidence: `src/server/auth.ts`)
- Session resolution → Reference and bootstrap data: ensures references (evidence: `src/server/auth.ts`)
- Reference and bootstrap data → Token and password crypto: hashes password (evidence: `src/server/seed.ts`)
- Reference and bootstrap data → Database access: seeds records (evidence: `src/server/seed.ts`)
- Reference and bootstrap data → Domain schema: writes entities (evidence: `src/server/seed.ts`)
- API client → HTTP API routes: calls API
