# jaswanthyamana/food-butler architecture

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

- Interactive diagram: https://gitdiagram.com/jaswanthyamana/food-butler
- Repository: https://github.com/jaswanthyamana/food-butler

## Overview

Food Butler is a conversational food-ordering platform with customer and administrative interfaces, a Gemini-powered agent, a FastAPI service, and PostgreSQL persistence. The principal flow is customer request → AI interpretation and tool invocation → backend menu/cart/checkout operations → order and delivery tracking. The graph reflects documented capabilities and source-index references; frontend internals and several unsampled AI/backend implementations are represented only at directory or subsystem level, so uncertain links are omitted.

Main entry points: [`backend/app/main.py`](https://github.com/jaswanthyamana/food-butler/blob/main/backend/app/main.py) (FastAPI entry), [`backend/app/crud.py`](https://github.com/jaswanthyamana/food-butler/blob/main/backend/app/crud.py) (Domain operations), [`frontend/index.html`](https://github.com/jaswanthyamana/food-butler/blob/main/frontend/index.html) (Customer app), [`ai_agent/main_orchestrator.py`](https://github.com/jaswanthyamana/food-butler/blob/main/ai_agent/main_orchestrator.py) (AI orchestrator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["User interfaces"]
  node_customer_ui["Customer app<br/>[index.html]"]
  node_admin_ui["Admin panels<br/>[admin.html]"]
  node_restaurant_ui["Restaurant panel"]
end

subgraph group_agent["AI ordering"]
  node_orchestrator["AI orchestrator"]
  node_agent_tools["Ordering tools<br/>[tools.py]"]
  node_api_clients["Backend API clients<br/>[api_clients.py]"]
  node_recommendations["Recommendations"]
end

subgraph group_api["Backend domains"]
  node_api_entry["FastAPI entry<br/>[main.py]"]
  node_auth["Authentication<br/>[auth.py]"]
  node_restaurants_menu["Restaurants and menu<br/>[menu.py]"]
  node_cart["Cart and checkout<br/>[cart.py]"]
  node_orders["Orders and history<br/>[orders.py]"]
  node_delivery["Delivery tracking<br/>[delivery.py]"]
  node_inventory["Inventory<br/>[inventory.py]"]
  node_admin["Administration<br/>[admin.py]"]
  node_profiles["Customer profiles<br/>[customers.py]"]
  node_payments["Payments<br/>[payments.py]"]
end

subgraph group_data["Persistence"]
  node_crud["Domain operations<br/>[crud.py]"]
  node_models["Domain models<br/>[models.py]"]
  node_database["Database sessions<br/>[database.py]"]
  node_postgres[("PostgreSQL")]
end

node_customer(("Customer"))

node_customer -->|"uses"| node_customer_ui
node_customer_ui -->|"sends requests"| node_orchestrator
node_customer_ui -->|"calls REST API"| node_api_entry
node_admin_ui -->|"manages platform"| node_api_entry
node_restaurant_ui -->|"manages restaurant"| node_api_entry
node_orchestrator -->|"invokes tools"| node_agent_tools
node_agent_tools -->|"calls clients"| node_api_clients
node_api_clients -->|"calls backend"| node_api_entry
node_orchestrator -.->|"offers suggestions"| node_recommendations
node_api_entry -->|"registers routes"| node_auth
node_api_entry -->|"registers routes"| node_restaurants_menu
node_api_entry -->|"registers routes"| node_cart
node_api_entry -->|"registers routes"| node_orders
node_api_entry -->|"registers routes"| node_delivery
node_api_entry -->|"registers routes"| node_inventory
node_api_entry -->|"registers routes"| node_admin
node_api_entry -->|"registers routes"| node_profiles
node_api_entry -->|"registers routes"| node_payments
node_auth -->|"looks up users"| node_crud
node_auth -->|"gets sessions"| node_database
node_admin -->|"manages records"| node_crud
node_delivery -->|"updates tracking"| node_crud
node_crud -->|"queries records"| node_models
node_database -->|"connects"| node_postgres
node_models -->|"uses base"| node_database

click node_customer_ui "https://github.com/jaswanthyamana/food-butler/blob/main/frontend/index.html"
click node_admin_ui "https://github.com/jaswanthyamana/food-butler/blob/main/frontend/admin.html"
click node_restaurant_ui "https://github.com/jaswanthyamana/food-butler/blob/main/frontend/restaurant_admin.html"
click node_orchestrator "https://github.com/jaswanthyamana/food-butler/blob/main/ai_agent/main_orchestrator.py"
click node_agent_tools "https://github.com/jaswanthyamana/food-butler/blob/main/ai_agent/tools.py"
click node_api_clients "https://github.com/jaswanthyamana/food-butler/blob/main/ai_agent/api_clients.py"
click node_recommendations "https://github.com/jaswanthyamana/food-butler/tree/main/ai_agent"
click node_api_entry "https://github.com/jaswanthyamana/food-butler/blob/main/backend/app/main.py"
click node_auth "https://github.com/jaswanthyamana/food-butler/blob/main/backend/app/routers/auth.py"
click node_restaurants_menu "https://github.com/jaswanthyamana/food-butler/blob/main/backend/app/routers/menu.py"
click node_cart "https://github.com/jaswanthyamana/food-butler/blob/main/backend/app/routers/cart.py"
click node_orders "https://github.com/jaswanthyamana/food-butler/blob/main/backend/app/routers/orders.py"
click node_delivery "https://github.com/jaswanthyamana/food-butler/blob/main/backend/app/routers/delivery.py"
click node_inventory "https://github.com/jaswanthyamana/food-butler/blob/main/backend/app/routers/inventory.py"
click node_admin "https://github.com/jaswanthyamana/food-butler/blob/main/backend/app/routers/admin.py"
click node_profiles "https://github.com/jaswanthyamana/food-butler/blob/main/backend/app/routers/customers.py"
click node_payments "https://github.com/jaswanthyamana/food-butler/blob/main/backend/app/routers/payments.py"
click node_crud "https://github.com/jaswanthyamana/food-butler/blob/main/backend/app/crud.py"
click node_models "https://github.com/jaswanthyamana/food-butler/blob/main/backend/app/models.py"
click node_database "https://github.com/jaswanthyamana/food-butler/blob/main/backend/app/database.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_customer_ui,node_admin_ui,node_restaurant_ui toneBlue
class node_orchestrator,node_agent_tools,node_api_clients,node_recommendations toneAmber
class node_api_entry,node_auth,node_restaurants_menu,node_cart,node_orders,node_delivery,node_inventory,node_admin,node_profiles,node_payments toneMint
class node_crud,node_models,node_database,node_postgres toneRose
class node_customer toneIndigo
```

## Components

### User interfaces

- [Customer app](https://github.com/jaswanthyamana/food-butler/blob/main/frontend/index.html): `frontend/index.html`
- [Admin panels](https://github.com/jaswanthyamana/food-butler/blob/main/frontend/admin.html): `frontend/admin.html`
- [Restaurant panel](https://github.com/jaswanthyamana/food-butler/blob/main/frontend/restaurant_admin.html): `frontend/restaurant_admin.html`

### AI ordering

- [AI orchestrator](https://github.com/jaswanthyamana/food-butler/blob/main/ai_agent/main_orchestrator.py): `ai_agent/main_orchestrator.py`
- [Ordering tools](https://github.com/jaswanthyamana/food-butler/blob/main/ai_agent/tools.py): `ai_agent/tools.py`
- [Backend API clients](https://github.com/jaswanthyamana/food-butler/blob/main/ai_agent/api_clients.py): `ai_agent/api_clients.py`
- [Recommendations](https://github.com/jaswanthyamana/food-butler/tree/main/ai_agent): `ai_agent`

### Backend domains

- [FastAPI entry](https://github.com/jaswanthyamana/food-butler/blob/main/backend/app/main.py): `backend/app/main.py`
- [Authentication](https://github.com/jaswanthyamana/food-butler/blob/main/backend/app/routers/auth.py): `backend/app/routers/auth.py`
- [Restaurants and menu](https://github.com/jaswanthyamana/food-butler/blob/main/backend/app/routers/menu.py): `backend/app/routers/menu.py`
- [Cart and checkout](https://github.com/jaswanthyamana/food-butler/blob/main/backend/app/routers/cart.py): `backend/app/routers/cart.py`
- [Orders and history](https://github.com/jaswanthyamana/food-butler/blob/main/backend/app/routers/orders.py): `backend/app/routers/orders.py`
- [Delivery tracking](https://github.com/jaswanthyamana/food-butler/blob/main/backend/app/routers/delivery.py): `backend/app/routers/delivery.py`
- [Inventory](https://github.com/jaswanthyamana/food-butler/blob/main/backend/app/routers/inventory.py): `backend/app/routers/inventory.py`
- [Administration](https://github.com/jaswanthyamana/food-butler/blob/main/backend/app/routers/admin.py): `backend/app/routers/admin.py`
- [Customer profiles](https://github.com/jaswanthyamana/food-butler/blob/main/backend/app/routers/customers.py): `backend/app/routers/customers.py`
- [Payments](https://github.com/jaswanthyamana/food-butler/blob/main/backend/app/routers/payments.py): `backend/app/routers/payments.py`

### Persistence

- [Domain operations](https://github.com/jaswanthyamana/food-butler/blob/main/backend/app/crud.py): `backend/app/crud.py`
- [Domain models](https://github.com/jaswanthyamana/food-butler/blob/main/backend/app/models.py): `backend/app/models.py`
- [Database sessions](https://github.com/jaswanthyamana/food-butler/blob/main/backend/app/database.py): `backend/app/database.py`
- **PostgreSQL**

### Other components

- **Customer**

## Connections

- Customer → Customer app: uses (evidence: `README.md`)
- Customer app → AI orchestrator: sends requests (evidence: `README.md`)
- Customer app → FastAPI entry: calls REST API (evidence: `README.md`)
- Admin panels → FastAPI entry: manages platform (evidence: `README.md`)
- Restaurant panel → FastAPI entry: manages restaurant (evidence: `README.md`)
- AI orchestrator → Ordering tools: invokes tools (evidence: `ai_agent/main_orchestrator.py`)
- Ordering tools → Backend API clients: calls clients (evidence: `ai_agent/tools.py`)
- Backend API clients → FastAPI entry: calls backend (evidence: `ai_agent/api_clients.py`)
- AI orchestrator → Recommendations: offers suggestions (evidence: `README.md`)
- FastAPI entry → Authentication: registers routes (evidence: `backend/app/main.py`)
- FastAPI entry → Restaurants and menu: registers routes (evidence: `backend/app/main.py`)
- FastAPI entry → Cart and checkout: registers routes (evidence: `backend/app/main.py`)
- FastAPI entry → Orders and history: registers routes (evidence: `backend/app/main.py`)
- FastAPI entry → Delivery tracking: registers routes (evidence: `backend/app/main.py`)
- FastAPI entry → Inventory: registers routes (evidence: `backend/app/main.py`)
- FastAPI entry → Administration: registers routes (evidence: `backend/app/main.py`)
- FastAPI entry → Customer profiles: registers routes (evidence: `backend/app/main.py`)
- FastAPI entry → Payments: registers routes (evidence: `backend/app/main.py`)
- Authentication → Domain operations: looks up users (evidence: `backend/app/routers/auth.py`)
- Authentication → Database sessions: gets sessions (evidence: `backend/app/routers/auth.py`)
- Administration → Domain operations: manages records (evidence: `backend/app/routers/admin.py`)
- Delivery tracking → Domain operations: updates tracking (evidence: `backend/app/routers/delivery.py`)
- Domain operations → Domain models: queries records (evidence: `backend/app/crud.py`)
- Database sessions → PostgreSQL: connects (evidence: `backend/app/database.py`)
- Domain models → Database sessions: uses base (evidence: `backend/app/models.py`)
