# rameshio/samosa-house-qr-menu architecture

> Architecture diagram of the GitHub repository rameshio/samosa-house-qr-menu, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rameshio/samosa-house-qr-menu
- Repository: https://github.com/rameshio/samosa-house-qr-menu
- Video tour (about a minute): https://gitdiagram.com/rameshio/samosa-house-qr-menu/video

## Overview

Samosa House is a mobile-first restaurant website and QR menu: customers open a location-specific menu, browse categories, and use dietary filters and ordering links. The client also contains local admin screens for menu editing, publishing, staff, and audit workflows; the deployed App route currently displays an admin-unavailable notice. Express exposes public menu/status and protected admin APIs, with menu data read from Prisma. The README describes JSON-shaped menu output; sampled source confirms the repository mapping and admin writes. Frontend-to-API details and unsampled route wiring are shown only where supported by the documented architecture or app registration.

Main entry points: [`server/src/app.js`](https://github.com/rameshio/samosa-house-qr-menu/blob/main/server/src/app.js) (Express app), [`server/prisma/client.js`](https://github.com/rameshio/samosa-house-qr-menu/blob/main/server/prisma/client.js) (Prisma client), [`client/src/App.jsx`](https://github.com/rameshio/samosa-house-qr-menu/blob/main/client/src/App.jsx) (Client router), [`client/src/pages/MenuPage.jsx`](https://github.com/rameshio/samosa-house-qr-menu/blob/main/client/src/pages/MenuPage.jsx) (Menu page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Customer Menu"]
  node_app["Client router<br/>[App.jsx]"]
  node_intro["Logo intro<br/>[LogoIntro.jsx]"]
  node_menu["Menu page<br/>[MenuPage.jsx]"]
  node_menuui["Menu browsing UI<br/>[MenuSection.jsx]"]
  node_categoryscroll["Category navigation"]
  node_menuapi["Menu service<br/>[menuService.js]"]
  node_apiclient["API client<br/>[apiClient.js]"]
end

subgraph group_admin["Menu Administration"]
  node_adminpages["Admin pages"]
  node_authcontext["Admin auth state<br/>[AuthContext.jsx]"]
end

subgraph group_backend["API Backend"]
  node_serverapp["Express app<br/>[app.js]"]
  node_menuroutes["Menu routes<br/>[menuRoutes.js]"]
  node_adminroutes["Admin menu routes<br/>[adminMenuRoutes.js]"]
  node_authroutes["Auth routes<br/>[authRoutes.js]"]
  node_staffroutes["Staff routes<br/>[staffRoutes.js]"]
  node_auditroutes["Audit routes<br/>[auditRoutes.js]"]
  node_uploadroutes["Image upload route<br/>[uploadRoutes.js]"]
  node_menucontroller["Menu controller<br/>[menuController.js]"]
  node_admincontroller["Admin menu controller"]
  node_authcontroller["Authentication<br/>[authController.js]"]
  node_staffcontroller["Staff management<br/>[staffController.js]"]
  node_authservice["Password service<br/>[authService.js]"]
  node_storage["Image storage<br/>[storageService.js]"]
  node_statusroutes["Status routes<br/>[statusRoutes.js]"]
end

subgraph group_data["Menu Data"]
  node_menurepo["Menu mapping<br/>[menuRepository.js]"]
  node_prisma["Prisma client<br/>[client.js]"]
  node_database[("Application database")]
end

node_customer(("Customer"))
node_staff(("Admin staff"))
node_imageprovider[("S3 or local files")]

node_customer -->|"opens"| node_app
node_app -->|"renders"| node_intro
node_app -->|"routes to"| node_menu
node_menu -->|"renders"| node_menuui
node_menu -->|"loads menu"| node_menuapi
node_menuui -->|"tracks sections"| node_categoryscroll
node_menuapi -->|"uses"| node_apiclient
node_staff -->|"manages menu"| node_adminpages
node_adminpages -->|"uses"| node_authcontext
node_adminpages -->|"requests"| node_apiclient
node_apiclient -.->|"HTTP requests"| node_serverapp
node_serverapp -->|"mounts"| node_menuroutes
node_serverapp -->|"mounts"| node_adminroutes
node_serverapp -->|"mounts"| node_authroutes
node_serverapp -->|"mounts"| node_staffroutes
node_serverapp -->|"mounts"| node_auditroutes
node_serverapp -->|"mounts"| node_uploadroutes
node_serverapp -->|"mounts"| node_statusroutes
node_menuroutes -->|"dispatches"| node_menucontroller
node_adminroutes -->|"dispatches"| node_admincontroller
node_authroutes -->|"dispatches"| node_authcontroller
node_staffroutes -->|"dispatches"| node_staffcontroller
node_authcontroller -->|"verifies password"| node_authservice
node_menucontroller -->|"gets menu"| node_menurepo
node_menurepo -->|"queries"| node_prisma
node_admincontroller -->|"reads and writes"| node_prisma
node_authcontroller -->|"reads and writes"| node_prisma
node_staffcontroller -->|"reads and writes"| node_prisma
node_prisma -->|"accesses"| node_database
node_uploadroutes -->|"stores image"| node_storage
node_storage -.->|"writes file"| node_imageprovider

click node_app "https://github.com/rameshio/samosa-house-qr-menu/blob/main/client/src/App.jsx"
click node_intro "https://github.com/rameshio/samosa-house-qr-menu/blob/main/client/src/components/LogoIntro.jsx"
click node_menu "https://github.com/rameshio/samosa-house-qr-menu/blob/main/client/src/pages/MenuPage.jsx"
click node_menuui "https://github.com/rameshio/samosa-house-qr-menu/blob/main/client/src/components/MenuSection.jsx"
click node_categoryscroll "https://github.com/rameshio/samosa-house-qr-menu/blob/main/client/src/hooks/useCategoryScroll.js"
click node_menuapi "https://github.com/rameshio/samosa-house-qr-menu/blob/main/client/src/services/menuService.js"
click node_adminpages "https://github.com/rameshio/samosa-house-qr-menu/tree/main/client/src/pages/admin"
click node_authcontext "https://github.com/rameshio/samosa-house-qr-menu/blob/main/client/src/contexts/AuthContext.jsx"
click node_apiclient "https://github.com/rameshio/samosa-house-qr-menu/blob/main/client/src/services/apiClient.js"
click node_serverapp "https://github.com/rameshio/samosa-house-qr-menu/blob/main/server/src/app.js"
click node_menuroutes "https://github.com/rameshio/samosa-house-qr-menu/blob/main/server/src/routes/menuRoutes.js"
click node_adminroutes "https://github.com/rameshio/samosa-house-qr-menu/blob/main/server/src/routes/adminMenuRoutes.js"
click node_authroutes "https://github.com/rameshio/samosa-house-qr-menu/blob/main/server/src/routes/authRoutes.js"
click node_staffroutes "https://github.com/rameshio/samosa-house-qr-menu/blob/main/server/src/routes/staffRoutes.js"
click node_auditroutes "https://github.com/rameshio/samosa-house-qr-menu/blob/main/server/src/routes/auditRoutes.js"
click node_uploadroutes "https://github.com/rameshio/samosa-house-qr-menu/blob/main/server/src/routes/uploadRoutes.js"
click node_menucontroller "https://github.com/rameshio/samosa-house-qr-menu/blob/main/server/src/controllers/menuController.js"
click node_admincontroller "https://github.com/rameshio/samosa-house-qr-menu/blob/main/server/src/controllers/adminMenuController.js"
click node_authcontroller "https://github.com/rameshio/samosa-house-qr-menu/blob/main/server/src/controllers/authController.js"
click node_staffcontroller "https://github.com/rameshio/samosa-house-qr-menu/blob/main/server/src/controllers/staffController.js"
click node_authservice "https://github.com/rameshio/samosa-house-qr-menu/blob/main/server/src/services/authService.js"
click node_menurepo "https://github.com/rameshio/samosa-house-qr-menu/blob/main/server/src/repositories/menuRepository.js"
click node_prisma "https://github.com/rameshio/samosa-house-qr-menu/blob/main/server/prisma/client.js"
click node_storage "https://github.com/rameshio/samosa-house-qr-menu/blob/main/server/src/services/storageService.js"
click node_statusroutes "https://github.com/rameshio/samosa-house-qr-menu/blob/main/server/src/routes/statusRoutes.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_intro,node_menu,node_menuui,node_categoryscroll,node_menuapi,node_apiclient toneBlue
class node_adminpages,node_authcontext,node_imageprovider toneAmber
class node_serverapp,node_menuroutes,node_adminroutes,node_authroutes,node_staffroutes,node_auditroutes,node_uploadroutes,node_menucontroller,node_admincontroller,node_authcontroller,node_staffcontroller,node_authservice,node_storage,node_statusroutes toneMint
class node_menurepo,node_prisma,node_database toneRose
class node_customer,node_staff toneIndigo
```

## Components

### Customer Menu

- [Client router](https://github.com/rameshio/samosa-house-qr-menu/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Logo intro](https://github.com/rameshio/samosa-house-qr-menu/blob/main/client/src/components/LogoIntro.jsx): `client/src/components/LogoIntro.jsx`
- [Menu page](https://github.com/rameshio/samosa-house-qr-menu/blob/main/client/src/pages/MenuPage.jsx): `client/src/pages/MenuPage.jsx`
- [Menu browsing UI](https://github.com/rameshio/samosa-house-qr-menu/blob/main/client/src/components/MenuSection.jsx): `client/src/components/MenuSection.jsx`
- [Category navigation](https://github.com/rameshio/samosa-house-qr-menu/blob/main/client/src/hooks/useCategoryScroll.js): `client/src/hooks/useCategoryScroll.js`
- [Menu service](https://github.com/rameshio/samosa-house-qr-menu/blob/main/client/src/services/menuService.js): `client/src/services/menuService.js`
- [API client](https://github.com/rameshio/samosa-house-qr-menu/blob/main/client/src/services/apiClient.js): `client/src/services/apiClient.js`

### Menu Administration

- [Admin pages](https://github.com/rameshio/samosa-house-qr-menu/tree/main/client/src/pages/admin): `client/src/pages/admin`
- [Admin auth state](https://github.com/rameshio/samosa-house-qr-menu/blob/main/client/src/contexts/AuthContext.jsx): `client/src/contexts/AuthContext.jsx`

### API Backend

- [Express app](https://github.com/rameshio/samosa-house-qr-menu/blob/main/server/src/app.js): `server/src/app.js`
- [Menu routes](https://github.com/rameshio/samosa-house-qr-menu/blob/main/server/src/routes/menuRoutes.js): `server/src/routes/menuRoutes.js`
- [Admin menu routes](https://github.com/rameshio/samosa-house-qr-menu/blob/main/server/src/routes/adminMenuRoutes.js): `server/src/routes/adminMenuRoutes.js`
- [Auth routes](https://github.com/rameshio/samosa-house-qr-menu/blob/main/server/src/routes/authRoutes.js): `server/src/routes/authRoutes.js`
- [Staff routes](https://github.com/rameshio/samosa-house-qr-menu/blob/main/server/src/routes/staffRoutes.js): `server/src/routes/staffRoutes.js`
- [Audit routes](https://github.com/rameshio/samosa-house-qr-menu/blob/main/server/src/routes/auditRoutes.js): `server/src/routes/auditRoutes.js`
- [Image upload route](https://github.com/rameshio/samosa-house-qr-menu/blob/main/server/src/routes/uploadRoutes.js): `server/src/routes/uploadRoutes.js`
- [Menu controller](https://github.com/rameshio/samosa-house-qr-menu/blob/main/server/src/controllers/menuController.js): `server/src/controllers/menuController.js`
- [Admin menu controller](https://github.com/rameshio/samosa-house-qr-menu/blob/main/server/src/controllers/adminMenuController.js): `server/src/controllers/adminMenuController.js`
- [Authentication](https://github.com/rameshio/samosa-house-qr-menu/blob/main/server/src/controllers/authController.js): `server/src/controllers/authController.js`
- [Staff management](https://github.com/rameshio/samosa-house-qr-menu/blob/main/server/src/controllers/staffController.js): `server/src/controllers/staffController.js`
- [Password service](https://github.com/rameshio/samosa-house-qr-menu/blob/main/server/src/services/authService.js): `server/src/services/authService.js`
- [Image storage](https://github.com/rameshio/samosa-house-qr-menu/blob/main/server/src/services/storageService.js): `server/src/services/storageService.js`
- [Status routes](https://github.com/rameshio/samosa-house-qr-menu/blob/main/server/src/routes/statusRoutes.js): `server/src/routes/statusRoutes.js`

### Menu Data

- [Menu mapping](https://github.com/rameshio/samosa-house-qr-menu/blob/main/server/src/repositories/menuRepository.js): `server/src/repositories/menuRepository.js`
- [Prisma client](https://github.com/rameshio/samosa-house-qr-menu/blob/main/server/prisma/client.js): `server/prisma/client.js`
- **Application database**

### Other components

- **Customer**
- **Admin staff**
- **S3 or local files**

## Connections

- Customer → Client router: opens
- Client router → Logo intro: renders
- Client router → Menu page: routes to
- Menu page → Menu browsing UI: renders
- Menu page → Menu service: loads menu
- Menu browsing UI → Category navigation: tracks sections
- Menu service → API client: uses
- Admin staff → Admin pages: manages menu
- Admin pages → Admin auth state: uses
- Admin pages → API client: requests
- API client → Express app: HTTP requests
- Express app → Menu routes: mounts
- Express app → Admin menu routes: mounts
- Express app → Auth routes: mounts
- Express app → Staff routes: mounts
- Express app → Audit routes: mounts
- Express app → Image upload route: mounts
- Express app → Status routes: mounts
- Menu routes → Menu controller: dispatches
- Admin menu routes → Admin menu controller: dispatches
- Auth routes → Authentication: dispatches
- Staff routes → Staff management: dispatches
- Authentication → Password service: verifies password
- Menu controller → Menu mapping: gets menu
- Menu mapping → Prisma client: queries
- Admin menu controller → Prisma client: reads and writes
- Authentication → Prisma client: reads and writes
- Staff management → Prisma client: reads and writes
- Prisma client → Application database: accesses
- Image upload route → Image storage: stores image
- Image storage → S3 or local files: writes file
