# kshitijp852/cafepos architecture

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

- Interactive diagram: https://gitdiagram.com/kshitijp852/cafepos
- Repository: https://github.com/kshitijp852/cafepos

## Overview

Cafe POS is a restaurant point-of-sale application: staff authenticate, manage tables and orders, and create bills, while owners and managers also oversee reservations, inventory, staff, and reporting. React views call a FastAPI backend over REST; the backend persists application records in MongoDB. The backend is a single sampled server module, so its business domains are represented as distinct responsibilities within that file. Several documented capabilities have no sampled implementation excerpts; those relationships are shown only where the README supports them.

Main entry points: [`frontend/src/utils/api.js`](https://github.com/kshitijp852/cafepos/blob/main/frontend/src/utils/api.js) (REST client), [`frontend/src/App.js`](https://github.com/kshitijp852/cafepos/blob/main/frontend/src/App.js) (App shell), [`frontend/src/components/pos/dashboard/TableDashboard.jsx`](https://github.com/kshitijp852/cafepos/blob/main/frontend/src/components/pos/dashboard/TableDashboard.jsx) (Table dashboard), [`frontend/src/components/pos/dashboard/DashboardView.jsx`](https://github.com/kshitijp852/cafepos/blob/main/frontend/src/components/pos/dashboard/DashboardView.jsx) (Dashboard view)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["POS client"]
  node_app["App shell<br/>[App.js]"]
  node_session["Session storage<br/>[storage.js]"]
  node_dashboard["Table dashboard<br/>[TableDashboard.jsx]"]
  node_dashboard_view["Dashboard view<br/>[DashboardView.jsx]"]
  node_orders_ui["Order screen<br/>[OrderView.jsx]"]
  node_history_ui["History screen<br/>[HistoryView.jsx]"]
  node_inventory_ui["Inventory screen<br/>[InventoryView.jsx]"]
  node_reservations_ui["Reservations screen"]
  node_waiter_app["Waiter interface<br/>[WaiterApp.jsx]"]
  node_api_client["REST client<br/>[api.js]"]
end

subgraph group_operations["Service operations"]
  node_menu["Menu management<br/>[server.py]"]
  node_orders["Order processing<br/>[server.py]"]
  node_tables["Table management<br/>[server.py]"]
  node_reservations["Reservation management<br/>[server.py]"]
  node_billing["Secure billing<br/>[server.py]"]
end

subgraph group_controls["Business controls"]
  node_sessions["Day sessions<br/>[server.py]"]
  node_reporting["Sales reporting<br/>[server.py]"]
  node_inventory["Inventory tracking<br/>[server.py]"]
  node_printing["Receipt printing<br/>[server.py]"]
end

subgraph group_platform["Backend platform"]
  node_auth["Authentication<br/>[server.py]"]
  node_mongodb[("MongoDB")]
end

node_staff(("Staff user"))

node_staff -->|"uses"| node_app
node_app -->|"loads session"| node_session
node_app -->|"renders"| node_dashboard_view
node_dashboard_view -->|"renders"| node_dashboard
node_app -->|"renders"| node_orders_ui
node_app -->|"renders"| node_history_ui
node_app -->|"renders"| node_inventory_ui
node_app -->|"renders"| node_reservations_ui
node_app -->|"renders"| node_waiter_app
node_dashboard -->|"calls"| node_api_client
node_api_client -->|"sends REST requests"| node_auth
node_api_client -->|"sends REST requests"| node_menu
node_api_client -->|"sends REST requests"| node_orders
node_api_client -->|"sends REST requests"| node_tables
node_api_client -->|"sends REST requests"| node_reservations
node_api_client -->|"sends REST requests"| node_billing
node_api_client -->|"sends REST requests"| node_sessions
node_api_client -->|"sends REST requests"| node_reporting
node_api_client -->|"sends REST requests"| node_inventory
node_api_client -->|"sends REST requests"| node_printing
node_auth -->|"reads and writes"| node_mongodb
node_menu -->|"reads and writes"| node_mongodb
node_orders -->|"reads and writes"| node_mongodb
node_tables -->|"reads and writes"| node_mongodb
node_reservations -->|"reads and writes"| node_mongodb
node_billing -->|"reads and writes"| node_mongodb
node_sessions -->|"reads and writes"| node_mongodb
node_reporting -->|"reads"| node_mongodb
node_inventory -->|"reads and writes"| node_mongodb

click node_app "https://github.com/kshitijp852/cafepos/blob/main/frontend/src/App.js"
click node_session "https://github.com/kshitijp852/cafepos/blob/main/frontend/src/utils/storage.js"
click node_dashboard "https://github.com/kshitijp852/cafepos/blob/main/frontend/src/components/pos/dashboard/TableDashboard.jsx"
click node_dashboard_view "https://github.com/kshitijp852/cafepos/blob/main/frontend/src/components/pos/dashboard/DashboardView.jsx"
click node_orders_ui "https://github.com/kshitijp852/cafepos/blob/main/frontend/src/components/pos/order/OrderView.jsx"
click node_history_ui "https://github.com/kshitijp852/cafepos/blob/main/frontend/src/components/pos/history/HistoryView.jsx"
click node_inventory_ui "https://github.com/kshitijp852/cafepos/blob/main/frontend/src/components/pos/inventory/InventoryView.jsx"
click node_reservations_ui "https://github.com/kshitijp852/cafepos/blob/main/frontend/src/components/pos/reservation/ReservationView.jsx"
click node_waiter_app "https://github.com/kshitijp852/cafepos/blob/main/frontend/src/components/pos/waiter/WaiterApp.jsx"
click node_api_client "https://github.com/kshitijp852/cafepos/blob/main/frontend/src/utils/api.js"
click node_auth "https://github.com/kshitijp852/cafepos/blob/main/backend/server.py"
click node_menu "https://github.com/kshitijp852/cafepos/blob/main/backend/server.py"
click node_orders "https://github.com/kshitijp852/cafepos/blob/main/backend/server.py"
click node_tables "https://github.com/kshitijp852/cafepos/blob/main/backend/server.py"
click node_reservations "https://github.com/kshitijp852/cafepos/blob/main/backend/server.py"
click node_billing "https://github.com/kshitijp852/cafepos/blob/main/backend/server.py"
click node_sessions "https://github.com/kshitijp852/cafepos/blob/main/backend/server.py"
click node_reporting "https://github.com/kshitijp852/cafepos/blob/main/backend/server.py"
click node_inventory "https://github.com/kshitijp852/cafepos/blob/main/backend/server.py"
click node_printing "https://github.com/kshitijp852/cafepos/blob/main/backend/server.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_app,node_session,node_dashboard,node_dashboard_view,node_orders_ui,node_history_ui,node_inventory_ui,node_reservations_ui,node_waiter_app,node_api_client,node_staff toneBlue
class node_menu,node_orders,node_tables,node_reservations,node_billing toneAmber
class node_sessions,node_reporting,node_inventory,node_printing toneMint
class node_auth,node_mongodb toneRose
```

## Components

### POS client

- [App shell](https://github.com/kshitijp852/cafepos/blob/main/frontend/src/App.js): `frontend/src/App.js`
- [Session storage](https://github.com/kshitijp852/cafepos/blob/main/frontend/src/utils/storage.js): `frontend/src/utils/storage.js`
- [Table dashboard](https://github.com/kshitijp852/cafepos/blob/main/frontend/src/components/pos/dashboard/TableDashboard.jsx): `frontend/src/components/pos/dashboard/TableDashboard.jsx`
- [Dashboard view](https://github.com/kshitijp852/cafepos/blob/main/frontend/src/components/pos/dashboard/DashboardView.jsx): `frontend/src/components/pos/dashboard/DashboardView.jsx`
- [Order screen](https://github.com/kshitijp852/cafepos/blob/main/frontend/src/components/pos/order/OrderView.jsx): `frontend/src/components/pos/order/OrderView.jsx`
- [History screen](https://github.com/kshitijp852/cafepos/blob/main/frontend/src/components/pos/history/HistoryView.jsx): `frontend/src/components/pos/history/HistoryView.jsx`
- [Inventory screen](https://github.com/kshitijp852/cafepos/blob/main/frontend/src/components/pos/inventory/InventoryView.jsx): `frontend/src/components/pos/inventory/InventoryView.jsx`
- [Reservations screen](https://github.com/kshitijp852/cafepos/blob/main/frontend/src/components/pos/reservation/ReservationView.jsx): `frontend/src/components/pos/reservation/ReservationView.jsx`
- [Waiter interface](https://github.com/kshitijp852/cafepos/blob/main/frontend/src/components/pos/waiter/WaiterApp.jsx): `frontend/src/components/pos/waiter/WaiterApp.jsx`
- [REST client](https://github.com/kshitijp852/cafepos/blob/main/frontend/src/utils/api.js): `frontend/src/utils/api.js`

### Service operations

- [Menu management](https://github.com/kshitijp852/cafepos/blob/main/backend/server.py): `backend/server.py`
- [Order processing](https://github.com/kshitijp852/cafepos/blob/main/backend/server.py): `backend/server.py`
- [Table management](https://github.com/kshitijp852/cafepos/blob/main/backend/server.py): `backend/server.py`
- [Reservation management](https://github.com/kshitijp852/cafepos/blob/main/backend/server.py): `backend/server.py`
- [Secure billing](https://github.com/kshitijp852/cafepos/blob/main/backend/server.py): `backend/server.py`

### Business controls

- [Day sessions](https://github.com/kshitijp852/cafepos/blob/main/backend/server.py): `backend/server.py`
- [Sales reporting](https://github.com/kshitijp852/cafepos/blob/main/backend/server.py): `backend/server.py`
- [Inventory tracking](https://github.com/kshitijp852/cafepos/blob/main/backend/server.py): `backend/server.py`
- [Receipt printing](https://github.com/kshitijp852/cafepos/blob/main/backend/server.py): `backend/server.py`

### Backend platform

- [Authentication](https://github.com/kshitijp852/cafepos/blob/main/backend/server.py): `backend/server.py`
- **MongoDB**

### Other components

- **Staff user**

## Connections

- Staff user → App shell: uses
- App shell → Session storage: loads session (evidence: `frontend/src/App.js`)
- App shell → Dashboard view: renders (evidence: `frontend/src/App.js`)
- Dashboard view → Table dashboard: renders (evidence: `frontend/src/components/pos/dashboard/DashboardView.jsx`)
- App shell → Order screen: renders (evidence: `frontend/src/App.js`)
- App shell → History screen: renders (evidence: `frontend/src/App.js`)
- App shell → Inventory screen: renders (evidence: `frontend/src/App.js`)
- App shell → Reservations screen: renders (evidence: `frontend/src/App.js`)
- App shell → Waiter interface: renders (evidence: `frontend/src/App.js`)
- Table dashboard → REST client: calls (evidence: `frontend/src/components/pos/dashboard/TableDashboard.jsx`)
- REST client → Authentication: sends REST requests (evidence: `README.md`)
- REST client → Menu management: sends REST requests (evidence: `README.md`)
- REST client → Order processing: sends REST requests (evidence: `README.md`)
- REST client → Table management: sends REST requests (evidence: `README.md`)
- REST client → Reservation management: sends REST requests (evidence: `README.md`)
- REST client → Secure billing: sends REST requests (evidence: `README.md`)
- REST client → Day sessions: sends REST requests (evidence: `README.md`)
- REST client → Sales reporting: sends REST requests (evidence: `README.md`)
- REST client → Inventory tracking: sends REST requests (evidence: `README.md`)
- REST client → Receipt printing: sends REST requests (evidence: `README.md`)
- Authentication → MongoDB: reads and writes (evidence: `backend/server.py`)
- Menu management → MongoDB: reads and writes (evidence: `backend/server.py`)
- Order processing → MongoDB: reads and writes (evidence: `backend/server.py`)
- Table management → MongoDB: reads and writes (evidence: `backend/server.py`)
- Reservation management → MongoDB: reads and writes (evidence: `backend/server.py`)
- Secure billing → MongoDB: reads and writes (evidence: `README.md`)
- Day sessions → MongoDB: reads and writes (evidence: `README.md`)
- Sales reporting → MongoDB: reads (evidence: `README.md`)
- Inventory tracking → MongoDB: reads and writes (evidence: `README.md`)
