# anilchowdary4531/cafe-system architecture

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

- Interactive diagram: https://gitdiagram.com/anilchowdary4531/cafe-system
- Repository: https://github.com/anilchowdary4531/cafe-system

## Overview

Tiffzy is a cafe operations and ordering platform with a React web app, an Android customer app, and a Fastify/Prisma backend. Customers authenticate, discover restaurants and menus, place and pay for orders, then track them; staff and owners use operational screens for orders, kitchen, tables, inventory, and supply management. The backend also supports reporting, notifications, and asset uploads. The graph combines documented capabilities with indexed imports and excerpted calls; unsampled feature internals and many frontend-to-API links are intentionally not inferred.

Main entry points: [`backend/src/services/storageService.js`](https://github.com/anilchowdary4531/cafe-system/blob/main/backend/src/services/storageService.js) (Asset storage routing), [`backend/src/server.js`](https://github.com/anilchowdary4531/cafe-system/blob/main/backend/src/server.js) (API server), [`app/src/main/java/com/tiffzy/app/data/repository/AuthRepository.kt`](https://github.com/anilchowdary4531/cafe-system/blob/main/app/src/main/java/com/tiffzy/app/data/repository/AuthRepository.kt) (Auth repository), [`frontend/src/App.jsx`](https://github.com/anilchowdary4531/cafe-system/blob/main/frontend/src/App.jsx) (Web route app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mobile["Android app"]
  node_mobileapp["Android entry<br/>[MainActivity.kt]"]
  node_mobilenav["Mobile navigation<br/>[NavGraph.kt]"]
  node_mobileauth["Mobile authentication<br/>[AuthViewModel.kt]"]
  node_mobileauthrepo["Auth repository<br/>[AuthRepository.kt]"]
  node_mobileapi["Android API client<br/>[ApiService.kt]"]
  node_authstore[("Auth persistence<br/>[AuthDataStore.kt]")]
  node_mobilepush["Push notifications"]
end

subgraph group_web["Web experiences"]
  node_webapp["Web route app<br/>[App.jsx]"]
  node_webcustomer["Customer ordering<br/>[MenuPage.jsx]"]
  node_weblogin["Web sign-in<br/>[Login.jsx]"]
  node_authcontext["Web auth state<br/>[AuthContext.jsx]"]
  node_staffsession[("Staff session storage")]
  node_apiclient["Web API client<br/>[apiClient.js]"]
  node_ownerops["Owner operations<br/>[MenuStudio.jsx]"]
  node_kitchen["Kitchen live board"]
  node_tables["Table operations<br/>[OwnerTables.jsx]"]
  node_serverstaff["Server workflow<br/>[Server.jsx]"]
end

subgraph group_api["Backend services"]
  node_backend["API server<br/>[server.js]"]
  node_routes["API routes<br/>[index.js]"]
  node_customer_auth["Customer auth"]
  node_payments["Payment processing"]
end

subgraph group_ops["Operations domains"]
  node_supplyroutes["Supply marketplace"]
  node_recipes["Recipe management<br/>[recipeService.js]"]
  node_reports["Reporting<br/>[report.routes.js]"]
  node_reportservice["Report generation<br/>[reportService.js]"]
end

subgraph group_infra["Persistence and integrations"]
  node_storage["Asset storage routing<br/>[storageService.js]"]
  node_s3["S3 asset storage<br/>[s3Service.js]"]
  node_localstorage["Local asset storage"]
  node_database[("Prisma database")]
  node_cashfree["Cashfree payments"]
end

node_customer(("Customer"))
node_apiuser(("Web / mobile clients"))

node_customer -->|"uses"| node_mobileapp
node_mobileapp -->|"loads settings"| node_authstore
node_mobileapp -->|"starts navigation"| node_mobilenav
node_mobilenav -->|"routes auth"| node_mobileauth
node_mobileauth -.->|"delegates auth"| node_mobileauthrepo
node_mobileauthrepo -->|"calls"| node_mobileapi
node_mobileauthrepo -->|"persists credentials"| node_authstore
node_mobileauthrepo -->|"configures client"| node_mobileapi
node_mobilepush -->|"registers token"| node_mobileapi
node_apiuser -->|"opens"| node_webapp
node_webapp -->|"routes to"| node_weblogin
node_webapp -->|"routes to"| node_serverstaff
node_webapp -->|"routes to"| node_ownerops
node_weblogin -.->|"uses auth"| node_authcontext
node_authcontext -->|"reads and writes"| node_staffsession
node_apiclient -->|"reads session"| node_staffsession
node_apiclient -.->|"sends API requests"| node_backend
node_mobileapi -.->|"requests API"| node_backend
node_backend -->|"registers routes"| node_routes
node_backend -->|"initializes Prisma"| node_database
node_backend -->|"configures uploads"| node_storage
node_routes -.->|"routes auth"| node_customer_auth
node_payments -->|"processes payments"| node_cashfree
node_supplyroutes -->|"upserts recipes"| node_recipes
node_reports -->|"uses reports"| node_reportservice
node_storage -->|"selects S3"| node_s3
node_storage -->|"selects local"| node_localstorage
node_storage -->|"uploads and deletes"| node_s3
node_storage -->|"uploads and deletes"| node_localstorage

click node_mobileapp "https://github.com/anilchowdary4531/cafe-system/blob/main/app/src/main/java/com/tiffzy/app/MainActivity.kt"
click node_mobilenav "https://github.com/anilchowdary4531/cafe-system/blob/main/app/src/main/java/com/tiffzy/app/navigation/NavGraph.kt"
click node_mobileauth "https://github.com/anilchowdary4531/cafe-system/blob/main/app/src/main/java/com/tiffzy/app/ui/auth/AuthViewModel.kt"
click node_mobileauthrepo "https://github.com/anilchowdary4531/cafe-system/blob/main/app/src/main/java/com/tiffzy/app/data/repository/AuthRepository.kt"
click node_mobileapi "https://github.com/anilchowdary4531/cafe-system/blob/main/app/src/main/java/com/tiffzy/app/data/remote/ApiService.kt"
click node_authstore "https://github.com/anilchowdary4531/cafe-system/blob/main/app/src/main/java/com/tiffzy/app/data/local/AuthDataStore.kt"
click node_mobilepush "https://github.com/anilchowdary4531/cafe-system/blob/main/app/src/main/java/com/tiffzy/app/service/TiffzyMessagingService.kt"
click node_webapp "https://github.com/anilchowdary4531/cafe-system/blob/main/frontend/src/App.jsx"
click node_webcustomer "https://github.com/anilchowdary4531/cafe-system/blob/main/frontend/src/pages/customer/MenuPage.jsx"
click node_weblogin "https://github.com/anilchowdary4531/cafe-system/blob/main/frontend/src/pages/Login.jsx"
click node_authcontext "https://github.com/anilchowdary4531/cafe-system/blob/main/frontend/src/context/AuthContext.jsx"
click node_staffsession "https://github.com/anilchowdary4531/cafe-system/blob/main/frontend/src/utils/staffSessionStorage.js"
click node_apiclient "https://github.com/anilchowdary4531/cafe-system/blob/main/frontend/src/utils/apiClient.js"
click node_ownerops "https://github.com/anilchowdary4531/cafe-system/blob/main/frontend/src/pages/admin/MenuStudio.jsx"
click node_kitchen "https://github.com/anilchowdary4531/cafe-system/blob/main/frontend/src/pages/admin/OwnerKitchenLive.jsx"
click node_tables "https://github.com/anilchowdary4531/cafe-system/blob/main/frontend/src/pages/admin/OwnerTables.jsx"
click node_serverstaff "https://github.com/anilchowdary4531/cafe-system/blob/main/frontend/src/pages/Server.jsx"
click node_backend "https://github.com/anilchowdary4531/cafe-system/blob/main/backend/src/server.js"
click node_routes "https://github.com/anilchowdary4531/cafe-system/blob/main/backend/src/routes/index.js"
click node_customer_auth "https://github.com/anilchowdary4531/cafe-system/blob/main/backend/src/controllers/customerAuthController.js"
click node_payments "https://github.com/anilchowdary4531/cafe-system/blob/main/backend/src/controllers/payment.controller.js"
click node_supplyroutes "https://github.com/anilchowdary4531/cafe-system/blob/main/backend/src/routes/supplyMarketplace.routes.js"
click node_recipes "https://github.com/anilchowdary4531/cafe-system/blob/main/backend/src/services/recipeService.js"
click node_reports "https://github.com/anilchowdary4531/cafe-system/blob/main/backend/src/routes/report.routes.js"
click node_reportservice "https://github.com/anilchowdary4531/cafe-system/blob/main/backend/src/services/reportService.js"
click node_storage "https://github.com/anilchowdary4531/cafe-system/blob/main/backend/src/services/storageService.js"
click node_s3 "https://github.com/anilchowdary4531/cafe-system/blob/main/backend/src/services/s3Service.js"
click node_localstorage "https://github.com/anilchowdary4531/cafe-system/blob/main/backend/src/services/localStorageService.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_mobileapp,node_mobilenav,node_mobileauth,node_mobileauthrepo,node_mobileapi,node_authstore,node_mobilepush,node_apiuser toneBlue
class node_webapp,node_webcustomer,node_weblogin,node_authcontext,node_staffsession,node_apiclient,node_ownerops,node_kitchen,node_tables,node_serverstaff toneAmber
class node_backend,node_routes,node_customer_auth,node_payments toneMint
class node_supplyroutes,node_recipes,node_reports,node_reportservice toneRose
class node_storage,node_s3,node_localstorage,node_database,node_cashfree,node_customer toneIndigo
```

## Components

### Android app

- [Android entry](https://github.com/anilchowdary4531/cafe-system/blob/main/app/src/main/java/com/tiffzy/app/MainActivity.kt): `app/src/main/java/com/tiffzy/app/MainActivity.kt`
- [Mobile navigation](https://github.com/anilchowdary4531/cafe-system/blob/main/app/src/main/java/com/tiffzy/app/navigation/NavGraph.kt): `app/src/main/java/com/tiffzy/app/navigation/NavGraph.kt`
- [Mobile authentication](https://github.com/anilchowdary4531/cafe-system/blob/main/app/src/main/java/com/tiffzy/app/ui/auth/AuthViewModel.kt): `app/src/main/java/com/tiffzy/app/ui/auth/AuthViewModel.kt`
- [Auth repository](https://github.com/anilchowdary4531/cafe-system/blob/main/app/src/main/java/com/tiffzy/app/data/repository/AuthRepository.kt): `app/src/main/java/com/tiffzy/app/data/repository/AuthRepository.kt`
- [Android API client](https://github.com/anilchowdary4531/cafe-system/blob/main/app/src/main/java/com/tiffzy/app/data/remote/ApiService.kt): `app/src/main/java/com/tiffzy/app/data/remote/ApiService.kt`
- [Auth persistence](https://github.com/anilchowdary4531/cafe-system/blob/main/app/src/main/java/com/tiffzy/app/data/local/AuthDataStore.kt): `app/src/main/java/com/tiffzy/app/data/local/AuthDataStore.kt`
- [Push notifications](https://github.com/anilchowdary4531/cafe-system/blob/main/app/src/main/java/com/tiffzy/app/service/TiffzyMessagingService.kt): `app/src/main/java/com/tiffzy/app/service/TiffzyMessagingService.kt`

### Web experiences

- [Web route app](https://github.com/anilchowdary4531/cafe-system/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Customer ordering](https://github.com/anilchowdary4531/cafe-system/blob/main/frontend/src/pages/customer/MenuPage.jsx): `frontend/src/pages/customer/MenuPage.jsx`
- [Web sign-in](https://github.com/anilchowdary4531/cafe-system/blob/main/frontend/src/pages/Login.jsx): `frontend/src/pages/Login.jsx`
- [Web auth state](https://github.com/anilchowdary4531/cafe-system/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [Staff session storage](https://github.com/anilchowdary4531/cafe-system/blob/main/frontend/src/utils/staffSessionStorage.js): `frontend/src/utils/staffSessionStorage.js`
- [Web API client](https://github.com/anilchowdary4531/cafe-system/blob/main/frontend/src/utils/apiClient.js): `frontend/src/utils/apiClient.js`
- [Owner operations](https://github.com/anilchowdary4531/cafe-system/blob/main/frontend/src/pages/admin/MenuStudio.jsx): `frontend/src/pages/admin/MenuStudio.jsx`
- [Kitchen live board](https://github.com/anilchowdary4531/cafe-system/blob/main/frontend/src/pages/admin/OwnerKitchenLive.jsx): `frontend/src/pages/admin/OwnerKitchenLive.jsx`
- [Table operations](https://github.com/anilchowdary4531/cafe-system/blob/main/frontend/src/pages/admin/OwnerTables.jsx): `frontend/src/pages/admin/OwnerTables.jsx`
- [Server workflow](https://github.com/anilchowdary4531/cafe-system/blob/main/frontend/src/pages/Server.jsx): `frontend/src/pages/Server.jsx`

### Backend services

- [API server](https://github.com/anilchowdary4531/cafe-system/blob/main/backend/src/server.js): `backend/src/server.js`
- [API routes](https://github.com/anilchowdary4531/cafe-system/blob/main/backend/src/routes/index.js): `backend/src/routes/index.js`
- [Customer auth](https://github.com/anilchowdary4531/cafe-system/blob/main/backend/src/controllers/customerAuthController.js): `backend/src/controllers/customerAuthController.js`
- [Payment processing](https://github.com/anilchowdary4531/cafe-system/blob/main/backend/src/controllers/payment.controller.js): `backend/src/controllers/payment.controller.js`

### Operations domains

- [Supply marketplace](https://github.com/anilchowdary4531/cafe-system/blob/main/backend/src/routes/supplyMarketplace.routes.js): `backend/src/routes/supplyMarketplace.routes.js`
- [Recipe management](https://github.com/anilchowdary4531/cafe-system/blob/main/backend/src/services/recipeService.js): `backend/src/services/recipeService.js`
- [Reporting](https://github.com/anilchowdary4531/cafe-system/blob/main/backend/src/routes/report.routes.js): `backend/src/routes/report.routes.js`
- [Report generation](https://github.com/anilchowdary4531/cafe-system/blob/main/backend/src/services/reportService.js): `backend/src/services/reportService.js`

### Persistence and integrations

- [Asset storage routing](https://github.com/anilchowdary4531/cafe-system/blob/main/backend/src/services/storageService.js): `backend/src/services/storageService.js`
- [S3 asset storage](https://github.com/anilchowdary4531/cafe-system/blob/main/backend/src/services/s3Service.js): `backend/src/services/s3Service.js`
- [Local asset storage](https://github.com/anilchowdary4531/cafe-system/blob/main/backend/src/services/localStorageService.js): `backend/src/services/localStorageService.js`
- **Prisma database**
- **Cashfree payments**

### Other components

- **Customer**
- **Web / mobile clients**

## Connections

- Customer → Android entry: uses (evidence: `app/src/main/java/com/tiffzy/app/MainActivity.kt`)
- Android entry → Auth persistence: loads settings (evidence: `app/src/main/java/com/tiffzy/app/MainActivity.kt`)
- Android entry → Mobile navigation: starts navigation (evidence: `app/src/main/java/com/tiffzy/app/MainActivity.kt`)
- Mobile navigation → Mobile authentication: routes auth (evidence: `app/src/main/java/com/tiffzy/app/navigation/NavGraph.kt`)
- Mobile authentication → Auth repository: delegates auth
- Auth repository → Android API client: calls (evidence: `app/src/main/java/com/tiffzy/app/data/repository/AuthRepository.kt`)
- Auth repository → Auth persistence: persists credentials (evidence: `app/src/main/java/com/tiffzy/app/data/repository/AuthRepository.kt`)
- Auth repository → Android API client: configures client (evidence: `app/src/main/java/com/tiffzy/app/data/repository/AuthRepository.kt`)
- Push notifications → Android API client: registers token (evidence: `app/src/main/java/com/tiffzy/app/service/TiffzyMessagingService.kt`)
- Web / mobile clients → Web route app: opens (evidence: `frontend/src/App.jsx`)
- Web route app → Web sign-in: routes to (evidence: `frontend/src/App.jsx`)
- Web route app → Server workflow: routes to (evidence: `frontend/src/App.jsx`)
- Web route app → Owner operations: routes to (evidence: `frontend/src/App.jsx`)
- Web sign-in → Web auth state: uses auth
- Web auth state → Staff session storage: reads and writes (evidence: `frontend/src/context/AuthContext.jsx`)
- Web API client → Staff session storage: reads session (evidence: `frontend/src/utils/apiClient.js`)
- Web API client → API server: sends API requests (evidence: `README.md`)
- Android API client → API server: requests API (evidence: `README.md`)
- API server → API routes: registers routes (evidence: `backend/src/server.js`)
- API server → Prisma database: initializes Prisma (evidence: `backend/src/server.js`)
- API server → Asset storage routing: configures uploads (evidence: `backend/src/server.js`)
- API routes → Customer auth: routes auth
- Payment processing → Cashfree payments: processes payments (evidence: `backend/src/controllers/payment.controller.js`)
- Supply marketplace → Recipe management: upserts recipes (evidence: `backend/src/routes/supplyMarketplace.routes.js`)
- Reporting → Report generation: uses reports (evidence: `backend/src/routes/report.routes.js`)
- Asset storage routing → S3 asset storage: selects S3 (evidence: `backend/src/services/storageService.js`)
- Asset storage routing → Local asset storage: selects local (evidence: `backend/src/services/storageService.js`)
- Asset storage routing → S3 asset storage: uploads and deletes (evidence: `backend/src/services/storageService.js`)
- Asset storage routing → Local asset storage: uploads and deletes (evidence: `backend/src/services/storageService.js`)
