# eyuashu06/coffee_house architecture

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

- Interactive diagram: https://gitdiagram.com/eyuashu06/coffee_house
- Repository: https://github.com/eyuashu06/coffee_house

## Overview

Artisanal Reserve is a bilingual food-and-coffee ordering application: customers browse the menu, build a cart, authenticate, place orders and pay; account and manager screens support order tracking and operations. The backend also provides an assistant, reservations, reporting and payment reconciliation. The graph combines sampled frontend calls with source-index references and README capabilities; several backend subsystems are represented at directory level because their implementation files were not sampled. Dashed links indicate relationships not confirmed in the excerpts.

Main entry points: [`frontend/src/lib/api.ts`](https://github.com/eyuashu06/coffee_house/blob/main/frontend/src/lib/api.ts) (API client), [`backend/api/views.py`](https://github.com/eyuashu06/coffee_house/blob/main/backend/api/views.py) (REST API), [`backend/apps/orders/models.py`](https://github.com/eyuashu06/coffee_house/blob/main/backend/apps/orders/models.py) (Orders and lifecycle), [`frontend/src/app/page.tsx`](https://github.com/eyuashu06/coffee_house/blob/main/frontend/src/app/page.tsx) (Storefront)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer experience"]
  node_storefront["Storefront<br/>[page.tsx]"]
  node_cartui["Cart drawer<br/>[CartDrawer.tsx]"]
  node_authui["Authentication UI<br/>[AuthModal.tsx]"]
  node_accountui["Account page<br/>[page.tsx]"]
  node_managerui["Manager dashboard<br/>[page.tsx]"]
  node_authstate["Auth context<br/>[AuthContext.tsx]"]
  node_apiclient["API client<br/>[api.ts]"]
end

subgraph group_commerce["Commerce backend"]
  node_accounts["Accounts and profiles"]
  node_menu[("Menu catalog<br/>[models.py]")]
  node_orders[("Orders and lifecycle<br/>[models.py]")]
  node_api["REST API<br/>[views.py]"]
end

subgraph group_operations["Payments and operations"]
  node_payments["Payment processing<br/>[views.py]"]
  node_gateway["Chapa gateway<br/>[gateway.py]"]
  node_reports["Reporting"]
  node_expiry["Order expiry<br/>[expiry.py]"]
  node_reconcile["Payment reconciliation"]
end

subgraph group_assistant["Assistant"]
  node_assistantui["Assistant chat<br/>[AssistantChat.tsx]"]
  node_assistantapi["Assistant API<br/>[rag_engine.py]"]
  node_engine["Assistant engine<br/>[engine.py]"]
  node_retriever["Grounded retrieval<br/>[retriever.py]"]
  node_ordering["Assistant ordering<br/>[ordering.py]"]
  node_reservation["Reservations<br/>[reservations.py]"]
end

node_customer(("Customer"))
node_external{{"Chapa service"}}

node_customer -->|"browses"| node_storefront
node_storefront -->|"opens"| node_cartui
node_storefront -->|"requests data"| node_apiclient
node_storefront -->|"opens chat"| node_assistantui
node_cartui -->|"requests"| node_apiclient
node_authui -->|"authenticates"| node_authstate
node_authstate -->|"calls"| node_apiclient
node_accountui -->|"requests"| node_apiclient
node_managerui -->|"requests"| node_apiclient
node_apiclient -.->|"calls API"| node_api
node_api -->|"uses"| node_accounts
node_api -->|"uses"| node_orders
node_api -->|"uses"| node_payments
node_api -->|"delegates"| node_reservation
node_orders -->|"references"| node_accounts
node_orders -->|"references"| node_menu
node_payments -->|"calls"| node_gateway
node_payments -->|"uses"| node_orders
node_gateway -.->|"charges"| node_external
node_managerui -->|"requests reports"| node_reports
node_expiry -->|"checks payment"| node_gateway
node_reconcile -.->|"reconciles"| node_payments
node_assistantapi -->|"delegates"| node_engine
node_assistantapi -->|"retrieves"| node_retriever
node_engine -->|"retrieves"| node_retriever
node_engine -->|"delegates"| node_ordering
node_retriever -->|"reads catalog"| node_menu
node_retriever -->|"reads orders"| node_orders
node_assistantui -.->|"sends queries"| node_assistantapi

click node_storefront "https://github.com/eyuashu06/coffee_house/blob/main/frontend/src/app/page.tsx"
click node_cartui "https://github.com/eyuashu06/coffee_house/blob/main/frontend/src/components/CartDrawer.tsx"
click node_authui "https://github.com/eyuashu06/coffee_house/blob/main/frontend/src/components/AuthModal.tsx"
click node_accountui "https://github.com/eyuashu06/coffee_house/blob/main/frontend/src/app/account/page.tsx"
click node_managerui "https://github.com/eyuashu06/coffee_house/blob/main/frontend/src/app/manager/page.tsx"
click node_authstate "https://github.com/eyuashu06/coffee_house/blob/main/frontend/src/context/AuthContext.tsx"
click node_apiclient "https://github.com/eyuashu06/coffee_house/blob/main/frontend/src/lib/api.ts"
click node_accounts "https://github.com/eyuashu06/coffee_house/tree/main/backend/apps/accounts"
click node_menu "https://github.com/eyuashu06/coffee_house/blob/main/backend/apps/menu/models.py"
click node_orders "https://github.com/eyuashu06/coffee_house/blob/main/backend/apps/orders/models.py"
click node_api "https://github.com/eyuashu06/coffee_house/blob/main/backend/api/views.py"
click node_payments "https://github.com/eyuashu06/coffee_house/blob/main/backend/apps/payments/views.py"
click node_gateway "https://github.com/eyuashu06/coffee_house/blob/main/backend/apps/payments/gateway.py"
click node_reports "https://github.com/eyuashu06/coffee_house/tree/main/backend/apps/reports"
click node_expiry "https://github.com/eyuashu06/coffee_house/blob/main/backend/apps/orders/expiry.py"
click node_reconcile "https://github.com/eyuashu06/coffee_house/blob/main/backend/apps/payments/management/commands/reconcile_payments.py"
click node_assistantui "https://github.com/eyuashu06/coffee_house/blob/main/frontend/src/components/AssistantChat.tsx"
click node_assistantapi "https://github.com/eyuashu06/coffee_house/blob/main/backend/api/rag_engine.py"
click node_engine "https://github.com/eyuashu06/coffee_house/blob/main/backend/apps/assistant/engine.py"
click node_retriever "https://github.com/eyuashu06/coffee_house/blob/main/backend/apps/assistant/retriever.py"
click node_ordering "https://github.com/eyuashu06/coffee_house/blob/main/backend/apps/assistant/ordering.py"
click node_reservation "https://github.com/eyuashu06/coffee_house/blob/main/backend/apps/assistant/reservations.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_storefront,node_cartui,node_authui,node_accountui,node_managerui,node_authstate,node_apiclient toneBlue
class node_accounts,node_menu,node_orders,node_api toneAmber
class node_payments,node_gateway,node_reports,node_expiry,node_reconcile toneMint
class node_assistantui,node_assistantapi,node_engine,node_retriever,node_ordering,node_reservation toneRose
class node_customer,node_external toneIndigo
```

## Components

### Customer experience

- [Storefront](https://github.com/eyuashu06/coffee_house/blob/main/frontend/src/app/page.tsx): `frontend/src/app/page.tsx`
- [Cart drawer](https://github.com/eyuashu06/coffee_house/blob/main/frontend/src/components/CartDrawer.tsx): `frontend/src/components/CartDrawer.tsx`
- [Authentication UI](https://github.com/eyuashu06/coffee_house/blob/main/frontend/src/components/AuthModal.tsx): `frontend/src/components/AuthModal.tsx`
- [Account page](https://github.com/eyuashu06/coffee_house/blob/main/frontend/src/app/account/page.tsx): `frontend/src/app/account/page.tsx`
- [Manager dashboard](https://github.com/eyuashu06/coffee_house/blob/main/frontend/src/app/manager/page.tsx): `frontend/src/app/manager/page.tsx`
- [Auth context](https://github.com/eyuashu06/coffee_house/blob/main/frontend/src/context/AuthContext.tsx): `frontend/src/context/AuthContext.tsx`
- [API client](https://github.com/eyuashu06/coffee_house/blob/main/frontend/src/lib/api.ts): `frontend/src/lib/api.ts`

### Commerce backend

- [Accounts and profiles](https://github.com/eyuashu06/coffee_house/tree/main/backend/apps/accounts): `backend/apps/accounts`
- [Menu catalog](https://github.com/eyuashu06/coffee_house/blob/main/backend/apps/menu/models.py): `backend/apps/menu/models.py`
- [Orders and lifecycle](https://github.com/eyuashu06/coffee_house/blob/main/backend/apps/orders/models.py): `backend/apps/orders/models.py`
- [REST API](https://github.com/eyuashu06/coffee_house/blob/main/backend/api/views.py): `backend/api/views.py`

### Payments and operations

- [Payment processing](https://github.com/eyuashu06/coffee_house/blob/main/backend/apps/payments/views.py): `backend/apps/payments/views.py`
- [Chapa gateway](https://github.com/eyuashu06/coffee_house/blob/main/backend/apps/payments/gateway.py): `backend/apps/payments/gateway.py`
- [Reporting](https://github.com/eyuashu06/coffee_house/tree/main/backend/apps/reports): `backend/apps/reports`
- [Order expiry](https://github.com/eyuashu06/coffee_house/blob/main/backend/apps/orders/expiry.py): `backend/apps/orders/expiry.py`
- [Payment reconciliation](https://github.com/eyuashu06/coffee_house/blob/main/backend/apps/payments/management/commands/reconcile_payments.py): `backend/apps/payments/management/commands/reconcile_payments.py`

### Assistant

- [Assistant chat](https://github.com/eyuashu06/coffee_house/blob/main/frontend/src/components/AssistantChat.tsx): `frontend/src/components/AssistantChat.tsx`
- [Assistant API](https://github.com/eyuashu06/coffee_house/blob/main/backend/api/rag_engine.py): `backend/api/rag_engine.py`
- [Assistant engine](https://github.com/eyuashu06/coffee_house/blob/main/backend/apps/assistant/engine.py): `backend/apps/assistant/engine.py`
- [Grounded retrieval](https://github.com/eyuashu06/coffee_house/blob/main/backend/apps/assistant/retriever.py): `backend/apps/assistant/retriever.py`
- [Assistant ordering](https://github.com/eyuashu06/coffee_house/blob/main/backend/apps/assistant/ordering.py): `backend/apps/assistant/ordering.py`
- [Reservations](https://github.com/eyuashu06/coffee_house/blob/main/backend/apps/assistant/reservations.py): `backend/apps/assistant/reservations.py`

### Other components

- **Customer**
- **Chapa service**

## Connections

- Customer → Storefront: browses (evidence: `frontend/src/app/page.tsx`)
- Storefront → Cart drawer: opens (evidence: `frontend/src/app/page.tsx`)
- Storefront → API client: requests data (evidence: `frontend/src/app/page.tsx`)
- Storefront → Assistant chat: opens chat (evidence: `frontend/src/app/page.tsx`)
- Cart drawer → API client: requests (evidence: `frontend/src/components/CartDrawer.tsx`)
- Authentication UI → Auth context: authenticates (evidence: `frontend/src/components/AuthModal.tsx`)
- Auth context → API client: calls (evidence: `frontend/src/context/AuthContext.tsx`)
- Account page → API client: requests (evidence: `frontend/src/app/account/page.tsx`)
- Manager dashboard → API client: requests (evidence: `frontend/src/app/manager/page.tsx`)
- API client → REST API: calls API
- REST API → Accounts and profiles: uses (evidence: `backend/api/views.py`)
- REST API → Orders and lifecycle: uses (evidence: `backend/api/views.py`)
- REST API → Payment processing: uses (evidence: `backend/api/views.py`)
- REST API → Reservations: delegates (evidence: `backend/api/views.py`)
- Orders and lifecycle → Accounts and profiles: references (evidence: `backend/apps/orders/models.py`)
- Orders and lifecycle → Menu catalog: references (evidence: `backend/apps/orders/models.py`)
- Payment processing → Chapa gateway: calls (evidence: `backend/apps/payments/views.py`)
- Payment processing → Orders and lifecycle: uses (evidence: `backend/apps/payments/views.py`)
- Chapa gateway → Chapa service: charges (evidence: `README.md`)
- Manager dashboard → Reporting: requests reports (evidence: `frontend/src/app/manager/page.tsx`)
- Order expiry → Chapa gateway: checks payment (evidence: `README.md`)
- Payment reconciliation → Payment processing: reconciles (evidence: `README.md`)
- Assistant API → Assistant engine: delegates (evidence: `backend/api/rag_engine.py`)
- Assistant API → Grounded retrieval: retrieves (evidence: `backend/api/rag_engine.py`)
- Assistant engine → Grounded retrieval: retrieves (evidence: `backend/apps/assistant/engine.py`)
- Assistant engine → Assistant ordering: delegates (evidence: `backend/apps/assistant/engine.py`)
- Grounded retrieval → Menu catalog: reads catalog (evidence: `backend/apps/assistant/retriever.py`)
- Grounded retrieval → Orders and lifecycle: reads orders (evidence: `backend/apps/assistant/retriever.py`)
- Assistant chat → Assistant API: sends queries
