# abhinavj2705/-stockify-restaurant-inventory architecture

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

- Interactive diagram: https://gitdiagram.com/abhinavj2705/-stockify-restaurant-inventory
- Repository: https://github.com/abhinavj2705/-stockify-restaurant-inventory

## Overview

Stockify is a restaurant inventory management system. Staff and administrators use the React application to sign in and operate a dashboard; its product, category, warehouse, stock-movement, and team workflows are served by Express routes backed by Prisma. The README also documents vendor details, inventory metrics, warehouse filtering, and product audit history. Sampled sources establish route registration and several route-to-database calls; dashboard API calls and the unsampled warehouse route are not shown, so those relationships are omitted or marked unverified.

Main entry points: [`backend/src/server.ts`](https://github.com/abhinavj2705/-stockify-restaurant-inventory/blob/main/backend/src/server.ts) (Express API), [`backend/src/lib/prisma.ts`](https://github.com/abhinavj2705/-stockify-restaurant-inventory/blob/main/backend/src/lib/prisma.ts) (Prisma client), [`backend/src/middleware/auth.ts`](https://github.com/abhinavj2705/-stockify-restaurant-inventory/blob/main/backend/src/middleware/auth.ts) (JWT authorization), [`frontend/src/App.tsx`](https://github.com/abhinavj2705/-stockify-restaurant-inventory/blob/main/frontend/src/App.tsx) (App routing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Operations UI"]
  node_app["App routing<br/>[App.tsx]"]
  node_login["Sign-in<br/>[Login.tsx]"]
  node_dashboard["Operations dashboard<br/>[Dashboard.tsx]"]
end

subgraph group_api["API workflows"]
  node_server["Express API<br/>[server.ts]"]
  node_products["Products and metrics<br/>[products.ts]"]
  node_categories["Categories<br/>[categories.ts]"]
  node_stock["Stock movements<br/>[stock.ts]"]
  node_warehouses["Warehouses<br/>[warehouses.ts]"]
  node_users["Team access<br/>[users.ts]"]
  node_errors["Error responses<br/>[errorHandler.ts]"]
end

subgraph group_identity["Identity and access"]
  node_authroute["Authentication<br/>[auth.ts]"]
  node_authmw["JWT authorization<br/>[auth.ts]"]
end

subgraph group_data["Persistence"]
  node_prisma["Prisma client<br/>[prisma.ts]"]
  node_sqlite[("Inventory database<br/>[schema.prisma]")]
  node_firebase["Firebase configuration<br/>[firebase.ts]"]
end

node_staff(("Restaurant staff"))

node_staff -->|"uses"| node_app
node_app -->|"routes to"| node_login
node_app -->|"protects"| node_dashboard
node_login -.->|"signs in"| node_server
node_dashboard -.->|"requests data"| node_server
node_server -->|"mounts"| node_authroute
node_server -->|"mounts"| node_products
node_server -->|"mounts"| node_categories
node_server -->|"mounts"| node_stock
node_server -->|"mounts"| node_warehouses
node_server -->|"mounts"| node_users
node_server -->|"installs"| node_errors
node_authroute -->|"reads and writes"| node_prisma
node_authroute -->|"authenticates"| node_authmw
node_products -->|"authorizes"| node_authmw
node_categories -->|"authorizes"| node_authmw
node_stock -->|"authenticates"| node_authmw
node_users -->|"authorizes"| node_authmw
node_products -->|"queries inventory"| node_prisma
node_categories -->|"queries categories"| node_prisma
node_stock -->|"updates stock"| node_prisma
node_users -->|"manages users"| node_prisma
node_prisma -.->|"persists records"| node_sqlite

click node_app "https://github.com/abhinavj2705/-stockify-restaurant-inventory/blob/main/frontend/src/App.tsx"
click node_login "https://github.com/abhinavj2705/-stockify-restaurant-inventory/blob/main/frontend/src/pages/Login.tsx"
click node_dashboard "https://github.com/abhinavj2705/-stockify-restaurant-inventory/blob/main/frontend/src/pages/Dashboard.tsx"
click node_server "https://github.com/abhinavj2705/-stockify-restaurant-inventory/blob/main/backend/src/server.ts"
click node_authroute "https://github.com/abhinavj2705/-stockify-restaurant-inventory/blob/main/backend/src/routes/auth.ts"
click node_authmw "https://github.com/abhinavj2705/-stockify-restaurant-inventory/blob/main/backend/src/middleware/auth.ts"
click node_products "https://github.com/abhinavj2705/-stockify-restaurant-inventory/blob/main/backend/src/routes/products.ts"
click node_categories "https://github.com/abhinavj2705/-stockify-restaurant-inventory/blob/main/backend/src/routes/categories.ts"
click node_stock "https://github.com/abhinavj2705/-stockify-restaurant-inventory/blob/main/backend/src/routes/stock.ts"
click node_warehouses "https://github.com/abhinavj2705/-stockify-restaurant-inventory/blob/main/backend/src/routes/warehouses.ts"
click node_users "https://github.com/abhinavj2705/-stockify-restaurant-inventory/blob/main/backend/src/routes/users.ts"
click node_errors "https://github.com/abhinavj2705/-stockify-restaurant-inventory/blob/main/backend/src/middleware/errorHandler.ts"
click node_prisma "https://github.com/abhinavj2705/-stockify-restaurant-inventory/blob/main/backend/src/lib/prisma.ts"
click node_sqlite "https://github.com/abhinavj2705/-stockify-restaurant-inventory/blob/main/backend/prisma/schema.prisma"
click node_firebase "https://github.com/abhinavj2705/-stockify-restaurant-inventory/blob/main/backend/src/lib/firebase.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_login,node_dashboard toneBlue
class node_server,node_products,node_categories,node_stock,node_warehouses,node_users,node_errors toneAmber
class node_authroute,node_authmw toneMint
class node_prisma,node_sqlite,node_firebase toneRose
class node_staff toneIndigo
```

## Components

### Operations UI

- [App routing](https://github.com/abhinavj2705/-stockify-restaurant-inventory/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Sign-in](https://github.com/abhinavj2705/-stockify-restaurant-inventory/blob/main/frontend/src/pages/Login.tsx): `frontend/src/pages/Login.tsx`
- [Operations dashboard](https://github.com/abhinavj2705/-stockify-restaurant-inventory/blob/main/frontend/src/pages/Dashboard.tsx): `frontend/src/pages/Dashboard.tsx`

### API workflows

- [Express API](https://github.com/abhinavj2705/-stockify-restaurant-inventory/blob/main/backend/src/server.ts): `backend/src/server.ts`
- [Products and metrics](https://github.com/abhinavj2705/-stockify-restaurant-inventory/blob/main/backend/src/routes/products.ts): `backend/src/routes/products.ts`
- [Categories](https://github.com/abhinavj2705/-stockify-restaurant-inventory/blob/main/backend/src/routes/categories.ts): `backend/src/routes/categories.ts`
- [Stock movements](https://github.com/abhinavj2705/-stockify-restaurant-inventory/blob/main/backend/src/routes/stock.ts): `backend/src/routes/stock.ts`
- [Warehouses](https://github.com/abhinavj2705/-stockify-restaurant-inventory/blob/main/backend/src/routes/warehouses.ts): `backend/src/routes/warehouses.ts`
- [Team access](https://github.com/abhinavj2705/-stockify-restaurant-inventory/blob/main/backend/src/routes/users.ts): `backend/src/routes/users.ts`
- [Error responses](https://github.com/abhinavj2705/-stockify-restaurant-inventory/blob/main/backend/src/middleware/errorHandler.ts): `backend/src/middleware/errorHandler.ts`

### Identity and access

- [Authentication](https://github.com/abhinavj2705/-stockify-restaurant-inventory/blob/main/backend/src/routes/auth.ts): `backend/src/routes/auth.ts`
- [JWT authorization](https://github.com/abhinavj2705/-stockify-restaurant-inventory/blob/main/backend/src/middleware/auth.ts): `backend/src/middleware/auth.ts`

### Persistence

- [Prisma client](https://github.com/abhinavj2705/-stockify-restaurant-inventory/blob/main/backend/src/lib/prisma.ts): `backend/src/lib/prisma.ts`
- [Inventory database](https://github.com/abhinavj2705/-stockify-restaurant-inventory/blob/main/backend/prisma/schema.prisma): `backend/prisma/schema.prisma`
- [Firebase configuration](https://github.com/abhinavj2705/-stockify-restaurant-inventory/blob/main/backend/src/lib/firebase.ts): `backend/src/lib/firebase.ts`

### Other components

- **Restaurant staff**

## Connections

- Restaurant staff → App routing: uses (evidence: `README.md`)
- App routing → Sign-in: routes to (evidence: `frontend/src/App.tsx`)
- App routing → Operations dashboard: protects (evidence: `frontend/src/App.tsx`)
- Sign-in → Express API: signs in
- Operations dashboard → Express API: requests data
- Express API → Authentication: mounts (evidence: `backend/src/server.ts`)
- Express API → Products and metrics: mounts (evidence: `backend/src/server.ts`)
- Express API → Categories: mounts (evidence: `backend/src/server.ts`)
- Express API → Stock movements: mounts (evidence: `backend/src/server.ts`)
- Express API → Warehouses: mounts (evidence: `backend/src/server.ts`)
- Express API → Team access: mounts (evidence: `backend/src/server.ts`)
- Express API → Error responses: installs (evidence: `backend/src/server.ts`)
- Authentication → Prisma client: reads and writes (evidence: `backend/src/routes/auth.ts`)
- Authentication → JWT authorization: authenticates (evidence: `backend/src/routes/auth.ts`)
- Products and metrics → JWT authorization: authorizes (evidence: `backend/src/routes/products.ts`)
- Categories → JWT authorization: authorizes (evidence: `backend/src/routes/categories.ts`)
- Stock movements → JWT authorization: authenticates (evidence: `backend/src/routes/stock.ts`)
- Team access → JWT authorization: authorizes (evidence: `backend/src/routes/users.ts`)
- Products and metrics → Prisma client: queries inventory (evidence: `backend/src/routes/products.ts`)
- Categories → Prisma client: queries categories (evidence: `backend/src/routes/categories.ts`)
- Stock movements → Prisma client: updates stock (evidence: `backend/src/routes/stock.ts`)
- Team access → Prisma client: manages users (evidence: `backend/src/routes/users.ts`)
- Prisma client → Inventory database: persists records
