# varshini-balaji2021/plate2plate architecture

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

- Interactive diagram: https://gitdiagram.com/varshini-balaji2021/plate2plate
- Repository: https://github.com/varshini-balaji2021/plate2plate

## Overview

Plate2Plate is a food-surplus and donation dashboard. A browser-loaded dashboard requests database connection status, summary metrics, surplus listings, orders, and donations from the FastAPI backend; the backend queries PostgreSQL and returns data for charts and tables. The backend also serves the frontend files. The README is empty, and the available source excerpts do not establish write or transaction workflows, so the map focuses on the evidenced read/reporting path.

Main entry points: [`Plate2Plate_Corrected/script.js`](https://github.com/varshini-balaji2021/plate2plate/blob/main/Plate2Plate_Corrected/script.js) (Web dashboard), [`Plate2Plate_Corrected/backend/app.py`](https://github.com/varshini-balaji2021/plate2plate/blob/main/Plate2Plate_Corrected/backend/app.py) (FastAPI backend)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["Dashboard"]
  node_frontend["Web dashboard<br/>[script.js]"]
end

subgraph group_service["API service"]
  node_backend["FastAPI backend<br/>[app.py]"]
  node_reporting["Dashboard reporting<br/>[app.py]"]
  node_records["Food and transaction listings<br/>[app.py]"]
end

subgraph group_data["Data"]
  node_postgres[("Supabase PostgreSQL")]
end

node_user(("Dashboard user"))

node_user -.->|"views"| node_frontend
node_backend -->|"serves files"| node_frontend
node_frontend -->|"fetches API"| node_backend
node_backend -->|"connects and queries"| node_postgres
node_reporting -->|"queries metrics"| node_postgres
node_records -->|"queries listings"| node_postgres
node_reporting -->|"returns chart data"| node_frontend
node_records -->|"returns rows"| node_frontend

click node_frontend "https://github.com/varshini-balaji2021/plate2plate/blob/main/Plate2Plate_Corrected/script.js"
click node_backend "https://github.com/varshini-balaji2021/plate2plate/blob/main/Plate2Plate_Corrected/backend/app.py"
click node_reporting "https://github.com/varshini-balaji2021/plate2plate/blob/main/Plate2Plate_Corrected/backend/app.py"
click node_records "https://github.com/varshini-balaji2021/plate2plate/blob/main/Plate2Plate_Corrected/backend/app.py"

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_frontend,node_user toneBlue
class node_backend,node_reporting,node_records toneAmber
class node_postgres toneMint
```

## Components

### Dashboard

- [Web dashboard](https://github.com/varshini-balaji2021/plate2plate/blob/main/Plate2Plate_Corrected/script.js): `Plate2Plate_Corrected/script.js`

### API service

- [FastAPI backend](https://github.com/varshini-balaji2021/plate2plate/blob/main/Plate2Plate_Corrected/backend/app.py): `Plate2Plate_Corrected/backend/app.py`
- [Dashboard reporting](https://github.com/varshini-balaji2021/plate2plate/blob/main/Plate2Plate_Corrected/backend/app.py): `Plate2Plate_Corrected/backend/app.py`
- [Food and transaction listings](https://github.com/varshini-balaji2021/plate2plate/blob/main/Plate2Plate_Corrected/backend/app.py): `Plate2Plate_Corrected/backend/app.py`

### Data

- **Supabase PostgreSQL**

### Other components

- **Dashboard user**

## Connections

- Dashboard user → Web dashboard: views
- FastAPI backend → Web dashboard: serves files (evidence: `Plate2Plate_Corrected/backend/app.py`)
- Web dashboard → FastAPI backend: fetches API (evidence: `Plate2Plate_Corrected/script.js`)
- FastAPI backend → Supabase PostgreSQL: connects and queries (evidence: `Plate2Plate_Corrected/backend/app.py`)
- Dashboard reporting → Supabase PostgreSQL: queries metrics (evidence: `Plate2Plate_Corrected/backend/app.py`)
- Food and transaction listings → Supabase PostgreSQL: queries listings (evidence: `Plate2Plate_Corrected/backend/app.py`)
- Dashboard reporting → Web dashboard: returns chart data (evidence: `Plate2Plate_Corrected/script.js`)
- Food and transaction listings → Web dashboard: returns rows (evidence: `Plate2Plate_Corrected/script.js`)
