# food-aid-connect/food-aid-connect architecture

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

- Interactive diagram: https://gitdiagram.com/food-aid-connect/food-aid-connect
- Repository: https://github.com/food-aid-connect/food-aid-connect

## Overview

Food Aid Connect connects food donors and charities through surplus-batch posting, discovery, and reservation. The principal workflow is donor batch submission with validated details, persistence, charity browsing, and atomic reservation; account registration, login, and reservation listings support that flow. The Vue client provides navigation and an available-batches view backed by the Flask API. The README documents PostgreSQL with a SQLite fallback and additional batch CRUD/API capabilities. Some backend routes and generated-client internals were not excerpted, so edges for those are limited to documented behavior.

Main entry points: [`backend/app.py`](https://github.com/food-aid-connect/food-aid-connect/blob/main/backend/app.py) (Flask routes and models), [`frontend/src/router/index.ts`](https://github.com/food-aid-connect/food-aid-connect/blob/main/frontend/src/router/index.ts) (Page routing), [`frontend/src/components/TheWelcome.vue`](https://github.com/food-aid-connect/food-aid-connect/blob/main/frontend/src/components/TheWelcome.vue) (Welcome content), [`frontend/src/App.vue`](https://github.com/food-aid-connect/food-aid-connect/blob/main/frontend/src/App.vue) (Vue application shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_vue_app["Vue application shell<br/>[App.vue]"]
  node_router["Page routing<br/>[index.ts]"]
  node_batch_view["Available batches view"]
  node_home_view["Home welcome view<br/>[HomeView.vue]"]
  node_welcome_content["Welcome content<br/>[TheWelcome.vue]"]
  node_welcome_item["Welcome item layout<br/>[WelcomeItem.vue]"]
  node_welcome_icons["Welcome icons"]
  node_api_client["Generated API client"]
end

subgraph group_accounts["Accounts"]
  node_flask_app["Flask routes and models<br/>[app.py]"]
  node_account_flow["Account access<br/>[app.py]"]
end

subgraph group_batches["Batch workflow"]
  node_batch_listing["Batch discovery<br/>[app.py]"]
  node_batch_creation["Batch creation<br/>[app.py]"]
  node_batch_validation["Batch details validation<br/>[batch_details.py]"]
  node_reservations["Reservations and CRUD<br/>[app.py]"]
end

subgraph group_persistence["Persistence"]
  node_database[("Application database")]
end

node_visitor(("Donors and charities"))

node_visitor -->|"uses"| node_vue_app
node_vue_app -->|"renders routes"| node_router
node_router -->|"routes home"| node_home_view
node_router -->|"routes batches"| node_batch_view
node_home_view -->|"renders"| node_welcome_content
node_welcome_content -->|"uses layout"| node_welcome_item
node_welcome_content -->|"renders"| node_welcome_icons
node_batch_view -->|"requests batches"| node_api_client
node_api_client -->|"calls API"| node_flask_app
node_visitor -->|"uses server pages"| node_flask_app
node_flask_app -->|"handles accounts"| node_account_flow
node_flask_app -->|"serves listings"| node_batch_listing
node_flask_app -->|"handles submissions"| node_batch_creation
node_batch_creation -->|"validates details"| node_batch_validation
node_flask_app -->|"handles reservation routes"| node_reservations
node_flask_app -->|"reads and writes"| node_database
node_visitor -->|"posts surplus"| node_batch_creation
node_visitor -->|"reserves batches"| node_reservations

click node_vue_app "https://github.com/food-aid-connect/food-aid-connect/blob/main/frontend/src/App.vue"
click node_router "https://github.com/food-aid-connect/food-aid-connect/blob/main/frontend/src/router/index.ts"
click node_batch_view "https://github.com/food-aid-connect/food-aid-connect/blob/main/frontend/src/views/AvailableBatchesView.vue"
click node_home_view "https://github.com/food-aid-connect/food-aid-connect/blob/main/frontend/src/views/HomeView.vue"
click node_welcome_content "https://github.com/food-aid-connect/food-aid-connect/blob/main/frontend/src/components/TheWelcome.vue"
click node_welcome_item "https://github.com/food-aid-connect/food-aid-connect/blob/main/frontend/src/components/WelcomeItem.vue"
click node_welcome_icons "https://github.com/food-aid-connect/food-aid-connect/tree/main/frontend/src/components/icons"
click node_api_client "https://github.com/food-aid-connect/food-aid-connect/tree/main/frontend/src/api/generated"
click node_flask_app "https://github.com/food-aid-connect/food-aid-connect/blob/main/backend/app.py"
click node_account_flow "https://github.com/food-aid-connect/food-aid-connect/blob/main/backend/app.py"
click node_batch_listing "https://github.com/food-aid-connect/food-aid-connect/blob/main/backend/app.py"
click node_batch_creation "https://github.com/food-aid-connect/food-aid-connect/blob/main/backend/app.py"
click node_batch_validation "https://github.com/food-aid-connect/food-aid-connect/blob/main/backend/batch_details.py"
click node_reservations "https://github.com/food-aid-connect/food-aid-connect/blob/main/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_vue_app,node_router,node_batch_view,node_home_view,node_welcome_content,node_welcome_item,node_welcome_icons,node_api_client toneBlue
class node_flask_app,node_account_flow toneAmber
class node_batch_listing,node_batch_creation,node_batch_validation,node_reservations toneMint
class node_database toneRose
class node_visitor toneIndigo
```

## Components

### Web client

- [Vue application shell](https://github.com/food-aid-connect/food-aid-connect/blob/main/frontend/src/App.vue): `frontend/src/App.vue`
- [Page routing](https://github.com/food-aid-connect/food-aid-connect/blob/main/frontend/src/router/index.ts): `frontend/src/router/index.ts`
- [Available batches view](https://github.com/food-aid-connect/food-aid-connect/blob/main/frontend/src/views/AvailableBatchesView.vue): `frontend/src/views/AvailableBatchesView.vue`
- [Home welcome view](https://github.com/food-aid-connect/food-aid-connect/blob/main/frontend/src/views/HomeView.vue): `frontend/src/views/HomeView.vue`
- [Welcome content](https://github.com/food-aid-connect/food-aid-connect/blob/main/frontend/src/components/TheWelcome.vue): `frontend/src/components/TheWelcome.vue`
- [Welcome item layout](https://github.com/food-aid-connect/food-aid-connect/blob/main/frontend/src/components/WelcomeItem.vue): `frontend/src/components/WelcomeItem.vue`
- [Welcome icons](https://github.com/food-aid-connect/food-aid-connect/tree/main/frontend/src/components/icons): `frontend/src/components/icons`
- [Generated API client](https://github.com/food-aid-connect/food-aid-connect/tree/main/frontend/src/api/generated): `frontend/src/api/generated`

### Accounts

- [Flask routes and models](https://github.com/food-aid-connect/food-aid-connect/blob/main/backend/app.py): `backend/app.py`
- [Account access](https://github.com/food-aid-connect/food-aid-connect/blob/main/backend/app.py): `backend/app.py`

### Batch workflow

- [Batch discovery](https://github.com/food-aid-connect/food-aid-connect/blob/main/backend/app.py): `backend/app.py`
- [Batch creation](https://github.com/food-aid-connect/food-aid-connect/blob/main/backend/app.py): `backend/app.py`
- [Batch details validation](https://github.com/food-aid-connect/food-aid-connect/blob/main/backend/batch_details.py): `backend/batch_details.py`
- [Reservations and CRUD](https://github.com/food-aid-connect/food-aid-connect/blob/main/backend/app.py): `backend/app.py`

### Persistence

- **Application database**

### Other components

- **Donors and charities**

## Connections

- Donors and charities → Vue application shell: uses (evidence: `README.md`)
- Vue application shell → Page routing: renders routes (evidence: `frontend/src/App.vue`)
- Page routing → Home welcome view: routes home (evidence: `frontend/src/router/index.ts`)
- Page routing → Available batches view: routes batches (evidence: `frontend/src/router/index.ts`)
- Home welcome view → Welcome content: renders (evidence: `frontend/src/views/HomeView.vue`)
- Welcome content → Welcome item layout: uses layout (evidence: `frontend/src/components/TheWelcome.vue`)
- Welcome content → Welcome icons: renders (evidence: `frontend/src/components/TheWelcome.vue`)
- Available batches view → Generated API client: requests batches (evidence: `frontend/src/views/AvailableBatchesView.vue`)
- Generated API client → Flask routes and models: calls API (evidence: `README.md`)
- Donors and charities → Flask routes and models: uses server pages (evidence: `README.md`)
- Flask routes and models → Account access: handles accounts (evidence: `backend/app.py`)
- Flask routes and models → Batch discovery: serves listings (evidence: `backend/app.py`)
- Flask routes and models → Batch creation: handles submissions (evidence: `backend/app.py`)
- Batch creation → Batch details validation: validates details (evidence: `backend/app.py`)
- Flask routes and models → Reservations and CRUD: handles reservation routes (evidence: `backend/app.py`)
- Flask routes and models → Application database: reads and writes (evidence: `backend/app.py`)
- Donors and charities → Batch creation: posts surplus (evidence: `README.md`)
- Donors and charities → Reservations and CRUD: reserves batches (evidence: `README.md`)
