# mahesh497/dinepooja-poss architecture

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

- Interactive diagram: https://gitdiagram.com/mahesh497/dinepooja-poss
- Repository: https://github.com/mahesh497/dinepooja-poss

## Overview

Sampada POS is a restaurant point-of-sale application for web, PWA, and Android. Its principal workflow is staff opening a table, building an order in POS, sending items to the kitchen, then taking payment and printing a bill. Separate product areas support delivery tracking, operational administration, and reporting/day close. The excerpts show POS-to-order actions, authentication, authorization, and persistence calls; some capability branches are documented in the README but their implementation wiring was not sampled.

Main entry points: [`src/lib/actions/orders.ts`](https://github.com/mahesh497/dinepooja-poss/blob/main/src/lib/actions/orders.ts) (Order actions), [`src/lib/actions/services.ts`](https://github.com/mahesh497/dinepooja-poss/blob/main/src/lib/actions/services.ts) (Service actions), [`src/lib/session.ts`](https://github.com/mahesh497/dinepooja-poss/blob/main/src/lib/session.ts) (Session checks), [`src/components/pos-screen.tsx`](https://github.com/mahesh497/dinepooja-poss/blob/main/src/components/pos-screen.tsx) (POS screen)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sales["Tables and sales"]
  node_tables["Tables<br/>[tables-board.tsx]"]
  node_pos["POS screen<br/>[pos-screen.tsx]"]
  node_orders["Order actions<br/>[orders.ts]"]
  node_services["Service actions<br/>[services.ts]"]
  node_bill["Bill and print<br/>[page.tsx]"]
  node_tax["Tax calculation<br/>[tax.ts]"]
end

subgraph group_kitchen["Kitchen and fulfillment"]
  node_kot["KOT board<br/>[kot-board.tsx]"]
  node_delivery["Delivery board<br/>[delivery-board.tsx]"]
  node_delivery_actions["Delivery actions<br/>[delivery.ts]"]
end

subgraph group_operations["Operations and reporting"]
  node_reports["Reports"]
  node_admin["Admin actions<br/>[admin.ts]"]
  node_email["Email utilities<br/>[email.ts]"]
end

subgraph group_platform["Application platform"]
  node_dashboard["Dashboard shell<br/>[app-shell.tsx]"]
  node_login["Login page<br/>[page.tsx]"]
  node_auth_routes["Auth routes<br/>[route.ts]"]
  node_auth_handler["Auth handler<br/>[next-auth-route.ts]"]
  node_auth["Credentials auth<br/>[auth.ts]"]
  node_session["Session checks<br/>[session.ts]"]
  node_permissions["Role permissions<br/>[permissions.ts]"]
  node_prisma["Prisma client<br/>[prisma.ts]"]
  node_database[("POS database")]
  node_modules["Module registry<br/>[modules.ts]"]
end

node_staff(("Restaurant staff"))

node_staff -->|"selects table"| node_tables
node_staff -->|"creates order"| node_pos
node_tables -.->|"opens table"| node_orders
node_pos -->|"updates order"| node_orders
node_pos -->|"applies coupon"| node_services
node_orders -->|"sends KOT"| node_kot
node_staff -->|"updates preparation"| node_kot
node_staff -->|"takes payment"| node_bill
node_orders -->|"prints bill"| node_bill
node_staff -->|"manages delivery"| node_delivery
node_delivery -.->|"assigns partner"| node_delivery_actions
node_delivery_actions -->|"reads and writes"| node_database
node_staff -->|"reviews results"| node_reports
node_reports -.->|"day close"| node_orders
node_orders -->|"reads and writes"| node_database
node_services -->|"reads and writes"| node_database
node_services -->|"calculates bill"| node_tax
node_auth_routes -->|"routes request"| node_auth_handler
node_auth_handler -->|"configures auth"| node_auth
node_auth -->|"checks credentials"| node_database
node_session -->|"gets session"| node_auth
node_session -->|"checks role"| node_permissions
node_orders -->|"requires permission"| node_session
node_services -->|"requires permission"| node_session
node_prisma -.->|"connects"| node_database
node_dashboard -->|"displays modules"| node_modules
node_dashboard -->|"checks access"| node_permissions

click node_tables "https://github.com/mahesh497/dinepooja-poss/blob/main/src/components/tables-board.tsx"
click node_pos "https://github.com/mahesh497/dinepooja-poss/blob/main/src/components/pos-screen.tsx"
click node_orders "https://github.com/mahesh497/dinepooja-poss/blob/main/src/lib/actions/orders.ts"
click node_services "https://github.com/mahesh497/dinepooja-poss/blob/main/src/lib/actions/services.ts"
click node_kot "https://github.com/mahesh497/dinepooja-poss/blob/main/src/components/kot-board.tsx"
click node_delivery "https://github.com/mahesh497/dinepooja-poss/blob/main/src/components/delivery-board.tsx"
click node_delivery_actions "https://github.com/mahesh497/dinepooja-poss/blob/main/src/lib/actions/delivery.ts"
click node_bill "https://github.com/mahesh497/dinepooja-poss/blob/main/src/app/(dashboard)/bill/%5BorderId%5D/page.tsx"
click node_reports "https://github.com/mahesh497/dinepooja-poss/blob/main/src/components/reports-dashboard.tsx"
click node_admin "https://github.com/mahesh497/dinepooja-poss/blob/main/src/lib/actions/admin.ts"
click node_dashboard "https://github.com/mahesh497/dinepooja-poss/blob/main/src/components/app-shell.tsx"
click node_login "https://github.com/mahesh497/dinepooja-poss/blob/main/src/app/(auth)/login/page.tsx"
click node_auth_routes "https://github.com/mahesh497/dinepooja-poss/blob/main/src/app/api/auth/providers/route.ts"
click node_auth_handler "https://github.com/mahesh497/dinepooja-poss/blob/main/src/lib/next-auth-route.ts"
click node_auth "https://github.com/mahesh497/dinepooja-poss/blob/main/src/lib/auth.ts"
click node_session "https://github.com/mahesh497/dinepooja-poss/blob/main/src/lib/session.ts"
click node_permissions "https://github.com/mahesh497/dinepooja-poss/blob/main/src/lib/permissions.ts"
click node_prisma "https://github.com/mahesh497/dinepooja-poss/blob/main/src/lib/prisma.ts"
click node_tax "https://github.com/mahesh497/dinepooja-poss/blob/main/src/lib/tax.ts"
click node_email "https://github.com/mahesh497/dinepooja-poss/blob/main/src/lib/email.ts"
click node_modules "https://github.com/mahesh497/dinepooja-poss/blob/main/src/lib/modules.ts"

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_tables,node_pos,node_orders,node_services,node_bill,node_tax toneBlue
class node_kot,node_delivery,node_delivery_actions toneAmber
class node_reports,node_admin,node_email toneMint
class node_dashboard,node_login,node_auth_routes,node_auth_handler,node_auth,node_session,node_permissions,node_prisma,node_database,node_modules toneRose
class node_staff toneIndigo
```

## Components

### Tables and sales

- [Tables](https://github.com/mahesh497/dinepooja-poss/blob/main/src/components/tables-board.tsx): `src/components/tables-board.tsx`
- [POS screen](https://github.com/mahesh497/dinepooja-poss/blob/main/src/components/pos-screen.tsx): `src/components/pos-screen.tsx`
- [Order actions](https://github.com/mahesh497/dinepooja-poss/blob/main/src/lib/actions/orders.ts): `src/lib/actions/orders.ts`
- [Service actions](https://github.com/mahesh497/dinepooja-poss/blob/main/src/lib/actions/services.ts): `src/lib/actions/services.ts`
- [Bill and print](https://github.com/mahesh497/dinepooja-poss/blob/main/src/app/(dashboard)/bill/%5BorderId%5D/page.tsx): `src/app/(dashboard)/bill/[orderId]/page.tsx`
- [Tax calculation](https://github.com/mahesh497/dinepooja-poss/blob/main/src/lib/tax.ts): `src/lib/tax.ts`

### Kitchen and fulfillment

- [KOT board](https://github.com/mahesh497/dinepooja-poss/blob/main/src/components/kot-board.tsx): `src/components/kot-board.tsx`
- [Delivery board](https://github.com/mahesh497/dinepooja-poss/blob/main/src/components/delivery-board.tsx): `src/components/delivery-board.tsx`
- [Delivery actions](https://github.com/mahesh497/dinepooja-poss/blob/main/src/lib/actions/delivery.ts): `src/lib/actions/delivery.ts`

### Operations and reporting

- [Reports](https://github.com/mahesh497/dinepooja-poss/blob/main/src/components/reports-dashboard.tsx): `src/components/reports-dashboard.tsx`
- [Admin actions](https://github.com/mahesh497/dinepooja-poss/blob/main/src/lib/actions/admin.ts): `src/lib/actions/admin.ts`
- [Email utilities](https://github.com/mahesh497/dinepooja-poss/blob/main/src/lib/email.ts): `src/lib/email.ts`

### Application platform

- [Dashboard shell](https://github.com/mahesh497/dinepooja-poss/blob/main/src/components/app-shell.tsx): `src/components/app-shell.tsx`
- [Login page](https://github.com/mahesh497/dinepooja-poss/blob/main/src/app/(auth)/login/page.tsx): `src/app/(auth)/login/page.tsx`
- [Auth routes](https://github.com/mahesh497/dinepooja-poss/blob/main/src/app/api/auth/providers/route.ts): `src/app/api/auth/providers/route.ts`
- [Auth handler](https://github.com/mahesh497/dinepooja-poss/blob/main/src/lib/next-auth-route.ts): `src/lib/next-auth-route.ts`
- [Credentials auth](https://github.com/mahesh497/dinepooja-poss/blob/main/src/lib/auth.ts): `src/lib/auth.ts`
- [Session checks](https://github.com/mahesh497/dinepooja-poss/blob/main/src/lib/session.ts): `src/lib/session.ts`
- [Role permissions](https://github.com/mahesh497/dinepooja-poss/blob/main/src/lib/permissions.ts): `src/lib/permissions.ts`
- [Prisma client](https://github.com/mahesh497/dinepooja-poss/blob/main/src/lib/prisma.ts): `src/lib/prisma.ts`
- **POS database**
- [Module registry](https://github.com/mahesh497/dinepooja-poss/blob/main/src/lib/modules.ts): `src/lib/modules.ts`

### Other components

- **Restaurant staff**

## Connections

- Restaurant staff → Tables: selects table (evidence: `README.md`)
- Restaurant staff → POS screen: creates order (evidence: `README.md`)
- Tables → Order actions: opens table
- POS screen → Order actions: updates order (evidence: `src/components/pos-screen.tsx`)
- POS screen → Service actions: applies coupon (evidence: `src/components/pos-screen.tsx`)
- Order actions → KOT board: sends KOT (evidence: `README.md`)
- Restaurant staff → KOT board: updates preparation (evidence: `README.md`)
- Restaurant staff → Bill and print: takes payment (evidence: `README.md`)
- Order actions → Bill and print: prints bill (evidence: `README.md`)
- Restaurant staff → Delivery board: manages delivery (evidence: `README.md`)
- Delivery board → Delivery actions: assigns partner
- Delivery actions → POS database: reads and writes (evidence: `src/lib/actions/delivery.ts`)
- Restaurant staff → Reports: reviews results (evidence: `README.md`)
- Reports → Order actions: day close
- Order actions → POS database: reads and writes (evidence: `src/lib/actions/orders.ts`)
- Service actions → POS database: reads and writes (evidence: `src/lib/actions/services.ts`)
- Service actions → Tax calculation: calculates bill (evidence: `src/lib/actions/services.ts`)
- Auth routes → Auth handler: routes request (evidence: `src/app/api/auth/providers/route.ts`)
- Auth handler → Credentials auth: configures auth (evidence: `src/lib/next-auth-route.ts`)
- Credentials auth → POS database: checks credentials (evidence: `src/lib/auth.ts`)
- Session checks → Credentials auth: gets session (evidence: `src/lib/session.ts`)
- Session checks → Role permissions: checks role (evidence: `src/lib/session.ts`)
- Order actions → Session checks: requires permission (evidence: `src/lib/actions/orders.ts`)
- Service actions → Session checks: requires permission (evidence: `src/lib/actions/services.ts`)
- Prisma client → POS database: connects
- Dashboard shell → Module registry: displays modules
- Dashboard shell → Role permissions: checks access
