# sanketh149/secondserve architecture

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

- Interactive diagram: https://gitdiagram.com/sanketh149/secondserve
- Repository: https://github.com/sanketh149/secondserve

## Overview

SecondServe is a browser-only food-rescue demo. Donors enter food details, review suggestions, plan recipients, and start offers; recipients respond and confirm actual quantities received, which drive displayed impact. The React routes and shared in-memory store support this demo workflow. The README describes additional locked product capabilities and planned services, but the frontend does not connect to production authentication, AI, routing, or backend systems; those integrations are not shown as live components.

Main entry points: [`frontend/src/App.tsx`](https://github.com/sanketh149/secondserve/blob/main/frontend/src/App.tsx) (Route application), [`frontend/src/pages/DonorPages.tsx`](https://github.com/sanketh149/secondserve/blob/main/frontend/src/pages/DonorPages.tsx) (Donor pages), [`frontend/src/pages/RecipientPages.tsx`](https://github.com/sanketh149/secondserve/blob/main/frontend/src/pages/RecipientPages.tsx) (Recipient pages), [`frontend/src/lib/demo-context.ts`](https://github.com/sanketh149/secondserve/blob/main/frontend/src/lib/demo-context.ts) (Store context)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application navigation"]
  node_bootstrap["React bootstrap<br/>[main.tsx]"]
  node_router["Route application<br/>[App.tsx]"]
  node_role_entry["Role entry<br/>[RoleEntryPage.tsx]"]
  node_shells["Role workspaces<br/>[AppShell.tsx]"]
end

subgraph group_donor["Donor rescue workflow"]
  node_donor_journey["Donor pages<br/>[DonorPages.tsx]"]
  node_food_passport["Food Passport<br/>[DonorPages.tsx]"]
  node_readiness["Readiness and planning<br/>[DonorPages.tsx]"]
  node_split_batch["Split the Batch<br/>[DonorPages.tsx]"]
end

subgraph group_recipient["Recipient handoff"]
  node_recipient_journey["Recipient pages<br/>[RecipientPages.tsx]"]
  node_offer_response["Offer response<br/>[RecipientPages.tsx]"]
  node_receipt["Confirmed receipt<br/>[RecipientPages.tsx]"]
  node_impact["Impact views<br/>[RecipientPages.tsx]"]
end

subgraph group_state["Demo state"]
  node_demo_context["Store context<br/>[demo-context.ts]"]
  node_demo_store["In-memory workflow state<br/>[demo-store.tsx]"]
  node_seed_data["Synthetic seed data<br/>[demo-data.ts]"]
end

node_user(("Demo participant"))

node_user -->|"opens demo"| node_bootstrap
node_bootstrap -->|"renders"| node_router
node_router -->|"routes to"| node_role_entry
node_router -->|"routes through"| node_shells
node_router -->|"routes to"| node_donor_journey
node_router -->|"routes to"| node_recipient_journey
node_router -->|"provides state"| node_demo_store
node_donor_journey -->|"reads and updates"| node_demo_context
node_recipient_journey -->|"renders"| node_offer_response
node_recipient_journey -->|"confirms quantity"| node_receipt
node_recipient_journey -->|"shows totals"| node_impact
node_demo_context -->|"accesses context"| node_demo_store
node_demo_store -->|"initializes from"| node_seed_data
node_donor_journey -->|"collects details"| node_food_passport
node_donor_journey -.->|"reviews rescue plan"| node_readiness
node_donor_journey -.->|"plans allocation"| node_split_batch
node_offer_response -.->|"responds through"| node_demo_context
node_receipt -.->|"submits receipt through"| node_demo_context

click node_bootstrap "https://github.com/sanketh149/secondserve/blob/main/frontend/src/main.tsx"
click node_router "https://github.com/sanketh149/secondserve/blob/main/frontend/src/App.tsx"
click node_role_entry "https://github.com/sanketh149/secondserve/blob/main/frontend/src/pages/RoleEntryPage.tsx"
click node_shells "https://github.com/sanketh149/secondserve/blob/main/frontend/src/components/AppShell.tsx"
click node_donor_journey "https://github.com/sanketh149/secondserve/blob/main/frontend/src/pages/DonorPages.tsx"
click node_food_passport "https://github.com/sanketh149/secondserve/blob/main/frontend/src/pages/DonorPages.tsx"
click node_readiness "https://github.com/sanketh149/secondserve/blob/main/frontend/src/pages/DonorPages.tsx"
click node_split_batch "https://github.com/sanketh149/secondserve/blob/main/frontend/src/pages/DonorPages.tsx"
click node_recipient_journey "https://github.com/sanketh149/secondserve/blob/main/frontend/src/pages/RecipientPages.tsx"
click node_offer_response "https://github.com/sanketh149/secondserve/blob/main/frontend/src/pages/RecipientPages.tsx"
click node_receipt "https://github.com/sanketh149/secondserve/blob/main/frontend/src/pages/RecipientPages.tsx"
click node_impact "https://github.com/sanketh149/secondserve/blob/main/frontend/src/pages/RecipientPages.tsx"
click node_demo_context "https://github.com/sanketh149/secondserve/blob/main/frontend/src/lib/demo-context.ts"
click node_demo_store "https://github.com/sanketh149/secondserve/blob/main/frontend/src/lib/demo-store.tsx"
click node_seed_data "https://github.com/sanketh149/secondserve/blob/main/frontend/src/lib/demo-data.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_bootstrap,node_router,node_role_entry,node_shells toneBlue
class node_donor_journey,node_food_passport,node_readiness,node_split_batch toneAmber
class node_recipient_journey,node_offer_response,node_receipt,node_impact toneMint
class node_demo_context,node_demo_store,node_seed_data toneRose
class node_user toneIndigo
```

## Components

### Application navigation

- [React bootstrap](https://github.com/sanketh149/secondserve/blob/main/frontend/src/main.tsx): `frontend/src/main.tsx`
- [Route application](https://github.com/sanketh149/secondserve/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Role entry](https://github.com/sanketh149/secondserve/blob/main/frontend/src/pages/RoleEntryPage.tsx): `frontend/src/pages/RoleEntryPage.tsx`
- [Role workspaces](https://github.com/sanketh149/secondserve/blob/main/frontend/src/components/AppShell.tsx): `frontend/src/components/AppShell.tsx`

### Donor rescue workflow

- [Donor pages](https://github.com/sanketh149/secondserve/blob/main/frontend/src/pages/DonorPages.tsx): `frontend/src/pages/DonorPages.tsx`
- [Food Passport](https://github.com/sanketh149/secondserve/blob/main/frontend/src/pages/DonorPages.tsx): `frontend/src/pages/DonorPages.tsx`
- [Readiness and planning](https://github.com/sanketh149/secondserve/blob/main/frontend/src/pages/DonorPages.tsx): `frontend/src/pages/DonorPages.tsx`
- [Split the Batch](https://github.com/sanketh149/secondserve/blob/main/frontend/src/pages/DonorPages.tsx): `frontend/src/pages/DonorPages.tsx`

### Recipient handoff

- [Recipient pages](https://github.com/sanketh149/secondserve/blob/main/frontend/src/pages/RecipientPages.tsx): `frontend/src/pages/RecipientPages.tsx`
- [Offer response](https://github.com/sanketh149/secondserve/blob/main/frontend/src/pages/RecipientPages.tsx): `frontend/src/pages/RecipientPages.tsx`
- [Confirmed receipt](https://github.com/sanketh149/secondserve/blob/main/frontend/src/pages/RecipientPages.tsx): `frontend/src/pages/RecipientPages.tsx`
- [Impact views](https://github.com/sanketh149/secondserve/blob/main/frontend/src/pages/RecipientPages.tsx): `frontend/src/pages/RecipientPages.tsx`

### Demo state

- [Store context](https://github.com/sanketh149/secondserve/blob/main/frontend/src/lib/demo-context.ts): `frontend/src/lib/demo-context.ts`
- [In-memory workflow state](https://github.com/sanketh149/secondserve/blob/main/frontend/src/lib/demo-store.tsx): `frontend/src/lib/demo-store.tsx`
- [Synthetic seed data](https://github.com/sanketh149/secondserve/blob/main/frontend/src/lib/demo-data.ts): `frontend/src/lib/demo-data.ts`

### Other components

- **Demo participant**

## Connections

- Demo participant → React bootstrap: opens demo (evidence: `README.md`)
- React bootstrap → Route application: renders (evidence: `frontend/src/main.tsx`)
- Route application → Role entry: routes to (evidence: `frontend/src/App.tsx`)
- Route application → Role workspaces: routes through (evidence: `frontend/src/App.tsx`)
- Route application → Donor pages: routes to (evidence: `frontend/src/App.tsx`)
- Route application → Recipient pages: routes to (evidence: `frontend/src/App.tsx`)
- Route application → In-memory workflow state: provides state (evidence: `frontend/src/App.tsx`)
- Donor pages → Store context: reads and updates (evidence: `frontend/src/pages/DonorPages.tsx`)
- Recipient pages → Offer response: renders (evidence: `frontend/src/pages/RecipientPages.tsx`)
- Recipient pages → Confirmed receipt: confirms quantity (evidence: `frontend/src/pages/RecipientPages.tsx`)
- Recipient pages → Impact views: shows totals (evidence: `frontend/src/pages/RecipientPages.tsx`)
- Store context → In-memory workflow state: accesses context (evidence: `frontend/src/lib/demo-context.ts`)
- In-memory workflow state → Synthetic seed data: initializes from (evidence: `frontend/src/lib/demo-store.tsx`)
- Donor pages → Food Passport: collects details (evidence: `frontend/src/pages/DonorPages.tsx`)
- Donor pages → Readiness and planning: reviews rescue plan (evidence: `README.md`)
- Donor pages → Split the Batch: plans allocation (evidence: `README.md`)
- Offer response → Store context: responds through
- Confirmed receipt → Store context: submits receipt through
