# suresh-jangid/new_saf_foundation_frontend architecture

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

- Interactive diagram: https://gitdiagram.com/suresh-jangid/new_saf_foundation_frontend
- Repository: https://github.com/suresh-jangid/new_saf_foundation_frontend

## Overview

This is a Next.js administrative platform for managing community-benefit programs, applicants, agents, payments, and generated documents. The principal workflow is staff entering and managing program applications, recording or collecting payments, then producing PDFs such as applications, receipts, and bonds. The tree also shows agent permissions and commissions, e-pin management, bulk EMI, and WhatsApp integrations. Sampled PDF routes confirm template-based document generation; the README is only a Next.js starter, and unsampled UI-to-API wiring is not asserted.

Main entry points: [`app/dashboard/page.tsx`](https://github.com/suresh-jangid/new_saf_foundation_frontend/blob/main/app/dashboard/page.tsx) (Program Dashboard), [`app/dashboard`](https://github.com/suresh-jangid/new_saf_foundation_frontend/tree/main/app/dashboard) (Program Applications), [`components/bulk-emi/bulk-emi-engine.tsx`](https://github.com/suresh-jangid/new_saf_foundation_frontend/blob/main/components/bulk-emi/bulk-emi-engine.tsx) (Bulk EMI), [`components/razorpay-payment.tsx`](https://github.com/suresh-jangid/new_saf_foundation_frontend/blob/main/components/razorpay-payment.tsx) (Online Payment)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_operations["Program Operations"]
  node_dashboard["Program Dashboard<br/>[page.tsx]"]
  node_programs["Program Applications"]
  node_agents["Agent Management<br/>[page.tsx]"]
  node_workersearch["Worker Search"]
end

subgraph group_finance["Payments and Finance"]
  node_bulkemi["Bulk EMI"]
  node_paymentpages["Payment Management<br/>[page.tsx]"]
  node_paymentui["Payment Controls"]
  node_razorpayui["Online Payment"]
  node_createorder["Create Payment Order<br/>[route.ts]"]
  node_verifypayment["Verify Payment<br/>[route.ts]"]
end

subgraph group_documents["Forms and Documents"]
  node_pdfroutes["Document Generators"]
  node_fillpdf["Fill PDF Form<br/>[route.ts]"]
  node_pdfimages["PDF Image Handling<br/>[pdfImage.ts]"]
end

subgraph group_platform["Administration and Integrations"]
  node_configuration["Program Configuration<br/>[page.tsx]"]
  node_permissions["Permissions<br/>[permissions.ts]"]
  node_epins["E-pin Management<br/>[epin-service.ts]"]
  node_whatsapp["WhatsApp Integration"]
  node_fireconnect["Fireconnect API<br/>[route.ts]"]
end

node_staff(("Staff"))
node_razorpay["Razorpay"]

node_staff -->|"uses"| node_dashboard
node_dashboard -->|"opens"| node_programs
node_staff -->|"manages"| node_agents
node_programs -->|"selects worker"| node_workersearch
node_staff -->|"records payments"| node_paymentpages
node_staff -->|"manages installments"| node_bulkemi
node_bulkemi -->|"offers online payment"| node_razorpayui
node_razorpayui -->|"requests order"| node_createorder
node_createorder -->|"creates order"| node_razorpay
node_razorpay -->|"returns payment"| node_verifypayment
node_staff -->|"requests documents"| node_pdfroutes
node_pdfroutes -->|"fills templates"| node_fillpdf
node_pdfimages -->|"embeds images"| node_fillpdf
node_staff -->|"configures programs"| node_configuration
node_staff -->|"manages e-pins"| node_epins
node_staff -.->|"uses messaging"| node_whatsapp
node_fireconnect -.->|"integrates messaging"| node_whatsapp

click node_dashboard "https://github.com/suresh-jangid/new_saf_foundation_frontend/blob/main/app/dashboard/page.tsx"
click node_programs "https://github.com/suresh-jangid/new_saf_foundation_frontend/tree/main/app/dashboard"
click node_agents "https://github.com/suresh-jangid/new_saf_foundation_frontend/blob/main/app/dashboard/agent-registration/page.tsx"
click node_workersearch "https://github.com/suresh-jangid/new_saf_foundation_frontend/blob/main/components/worker-search-selector.tsx"
click node_bulkemi "https://github.com/suresh-jangid/new_saf_foundation_frontend/blob/main/components/bulk-emi/bulk-emi-engine.tsx"
click node_paymentpages "https://github.com/suresh-jangid/new_saf_foundation_frontend/blob/main/app/dashboard/payment-management/page.tsx"
click node_paymentui "https://github.com/suresh-jangid/new_saf_foundation_frontend/blob/main/components/payment/reusable-payment-components.tsx"
click node_razorpayui "https://github.com/suresh-jangid/new_saf_foundation_frontend/blob/main/components/razorpay-payment.tsx"
click node_createorder "https://github.com/suresh-jangid/new_saf_foundation_frontend/blob/main/app/api/razorpay/create-order/route.ts"
click node_verifypayment "https://github.com/suresh-jangid/new_saf_foundation_frontend/blob/main/app/api/razorpay/verify-payment/route.ts"
click node_pdfroutes "https://github.com/suresh-jangid/new_saf_foundation_frontend/tree/main/app/api"
click node_fillpdf "https://github.com/suresh-jangid/new_saf_foundation_frontend/blob/main/app/api/fill-pdf-form/route.ts"
click node_pdfimages "https://github.com/suresh-jangid/new_saf_foundation_frontend/blob/main/app/utils/pdfImage.ts"
click node_configuration "https://github.com/suresh-jangid/new_saf_foundation_frontend/blob/main/app/dashboard/settings/configuration/page.tsx"
click node_permissions "https://github.com/suresh-jangid/new_saf_foundation_frontend/blob/main/lib/permissions.ts"
click node_epins "https://github.com/suresh-jangid/new_saf_foundation_frontend/blob/main/lib/epin-service.ts"
click node_whatsapp "https://github.com/suresh-jangid/new_saf_foundation_frontend/blob/main/lib/whatsapp-service.ts"
click node_fireconnect "https://github.com/suresh-jangid/new_saf_foundation_frontend/blob/main/app/api/fireconnect/route.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_dashboard,node_programs,node_agents,node_workersearch toneBlue
class node_bulkemi,node_paymentpages,node_paymentui,node_razorpayui,node_createorder,node_verifypayment toneAmber
class node_pdfroutes,node_fillpdf,node_pdfimages toneMint
class node_configuration,node_permissions,node_epins,node_whatsapp,node_fireconnect toneRose
class node_staff,node_razorpay toneIndigo
```

## Components

### Program Operations

- [Program Dashboard](https://github.com/suresh-jangid/new_saf_foundation_frontend/blob/main/app/dashboard/page.tsx): `app/dashboard/page.tsx`
- [Program Applications](https://github.com/suresh-jangid/new_saf_foundation_frontend/tree/main/app/dashboard): `app/dashboard`
- [Agent Management](https://github.com/suresh-jangid/new_saf_foundation_frontend/blob/main/app/dashboard/agent-registration/page.tsx): `app/dashboard/agent-registration/page.tsx`
- [Worker Search](https://github.com/suresh-jangid/new_saf_foundation_frontend/blob/main/components/worker-search-selector.tsx): `components/worker-search-selector.tsx`

### Payments and Finance

- [Bulk EMI](https://github.com/suresh-jangid/new_saf_foundation_frontend/blob/main/components/bulk-emi/bulk-emi-engine.tsx): `components/bulk-emi/bulk-emi-engine.tsx`
- [Payment Management](https://github.com/suresh-jangid/new_saf_foundation_frontend/blob/main/app/dashboard/payment-management/page.tsx): `app/dashboard/payment-management/page.tsx`
- [Payment Controls](https://github.com/suresh-jangid/new_saf_foundation_frontend/blob/main/components/payment/reusable-payment-components.tsx): `components/payment/reusable-payment-components.tsx`
- [Online Payment](https://github.com/suresh-jangid/new_saf_foundation_frontend/blob/main/components/razorpay-payment.tsx): `components/razorpay-payment.tsx`
- [Create Payment Order](https://github.com/suresh-jangid/new_saf_foundation_frontend/blob/main/app/api/razorpay/create-order/route.ts): `app/api/razorpay/create-order/route.ts`
- [Verify Payment](https://github.com/suresh-jangid/new_saf_foundation_frontend/blob/main/app/api/razorpay/verify-payment/route.ts): `app/api/razorpay/verify-payment/route.ts`

### Forms and Documents

- [Document Generators](https://github.com/suresh-jangid/new_saf_foundation_frontend/tree/main/app/api): `app/api`
- [Fill PDF Form](https://github.com/suresh-jangid/new_saf_foundation_frontend/blob/main/app/api/fill-pdf-form/route.ts): `app/api/fill-pdf-form/route.ts`
- [PDF Image Handling](https://github.com/suresh-jangid/new_saf_foundation_frontend/blob/main/app/utils/pdfImage.ts): `app/utils/pdfImage.ts`

### Administration and Integrations

- [Program Configuration](https://github.com/suresh-jangid/new_saf_foundation_frontend/blob/main/app/dashboard/settings/configuration/page.tsx): `app/dashboard/settings/configuration/page.tsx`
- [Permissions](https://github.com/suresh-jangid/new_saf_foundation_frontend/blob/main/lib/permissions.ts): `lib/permissions.ts`
- [E-pin Management](https://github.com/suresh-jangid/new_saf_foundation_frontend/blob/main/lib/epin-service.ts): `lib/epin-service.ts`
- [WhatsApp Integration](https://github.com/suresh-jangid/new_saf_foundation_frontend/blob/main/lib/whatsapp-service.ts): `lib/whatsapp-service.ts`
- [Fireconnect API](https://github.com/suresh-jangid/new_saf_foundation_frontend/blob/main/app/api/fireconnect/route.ts): `app/api/fireconnect/route.ts`

### Other components

- **Staff**
- **Razorpay**

## Connections

- Staff → Program Dashboard: uses
- Program Dashboard → Program Applications: opens
- Staff → Agent Management: manages
- Program Applications → Worker Search: selects worker
- Staff → Payment Management: records payments
- Staff → Bulk EMI: manages installments
- Bulk EMI → Online Payment: offers online payment
- Online Payment → Create Payment Order: requests order
- Create Payment Order → Razorpay: creates order
- Razorpay → Verify Payment: returns payment
- Staff → Document Generators: requests documents
- Document Generators → Fill PDF Form: fills templates
- PDF Image Handling → Fill PDF Form: embeds images
- Staff → Program Configuration: configures programs
- Staff → E-pin Management: manages e-pins
- Staff → WhatsApp Integration: uses messaging
- Fireconnect API → WhatsApp Integration: integrates messaging
