# rupert227/fsd_donor_system architecture

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

- Interactive diagram: https://gitdiagram.com/rupert227/fsd_donor_system
- Repository: https://github.com/rupert227/fsd_donor_system

## Overview

FSD Donor System is a Caritas Manila fundraising and stewardship application organized around donor conversion, retention, and care. Its clearest evidenced workflow registers and manages prospects, tracks outreach, and supports proposal creation and dispatch; marking a prospect secured also notifies Donor Care. Retention and transaction, receipt, duplicate-resolution, and reporting capabilities are documented, but their implementation connections were not sampled. Edges reflect excerpted calls or SOURCE INDEX references; unsampled capability links are omitted rather than inferred.

Main entry points: [`src/app/donor-conv/proposals/send-proposal/actions.ts`](https://github.com/rupert227/fsd_donor_system/blob/main/src/app/donor-conv/proposals/send-proposal/actions.ts) (Dispatch actions), [`src/lib/supabase/server.ts`](https://github.com/rupert227/fsd_donor_system/blob/main/src/lib/supabase/server.ts) (Supabase clients), [`src/lib/prospects/actions.ts`](https://github.com/rupert227/fsd_donor_system/blob/main/src/lib/prospects/actions.ts) (Prospect data actions), [`src/app/donor-conv/prospects`](https://github.com/rupert227/fsd_donor_system/tree/main/src/app/donor-conv/prospects) (Prospect management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_conversion["Donor Conversion"]
  node_prospects["Prospect management"]
  node_scoring["Prospect scoring<br/>[prospect-score.ts]"]
  node_prospectactions["Prospect data actions<br/>[actions.ts]"]
  node_conversionreports["Conversion reports"]
  node_pipelineapi["Pipeline report API<br/>[route.ts]"]
end

subgraph group_retention["Donor Retention"]
  node_donors["Donor registry<br/>[page.tsx]"]
  node_renewals["Renewal appeals"]
  node_retentionreports["Retention reports"]
end

subgraph group_care["Donor Care"]
  node_transactions["Remittance ledger"]
  node_duplicates["Duplicate resolution<br/>[page.tsx]"]
  node_receipts["Receipt dispatch"]
  node_carereports["Care reports"]
end

subgraph group_platform["Shared Platform"]
  node_shell["Application shell<br/>[AppShell.tsx]"]
  node_navigation["Navigation and alerts<br/>[Navbar.tsx]"]
  node_toast["Toast notifications<br/>[ToastContainer.tsx]"]
  node_dashboard["Division dashboard<br/>[page.tsx]"]
  node_auth["Authentication routes<br/>[route.ts]"]
  node_access["Access control<br/>[access.ts]"]
  node_supabaseclients["Supabase clients<br/>[server.ts]"]
end

subgraph group_proposal["Proposal Services"]
  node_proposals["Proposal registry<br/>[page.tsx]"]
  node_proposalbuilder["Proposal builder"]
  node_letterpreview["Letter preview<br/>[LetterPreview.tsx]"]
  node_letter["Letter generation<br/>[letter.ts]"]
  node_sendproposal["Proposal dispatch<br/>[page.tsx]"]
  node_sendactions["Dispatch actions<br/>[actions.ts]"]
  node_pdf["Proposal PDF<br/>[proposal-pdf.ts]"]
  node_mail["Email delivery<br/>[mail.ts]"]
end

node_user(("Staff user"))
node_database[("Supabase database")]

node_shell -->|"renders"| node_navigation
node_shell -->|"renders"| node_toast
node_dashboard -->|"renders within"| node_shell
node_navigation -->|"loads alerts"| node_prospectactions
node_prospects -->|"calls"| node_prospectactions
node_prospects -->|"calculates scores"| node_scoring
node_prospectactions -->|"creates client"| node_supabaseclients
node_supabaseclients -.->|"queries"| node_database
node_pipelineapi -->|"uses client"| node_supabaseclients
node_proposals -->|"renders"| node_proposalbuilder
node_proposalbuilder -->|"renders"| node_letterpreview
node_proposalbuilder -->|"uses"| node_letter
node_sendproposal -->|"renders"| node_letterpreview
node_sendproposal -->|"calls"| node_sendactions
node_sendactions -->|"uses"| node_letter
node_sendactions -->|"generates PDF"| node_pdf
node_sendactions -->|"sends email"| node_mail
node_sendactions -->|"uses client"| node_supabaseclients
node_prospects -->|"notifies care"| node_prospectactions
node_auth -->|"uses client"| node_supabaseclients
node_navigation -->|"checks access"| node_access

click node_shell "https://github.com/rupert227/fsd_donor_system/blob/main/src/components/AppShell.tsx"
click node_navigation "https://github.com/rupert227/fsd_donor_system/blob/main/src/components/Navbar.tsx"
click node_toast "https://github.com/rupert227/fsd_donor_system/blob/main/src/components/ui/ToastContainer.tsx"
click node_dashboard "https://github.com/rupert227/fsd_donor_system/blob/main/src/app/dashboard/page.tsx"
click node_auth "https://github.com/rupert227/fsd_donor_system/blob/main/src/app/auth/callback/route.ts"
click node_access "https://github.com/rupert227/fsd_donor_system/blob/main/src/lib/access.ts"
click node_supabaseclients "https://github.com/rupert227/fsd_donor_system/blob/main/src/lib/supabase/server.ts"
click node_prospects "https://github.com/rupert227/fsd_donor_system/tree/main/src/app/donor-conv/prospects"
click node_scoring "https://github.com/rupert227/fsd_donor_system/blob/main/src/app/donor-conv/prospects/utils/prospect-score.ts"
click node_prospectactions "https://github.com/rupert227/fsd_donor_system/blob/main/src/lib/prospects/actions.ts"
click node_conversionreports "https://github.com/rupert227/fsd_donor_system/tree/main/src/app/donor-conv/reports"
click node_pipelineapi "https://github.com/rupert227/fsd_donor_system/blob/main/src/app/api/lead-pipeline-report/route.ts"
click node_proposals "https://github.com/rupert227/fsd_donor_system/blob/main/src/app/donor-conv/proposals/page.tsx"
click node_proposalbuilder "https://github.com/rupert227/fsd_donor_system/blob/main/src/components/proposals/ProposalBuilder.tsx"
click node_letterpreview "https://github.com/rupert227/fsd_donor_system/blob/main/src/components/proposals/LetterPreview.tsx"
click node_letter "https://github.com/rupert227/fsd_donor_system/blob/main/src/lib/letter.ts"
click node_sendproposal "https://github.com/rupert227/fsd_donor_system/blob/main/src/app/donor-conv/proposals/send-proposal/page.tsx"
click node_sendactions "https://github.com/rupert227/fsd_donor_system/blob/main/src/app/donor-conv/proposals/send-proposal/actions.ts"
click node_pdf "https://github.com/rupert227/fsd_donor_system/blob/main/src/lib/proposal-pdf.ts"
click node_mail "https://github.com/rupert227/fsd_donor_system/blob/main/src/lib/mail.ts"
click node_donors "https://github.com/rupert227/fsd_donor_system/blob/main/src/app/donor-retn/donors/page.tsx"
click node_renewals "https://github.com/rupert227/fsd_donor_system/tree/main/src/app/donor-retn/renewals"
click node_retentionreports "https://github.com/rupert227/fsd_donor_system/tree/main/src/app/donor-retn/reports"
click node_transactions "https://github.com/rupert227/fsd_donor_system/tree/main/src/app/donor-care/transactions"
click node_duplicates "https://github.com/rupert227/fsd_donor_system/blob/main/src/app/donor-care/duplicates/page.tsx"
click node_receipts "https://github.com/rupert227/fsd_donor_system/tree/main/src/app/donor-care/receipts"
click node_carereports "https://github.com/rupert227/fsd_donor_system/tree/main/src/app/donor-care/reports"

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_prospects,node_scoring,node_prospectactions,node_conversionreports,node_pipelineapi,node_user toneBlue
class node_donors,node_renewals,node_retentionreports,node_database toneAmber
class node_transactions,node_duplicates,node_receipts,node_carereports toneMint
class node_shell,node_navigation,node_toast,node_dashboard,node_auth,node_access,node_supabaseclients toneRose
class node_proposals,node_proposalbuilder,node_letterpreview,node_letter,node_sendproposal,node_sendactions,node_pdf,node_mail toneIndigo
```

## Components

### Donor Conversion

- [Prospect management](https://github.com/rupert227/fsd_donor_system/tree/main/src/app/donor-conv/prospects): `src/app/donor-conv/prospects`
- [Prospect scoring](https://github.com/rupert227/fsd_donor_system/blob/main/src/app/donor-conv/prospects/utils/prospect-score.ts): `src/app/donor-conv/prospects/utils/prospect-score.ts`
- [Prospect data actions](https://github.com/rupert227/fsd_donor_system/blob/main/src/lib/prospects/actions.ts): `src/lib/prospects/actions.ts`
- [Conversion reports](https://github.com/rupert227/fsd_donor_system/tree/main/src/app/donor-conv/reports): `src/app/donor-conv/reports`
- [Pipeline report API](https://github.com/rupert227/fsd_donor_system/blob/main/src/app/api/lead-pipeline-report/route.ts): `src/app/api/lead-pipeline-report/route.ts`

### Donor Retention

- [Donor registry](https://github.com/rupert227/fsd_donor_system/blob/main/src/app/donor-retn/donors/page.tsx): `src/app/donor-retn/donors/page.tsx`
- [Renewal appeals](https://github.com/rupert227/fsd_donor_system/tree/main/src/app/donor-retn/renewals): `src/app/donor-retn/renewals`
- [Retention reports](https://github.com/rupert227/fsd_donor_system/tree/main/src/app/donor-retn/reports): `src/app/donor-retn/reports`

### Donor Care

- [Remittance ledger](https://github.com/rupert227/fsd_donor_system/tree/main/src/app/donor-care/transactions): `src/app/donor-care/transactions`
- [Duplicate resolution](https://github.com/rupert227/fsd_donor_system/blob/main/src/app/donor-care/duplicates/page.tsx): `src/app/donor-care/duplicates/page.tsx`
- [Receipt dispatch](https://github.com/rupert227/fsd_donor_system/tree/main/src/app/donor-care/receipts): `src/app/donor-care/receipts`
- [Care reports](https://github.com/rupert227/fsd_donor_system/tree/main/src/app/donor-care/reports): `src/app/donor-care/reports`

### Shared Platform

- [Application shell](https://github.com/rupert227/fsd_donor_system/blob/main/src/components/AppShell.tsx): `src/components/AppShell.tsx`
- [Navigation and alerts](https://github.com/rupert227/fsd_donor_system/blob/main/src/components/Navbar.tsx): `src/components/Navbar.tsx`
- [Toast notifications](https://github.com/rupert227/fsd_donor_system/blob/main/src/components/ui/ToastContainer.tsx): `src/components/ui/ToastContainer.tsx`
- [Division dashboard](https://github.com/rupert227/fsd_donor_system/blob/main/src/app/dashboard/page.tsx): `src/app/dashboard/page.tsx`
- [Authentication routes](https://github.com/rupert227/fsd_donor_system/blob/main/src/app/auth/callback/route.ts): `src/app/auth/callback/route.ts`
- [Access control](https://github.com/rupert227/fsd_donor_system/blob/main/src/lib/access.ts): `src/lib/access.ts`
- [Supabase clients](https://github.com/rupert227/fsd_donor_system/blob/main/src/lib/supabase/server.ts): `src/lib/supabase/server.ts`

### Proposal Services

- [Proposal registry](https://github.com/rupert227/fsd_donor_system/blob/main/src/app/donor-conv/proposals/page.tsx): `src/app/donor-conv/proposals/page.tsx`
- [Proposal builder](https://github.com/rupert227/fsd_donor_system/blob/main/src/components/proposals/ProposalBuilder.tsx): `src/components/proposals/ProposalBuilder.tsx`
- [Letter preview](https://github.com/rupert227/fsd_donor_system/blob/main/src/components/proposals/LetterPreview.tsx): `src/components/proposals/LetterPreview.tsx`
- [Letter generation](https://github.com/rupert227/fsd_donor_system/blob/main/src/lib/letter.ts): `src/lib/letter.ts`
- [Proposal dispatch](https://github.com/rupert227/fsd_donor_system/blob/main/src/app/donor-conv/proposals/send-proposal/page.tsx): `src/app/donor-conv/proposals/send-proposal/page.tsx`
- [Dispatch actions](https://github.com/rupert227/fsd_donor_system/blob/main/src/app/donor-conv/proposals/send-proposal/actions.ts): `src/app/donor-conv/proposals/send-proposal/actions.ts`
- [Proposal PDF](https://github.com/rupert227/fsd_donor_system/blob/main/src/lib/proposal-pdf.ts): `src/lib/proposal-pdf.ts`
- [Email delivery](https://github.com/rupert227/fsd_donor_system/blob/main/src/lib/mail.ts): `src/lib/mail.ts`

### Other components

- **Staff user**
- **Supabase database**

## Connections

- Application shell → Navigation and alerts: renders (evidence: `src/components/AppShell.tsx`)
- Application shell → Toast notifications: renders (evidence: `src/components/AppShell.tsx`)
- Division dashboard → Application shell: renders within (evidence: `src/app/dashboard/page.tsx`)
- Navigation and alerts → Prospect data actions: loads alerts (evidence: `src/components/Navbar.tsx`)
- Prospect management → Prospect data actions: calls (evidence: `src/app/donor-conv/prospects/edit-prospect/page.tsx`)
- Prospect management → Prospect scoring: calculates scores (evidence: `src/app/donor-conv/prospects/edit-prospect/page.tsx`)
- Prospect data actions → Supabase clients: creates client (evidence: `src/lib/prospects/actions.ts`)
- Supabase clients → Supabase database: queries
- Pipeline report API → Supabase clients: uses client (evidence: `src/app/api/lead-pipeline-report/route.ts`)
- Proposal registry → Proposal builder: renders (evidence: `src/app/donor-conv/proposals/page.tsx`)
- Proposal builder → Letter preview: renders (evidence: `src/components/proposals/ProposalBuilder.tsx`)
- Proposal builder → Letter generation: uses (evidence: `src/components/proposals/ProposalBuilder.tsx`)
- Proposal dispatch → Letter preview: renders (evidence: `src/app/donor-conv/proposals/send-proposal/page.tsx`)
- Proposal dispatch → Dispatch actions: calls (evidence: `src/app/donor-conv/proposals/send-proposal/page.tsx`)
- Dispatch actions → Letter generation: uses (evidence: `src/app/donor-conv/proposals/send-proposal/actions.ts`)
- Dispatch actions → Proposal PDF: generates PDF (evidence: `src/app/donor-conv/proposals/send-proposal/actions.ts`)
- Dispatch actions → Email delivery: sends email (evidence: `src/app/donor-conv/proposals/send-proposal/actions.ts`)
- Dispatch actions → Supabase clients: uses client (evidence: `src/app/donor-conv/proposals/send-proposal/actions.ts`)
- Prospect management → Prospect data actions: notifies care (evidence: `src/app/donor-conv/prospects/edit-prospect/page.tsx`)
- Authentication routes → Supabase clients: uses client (evidence: `src/app/auth/callback/route.ts`)
- Navigation and alerts → Access control: checks access (evidence: `src/components/Navbar.tsx`)
