# aravindhprabu2005/odoo_cafe architecture

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

- Interactive diagram: https://gitdiagram.com/aravindhprabu2005/odoo_cafe
- Repository: https://github.com/aravindhprabu2005/odoo_cafe

## Overview

Odoo Café POS is a React client and Express API for café operations. Staff authenticate, open a shift, create and price orders, take payment, and send kitchen tickets; QR customers can browse a menu, place orders, and track status. Admins also manage venue and catalog data, discounts, employees, settings, and reports. The README documents the PostgreSQL/Supabase persistence layer and real-time sync, but the tree has no WebSocket implementation; the latter is therefore not mapped. Some route modules were not sampled, so their internal calls are not inferred.

Main entry points: [`backend/db.js`](https://github.com/aravindhprabu2005/odoo_cafe/blob/main/backend/db.js) (PostgreSQL store), [`client/src/axiosInstance.js`](https://github.com/aravindhprabu2005/odoo_cafe/blob/main/client/src/axiosInstance.js) (HTTP client), [`client/src/App.js`](https://github.com/aravindhprabu2005/odoo_cafe/blob/main/client/src/App.js) (Application routes), [`backend/src/routes/orders.routes.js`](https://github.com/aravindhprabu2005/odoo_cafe/blob/main/backend/src/routes/orders.routes.js) (Order lifecycle)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React client"]
  node_app["Application routes<br/>[App.js]"]
  node_auth_ui["Sign-in state<br/>[AuthContext.js]"]
  node_pos_ui["POS workspace<br/>[PosDashboard.js]"]
  node_order_ui["Order creation<br/>[CreateOrder.js]"]
  node_self_ui["QR ordering"]
  node_report_ui["Reports view<br/>[Reports.js]"]
  node_api_client["HTTP client<br/>[axiosInstance.js]"]
end

subgraph group_operations["POS operations"]
  node_sessions["Shift sessions<br/>[sessions.routes.js]"]
  node_orders["Order lifecycle<br/>[orders.routes.js]"]
  node_lines["Order items"]
  node_payments["Payments<br/>[payments.routes.js]"]
  node_kds["Kitchen tickets<br/>[kds.routes.js]"]
  node_self_order["Self-order service"]
end

subgraph group_management["Management"]
  node_catalog["Catalog and venue<br/>[products.routes.js]"]
  node_discounts["Coupons and promos"]
  node_reports["Reporting exports<br/>[reports.routes.js]"]
end

subgraph group_service["API service"]
  node_auth["Authentication<br/>[auth.routes.js]"]
end

subgraph group_persistence["Persistence"]
  node_schema["Domain schema<br/>[index.js]"]
  node_db[("PostgreSQL store<br/>[db.js]")]
end

node_staff(("Staff"))
node_qr_guest(("QR guest"))
node_postgres[("PostgreSQL / Supabase")]

node_staff -->|"uses"| node_app
node_qr_guest -->|"opens QR route"| node_app
node_app -->|"provides auth"| node_auth_ui
node_app -->|"routes to POS"| node_pos_ui
node_app -->|"routes to ordering"| node_order_ui
node_app -->|"routes to QR order"| node_self_ui
node_app -->|"routes to reports"| node_report_ui
node_auth_ui -->|"requests auth"| node_api_client
node_pos_ui -->|"requests POS data"| node_api_client
node_order_ui -->|"requests order data"| node_api_client
node_self_ui -->|"requests menu and status"| node_api_client
node_report_ui -.->|"requests reports"| node_api_client
node_api_client -.->|"calls API"| node_auth
node_api_client -.->|"calls API"| node_orders
node_api_client -.->|"calls API"| node_self_order
node_api_client -.->|"calls API"| node_reports
node_orders -->|"reads and writes"| node_db
node_orders -.->|"applies promotions"| node_discounts
node_self_order -->|"reads and writes"| node_db
node_reports -->|"queries sales data"| node_db
node_sessions -.->|"reads and writes"| node_db
node_lines -.->|"reads and writes"| node_db
node_payments -.->|"reads and writes"| node_db
node_kds -.->|"reads and writes"| node_db
node_catalog -.->|"reads and writes"| node_db
node_discounts -.->|"reads and writes"| node_db
node_db -->|"uses definitions"| node_schema
node_db -->|"persists data"| node_postgres

click node_app "https://github.com/aravindhprabu2005/odoo_cafe/blob/main/client/src/App.js"
click node_auth_ui "https://github.com/aravindhprabu2005/odoo_cafe/blob/main/client/src/context/AuthContext.js"
click node_pos_ui "https://github.com/aravindhprabu2005/odoo_cafe/blob/main/client/src/pages/PosDashboard.js"
click node_order_ui "https://github.com/aravindhprabu2005/odoo_cafe/blob/main/client/src/pages/CreateOrder.js"
click node_self_ui "https://github.com/aravindhprabu2005/odoo_cafe/blob/main/client/src/pages/SelfOrderCustomer.js"
click node_report_ui "https://github.com/aravindhprabu2005/odoo_cafe/blob/main/client/src/pages/Reports.js"
click node_api_client "https://github.com/aravindhprabu2005/odoo_cafe/blob/main/client/src/axiosInstance.js"
click node_sessions "https://github.com/aravindhprabu2005/odoo_cafe/blob/main/backend/src/routes/sessions.routes.js"
click node_orders "https://github.com/aravindhprabu2005/odoo_cafe/blob/main/backend/src/routes/orders.routes.js"
click node_lines "https://github.com/aravindhprabu2005/odoo_cafe/blob/main/backend/src/routes/orderLines.routes.js"
click node_payments "https://github.com/aravindhprabu2005/odoo_cafe/blob/main/backend/src/routes/payments.routes.js"
click node_kds "https://github.com/aravindhprabu2005/odoo_cafe/blob/main/backend/src/routes/kds.routes.js"
click node_self_order "https://github.com/aravindhprabu2005/odoo_cafe/blob/main/backend/src/routes/selfOrdering.routes.js"
click node_auth "https://github.com/aravindhprabu2005/odoo_cafe/blob/main/backend/src/routes/auth.routes.js"
click node_catalog "https://github.com/aravindhprabu2005/odoo_cafe/blob/main/backend/src/routes/products.routes.js"
click node_discounts "https://github.com/aravindhprabu2005/odoo_cafe/blob/main/backend/src/routes/promotions.routes.js"
click node_reports "https://github.com/aravindhprabu2005/odoo_cafe/blob/main/backend/src/routes/reports.routes.js"
click node_schema "https://github.com/aravindhprabu2005/odoo_cafe/blob/main/backend/src/db/schema/index.js"
click node_db "https://github.com/aravindhprabu2005/odoo_cafe/blob/main/backend/db.js"

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_app,node_auth_ui,node_pos_ui,node_order_ui,node_self_ui,node_report_ui,node_api_client toneBlue
class node_sessions,node_orders,node_lines,node_payments,node_kds,node_self_order,node_postgres toneAmber
class node_catalog,node_discounts,node_reports toneMint
class node_auth toneRose
class node_schema,node_db,node_staff,node_qr_guest toneIndigo
```

## Components

### React client

- [Application routes](https://github.com/aravindhprabu2005/odoo_cafe/blob/main/client/src/App.js): `client/src/App.js`
- [Sign-in state](https://github.com/aravindhprabu2005/odoo_cafe/blob/main/client/src/context/AuthContext.js): `client/src/context/AuthContext.js`
- [POS workspace](https://github.com/aravindhprabu2005/odoo_cafe/blob/main/client/src/pages/PosDashboard.js): `client/src/pages/PosDashboard.js`
- [Order creation](https://github.com/aravindhprabu2005/odoo_cafe/blob/main/client/src/pages/CreateOrder.js): `client/src/pages/CreateOrder.js`
- [QR ordering](https://github.com/aravindhprabu2005/odoo_cafe/blob/main/client/src/pages/SelfOrderCustomer.js): `client/src/pages/SelfOrderCustomer.js`
- [Reports view](https://github.com/aravindhprabu2005/odoo_cafe/blob/main/client/src/pages/Reports.js): `client/src/pages/Reports.js`
- [HTTP client](https://github.com/aravindhprabu2005/odoo_cafe/blob/main/client/src/axiosInstance.js): `client/src/axiosInstance.js`

### POS operations

- [Shift sessions](https://github.com/aravindhprabu2005/odoo_cafe/blob/main/backend/src/routes/sessions.routes.js): `backend/src/routes/sessions.routes.js`
- [Order lifecycle](https://github.com/aravindhprabu2005/odoo_cafe/blob/main/backend/src/routes/orders.routes.js): `backend/src/routes/orders.routes.js`
- [Order items](https://github.com/aravindhprabu2005/odoo_cafe/blob/main/backend/src/routes/orderLines.routes.js): `backend/src/routes/orderLines.routes.js`
- [Payments](https://github.com/aravindhprabu2005/odoo_cafe/blob/main/backend/src/routes/payments.routes.js): `backend/src/routes/payments.routes.js`
- [Kitchen tickets](https://github.com/aravindhprabu2005/odoo_cafe/blob/main/backend/src/routes/kds.routes.js): `backend/src/routes/kds.routes.js`
- [Self-order service](https://github.com/aravindhprabu2005/odoo_cafe/blob/main/backend/src/routes/selfOrdering.routes.js): `backend/src/routes/selfOrdering.routes.js`

### Management

- [Catalog and venue](https://github.com/aravindhprabu2005/odoo_cafe/blob/main/backend/src/routes/products.routes.js): `backend/src/routes/products.routes.js`
- [Coupons and promos](https://github.com/aravindhprabu2005/odoo_cafe/blob/main/backend/src/routes/promotions.routes.js): `backend/src/routes/promotions.routes.js`
- [Reporting exports](https://github.com/aravindhprabu2005/odoo_cafe/blob/main/backend/src/routes/reports.routes.js): `backend/src/routes/reports.routes.js`

### API service

- [Authentication](https://github.com/aravindhprabu2005/odoo_cafe/blob/main/backend/src/routes/auth.routes.js): `backend/src/routes/auth.routes.js`

### Persistence

- [Domain schema](https://github.com/aravindhprabu2005/odoo_cafe/blob/main/backend/src/db/schema/index.js): `backend/src/db/schema/index.js`
- [PostgreSQL store](https://github.com/aravindhprabu2005/odoo_cafe/blob/main/backend/db.js): `backend/db.js`

### Other components

- **Staff**
- **QR guest**
- **PostgreSQL / Supabase**

## Connections

- Staff → Application routes: uses (evidence: `client/src/App.js`)
- QR guest → Application routes: opens QR route (evidence: `client/src/App.js`)
- Application routes → Sign-in state: provides auth (evidence: `client/src/App.js`)
- Application routes → POS workspace: routes to POS (evidence: `client/src/App.js`)
- Application routes → Order creation: routes to ordering (evidence: `client/src/App.js`)
- Application routes → QR ordering: routes to QR order (evidence: `client/src/App.js`)
- Application routes → Reports view: routes to reports (evidence: `client/src/App.js`)
- Sign-in state → HTTP client: requests auth (evidence: `client/src/context/AuthContext.js`)
- POS workspace → HTTP client: requests POS data (evidence: `client/src/pages/PosDashboard.js`)
- Order creation → HTTP client: requests order data (evidence: `client/src/pages/CreateOrder.js`)
- QR ordering → HTTP client: requests menu and status (evidence: `client/src/pages/SelfOrderCustomer.js`)
- Reports view → HTTP client: requests reports
- HTTP client → Authentication: calls API (evidence: `README.md`)
- HTTP client → Order lifecycle: calls API (evidence: `README.md`)
- HTTP client → Self-order service: calls API (evidence: `README.md`)
- HTTP client → Reporting exports: calls API (evidence: `README.md`)
- Order lifecycle → PostgreSQL store: reads and writes (evidence: `backend/src/routes/orders.routes.js`)
- Order lifecycle → Coupons and promos: applies promotions
- Self-order service → PostgreSQL store: reads and writes (evidence: `backend/src/routes/selfOrdering.routes.js`)
- Reporting exports → PostgreSQL store: queries sales data (evidence: `backend/src/routes/reports.routes.js`)
- Shift sessions → PostgreSQL store: reads and writes
- Order items → PostgreSQL store: reads and writes
- Payments → PostgreSQL store: reads and writes
- Kitchen tickets → PostgreSQL store: reads and writes
- Catalog and venue → PostgreSQL store: reads and writes
- Coupons and promos → PostgreSQL store: reads and writes
- PostgreSQL store → Domain schema: uses definitions (evidence: `backend/db.js`)
- PostgreSQL store → PostgreSQL / Supabase: persists data (evidence: `README.md`)
