# sahalpk007/my-rms-monorepo architecture

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

- Interactive diagram: https://gitdiagram.com/sahalpk007/my-rms-monorepo
- Repository: https://github.com/sahalpk007/my-rms-monorepo

## Overview

RMS is a restaurant operations platform with role-specific web dashboards backed by a NestJS API and PostgreSQL. The principal workflow is staff or customer interaction through the routed frontend, authenticated API requests, and domain services that manage orders, menus, kitchen status, and payments. Separate branches cover inventory, staff, ratings, notifications, and operational analytics. The README documents broader capabilities than the sampled code; arrows below are limited to relationships shown in excerpts or explicitly described there.

Main entry points: [`apps/frontend/src/App.tsx`](https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/frontend/src/App.tsx) (Route and dashboards), [`apps/frontend/src/hooks/useWaiterOrders.ts`](https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/frontend/src/hooks/useWaiterOrders.ts) (Waiter order workflow), [`apps/frontend/src/context/AuthContext.tsx`](https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/frontend/src/context/AuthContext.tsx) (Auth context), [`apps/frontend/src/lib/api/auth.service.ts`](https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/frontend/src/lib/api/auth.service.ts) (Auth API service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Route and dashboards<br/>[App.tsx]"]
  node_authctx["Auth context<br/>[AuthContext.tsx]"]
  node_appctx["App context<br/>[AppContext.tsx]"]
  node_tracking["Order tracking"]
  node_waiterhook["Waiter order workflow<br/>[useWaiterOrders.ts]"]
  node_contract["API types<br/>[api.types.ts]"]
end

subgraph group_identity["Identity and API"]
  node_authservice["Auth API service<br/>[auth.service.ts]"]
  node_apiclient["HTTP API client<br/>[client.ts]"]
  node_waiterapi["Waiter API service<br/>[waiter.service.ts]"]
  node_socket["Socket client<br/>[client.ts]"]
  node_authcontroller["Auth endpoints<br/>[auth.controller.ts]"]
  node_authservicebe["Authentication service<br/>[auth.service.ts]"]
end

subgraph group_operations["Restaurant operations"]
  node_orderscontroller["Order endpoints"]
  node_ordersservice["Order management<br/>[orders.service.ts]"]
  node_waitercontroller["Waiter endpoints"]
  node_waiterservice["Waiter workflows<br/>[waiter.service.ts]"]
  node_menucontroller["Menu endpoints<br/>[menu.controller.ts]"]
  node_menuserve["Menu management<br/>[menu.service.ts]"]
  node_kitchen["Kitchen realtime<br/>[kitchen.gateway.ts]"]
end

subgraph group_platform["Data and administration"]
  node_dashboard["Operational analytics"]
  node_staff["Staff administration<br/>[staff.service.ts]"]
  node_stock["Inventory management<br/>[stock.service.ts]"]
  node_ratings["Customer ratings<br/>[ratings.service.ts]"]
  node_notifications["Notifications"]
  node_upload["Image uploads<br/>[upload.service.ts]"]
  node_prisma[("Prisma data access<br/>[prisma.service.ts]")]
end

node_user(("Restaurant users"))

node_user -->|"uses"| node_app
node_app -->|"provides routes"| node_authctx
node_app -->|"provides routes"| node_appctx
node_app -->|"routes to"| node_tracking
node_authctx -->|"calls"| node_authservice
node_authservice -->|"sends requests"| node_apiclient
node_waiterhook -->|"calls"| node_waiterapi
node_waiterhook -->|"opens connection"| node_socket
node_waiterapi -->|"sends requests"| node_apiclient
node_user -->|"authenticates"| node_authcontroller
node_authcontroller -->|"delegates to"| node_authservicebe
node_user -->|"manages orders"| node_waitercontroller
node_waitercontroller -->|"delegates to"| node_waiterservice
node_waiterservice -->|"queries"| node_prisma
node_orderscontroller -->|"delegates to"| node_ordersservice
node_ordersservice -.->|"queries"| node_prisma
node_menucontroller -->|"delegates to"| node_menuserve
node_user -->|"receives live updates"| node_kitchen
node_user -->|"views reporting"| node_dashboard
node_user -->|"administers staff"| node_staff
node_user -->|"manages inventory"| node_stock
node_user -->|"submits ratings"| node_ratings
node_user -->|"uses notifications"| node_notifications
node_user -.->|"uploads images"| node_upload

click node_app "https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/frontend/src/App.tsx"
click node_authctx "https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/frontend/src/context/AuthContext.tsx"
click node_appctx "https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/frontend/src/context/AppContext.tsx"
click node_tracking "https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/frontend/src/pages/OrderTrackingPage.tsx"
click node_waiterhook "https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/frontend/src/hooks/useWaiterOrders.ts"
click node_contract "https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/frontend/src/lib/types/api.types.ts"
click node_authservice "https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/frontend/src/lib/api/auth.service.ts"
click node_apiclient "https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/frontend/src/lib/api/client.ts"
click node_waiterapi "https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/frontend/src/lib/api/waiter/waiter.service.ts"
click node_socket "https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/frontend/src/lib/socket/client.ts"
click node_authcontroller "https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/backend/src/auth/auth.controller.ts"
click node_authservicebe "https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/backend/src/auth/auth.service.ts"
click node_orderscontroller "https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/backend/src/orders/orders.controller.ts"
click node_ordersservice "https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/backend/src/orders/orders.service.ts"
click node_waitercontroller "https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/backend/src/waiter/waiter.controller.ts"
click node_waiterservice "https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/backend/src/waiter/waiter.service.ts"
click node_menucontroller "https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/backend/src/menu/menu.controller.ts"
click node_menuserve "https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/backend/src/menu/menu.service.ts"
click node_kitchen "https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/backend/src/kitchen/kitchen.gateway.ts"
click node_dashboard "https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/backend/src/dashboard/dashboard.service.ts"
click node_staff "https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/backend/src/staff/staff.service.ts"
click node_stock "https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/backend/src/stock/stock.service.ts"
click node_ratings "https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/backend/src/ratings/ratings.service.ts"
click node_notifications "https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/backend/src/notifications/notifications.service.ts"
click node_upload "https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/backend/src/upload/upload.service.ts"
click node_prisma "https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/backend/src/prisma.service.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_app,node_authctx,node_appctx,node_tracking,node_waiterhook,node_contract,node_user toneBlue
class node_authservice,node_apiclient,node_waiterapi,node_socket,node_authcontroller,node_authservicebe toneAmber
class node_orderscontroller,node_ordersservice,node_waitercontroller,node_waiterservice,node_menucontroller,node_menuserve,node_kitchen toneMint
class node_dashboard,node_staff,node_stock,node_ratings,node_notifications,node_upload,node_prisma toneRose
```

## Components

### Web application

- [Route and dashboards](https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/frontend/src/App.tsx): `apps/frontend/src/App.tsx`
- [Auth context](https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/frontend/src/context/AuthContext.tsx): `apps/frontend/src/context/AuthContext.tsx`
- [App context](https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/frontend/src/context/AppContext.tsx): `apps/frontend/src/context/AppContext.tsx`
- [Order tracking](https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/frontend/src/pages/OrderTrackingPage.tsx): `apps/frontend/src/pages/OrderTrackingPage.tsx`
- [Waiter order workflow](https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/frontend/src/hooks/useWaiterOrders.ts): `apps/frontend/src/hooks/useWaiterOrders.ts`
- [API types](https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/frontend/src/lib/types/api.types.ts): `apps/frontend/src/lib/types/api.types.ts`

### Identity and API

- [Auth API service](https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/frontend/src/lib/api/auth.service.ts): `apps/frontend/src/lib/api/auth.service.ts`
- [HTTP API client](https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/frontend/src/lib/api/client.ts): `apps/frontend/src/lib/api/client.ts`
- [Waiter API service](https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/frontend/src/lib/api/waiter/waiter.service.ts): `apps/frontend/src/lib/api/waiter/waiter.service.ts`
- [Socket client](https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/frontend/src/lib/socket/client.ts): `apps/frontend/src/lib/socket/client.ts`
- [Auth endpoints](https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/backend/src/auth/auth.controller.ts): `apps/backend/src/auth/auth.controller.ts`
- [Authentication service](https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/backend/src/auth/auth.service.ts): `apps/backend/src/auth/auth.service.ts`

### Restaurant operations

- [Order endpoints](https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/backend/src/orders/orders.controller.ts): `apps/backend/src/orders/orders.controller.ts`
- [Order management](https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/backend/src/orders/orders.service.ts): `apps/backend/src/orders/orders.service.ts`
- [Waiter endpoints](https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/backend/src/waiter/waiter.controller.ts): `apps/backend/src/waiter/waiter.controller.ts`
- [Waiter workflows](https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/backend/src/waiter/waiter.service.ts): `apps/backend/src/waiter/waiter.service.ts`
- [Menu endpoints](https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/backend/src/menu/menu.controller.ts): `apps/backend/src/menu/menu.controller.ts`
- [Menu management](https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/backend/src/menu/menu.service.ts): `apps/backend/src/menu/menu.service.ts`
- [Kitchen realtime](https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/backend/src/kitchen/kitchen.gateway.ts): `apps/backend/src/kitchen/kitchen.gateway.ts`

### Data and administration

- [Operational analytics](https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/backend/src/dashboard/dashboard.service.ts): `apps/backend/src/dashboard/dashboard.service.ts`
- [Staff administration](https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/backend/src/staff/staff.service.ts): `apps/backend/src/staff/staff.service.ts`
- [Inventory management](https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/backend/src/stock/stock.service.ts): `apps/backend/src/stock/stock.service.ts`
- [Customer ratings](https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/backend/src/ratings/ratings.service.ts): `apps/backend/src/ratings/ratings.service.ts`
- [Notifications](https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/backend/src/notifications/notifications.service.ts): `apps/backend/src/notifications/notifications.service.ts`
- [Image uploads](https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/backend/src/upload/upload.service.ts): `apps/backend/src/upload/upload.service.ts`
- [Prisma data access](https://github.com/sahalpk007/my-rms-monorepo/blob/main/apps/backend/src/prisma.service.ts): `apps/backend/src/prisma.service.ts`

### Other components

- **Restaurant users**

## Connections

- Restaurant users → Route and dashboards: uses
- Route and dashboards → Auth context: provides routes (evidence: `apps/frontend/src/App.tsx`)
- Route and dashboards → App context: provides routes (evidence: `apps/frontend/src/App.tsx`)
- Route and dashboards → Order tracking: routes to (evidence: `apps/frontend/src/App.tsx`)
- Auth context → Auth API service: calls (evidence: `apps/frontend/src/context/AuthContext.tsx`)
- Auth API service → HTTP API client: sends requests (evidence: `apps/frontend/src/lib/api/auth.service.ts`)
- Waiter order workflow → Waiter API service: calls (evidence: `apps/frontend/src/hooks/useWaiterOrders.ts`)
- Waiter order workflow → Socket client: opens connection (evidence: `apps/frontend/src/hooks/useWaiterOrders.ts`)
- Waiter API service → HTTP API client: sends requests (evidence: `apps/frontend/src/lib/api/waiter/waiter.service.ts`)
- Restaurant users → Auth endpoints: authenticates
- Auth endpoints → Authentication service: delegates to (evidence: `apps/backend/src/auth/auth.controller.ts`)
- Restaurant users → Waiter endpoints: manages orders
- Waiter endpoints → Waiter workflows: delegates to (evidence: `apps/backend/src/waiter/waiter.controller.ts`)
- Waiter workflows → Prisma data access: queries (evidence: `apps/backend/src/waiter/waiter.service.ts`)
- Order endpoints → Order management: delegates to (evidence: `apps/backend/src/orders/orders.controller.ts`)
- Order management → Prisma data access: queries
- Menu endpoints → Menu management: delegates to (evidence: `apps/backend/src/menu/menu.controller.ts`)
- Restaurant users → Kitchen realtime: receives live updates
- Restaurant users → Operational analytics: views reporting
- Restaurant users → Staff administration: administers staff
- Restaurant users → Inventory management: manages inventory
- Restaurant users → Customer ratings: submits ratings
- Restaurant users → Notifications: uses notifications
- Restaurant users → Image uploads: uploads images
