# nikeshjainj007-dev/ofds architecture

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

- Interactive diagram: https://gitdiagram.com/nikeshjainj007-dev/ofds
- Repository: https://github.com/nikeshjainj007-dev/ofds

## Overview

CampusCanteen is a campus food-ordering web app with customer ordering and an operational dashboard. The main journey is browsing campus dishes, adding items and delivery details, paying, then viewing order history or tracking; staff manage orders, menu, riders and related operations. The app also includes authentication, feedback and complaints. Several connections are supported by the source index rather than full excerpts; where unsampled modules leave behavior unclear, the graph omits speculative links.

Main entry points: [`src/App.tsx`](https://github.com/nikeshjainj007-dev/ofds/blob/main/src/App.tsx) (App shell), [`src/context/CartContext.tsx`](https://github.com/nikeshjainj007-dev/ofds/blob/main/src/context/CartContext.tsx) (Cart and orders), [`src/components/dashboard/DashboardModal.tsx`](https://github.com/nikeshjainj007-dev/ofds/blob/main/src/components/dashboard/DashboardModal.tsx) (Dashboard sections), [`src/context/AuthContext.tsx`](https://github.com/nikeshjainj007-dev/ofds/blob/main/src/context/AuthContext.tsx) (Authentication state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_app["App shell<br/>[App.tsx]"]
end

subgraph group_customer["Customer Ordering"]
  node_catalog["Catalog data<br/>[mockData.ts]"]
  node_browse["Browse menu<br/>[RestaurantList.tsx]"]
  node_filters["Category filters<br/>[CategoryFilter.tsx]"]
  node_dish["Dish selection<br/>[DishCard.tsx]"]
  node_cartui["Cart and checkout<br/>[CartDrawer.tsx]"]
  node_history["Order history"]
  node_tracking["Order tracking"]
  node_authui["Sign-in and profile<br/>[AuthModal.tsx]"]
end

subgraph group_operations["Canteen Operations"]
  node_dashboard["Dashboard state"]
  node_dashboarddata["Operations seed data"]
  node_dashboardui["Dashboard sections<br/>[DashboardModal.tsx]"]
  node_complaints["Complaints<br/>[ComplaintsTab.tsx]"]
  node_feedback["Feedback<br/>[FeedbackModal.tsx]"]
end

subgraph group_services["State And Services"]
  node_cart["Cart and orders<br/>[CartContext.tsx]"]
  node_payment["Razorpay payment<br/>[razorpay.ts]"]
  node_auth["Authentication state<br/>[AuthContext.tsx]"]
  node_supabase["Supabase client<br/>[supabaseClient.ts]"]
  node_otp["OTP endpoints<br/>[send-otp.js]"]
  node_storage[("Browser storage<br/>[storage.ts]")]
  node_schedule["Campus ordering schedule<br/>[campusSchedule.ts]"]
  node_toast["Toast notifications<br/>[ToastContext.tsx]"]
end

node_user(("Campus customer"))
node_razorpay(("Razorpay"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_browse
node_app -->|"renders"| node_filters
node_app -->|"renders"| node_dish
node_app -->|"renders"| node_cartui
node_app -->|"renders"| node_authui
node_app -->|"renders"| node_tracking
node_app -->|"renders"| node_history
node_app -->|"renders"| node_dashboardui
node_browse -->|"reads"| node_catalog
node_filters -->|"reads"| node_catalog
node_dish -->|"adds items"| node_cart
node_dish -->|"checks timing"| node_schedule
node_cartui -->|"reads and updates"| node_cart
node_cartui -->|"initiates"| node_payment
node_payment -.->|"processes payment"| node_razorpay
node_cart -->|"persists cart"| node_storage
node_cart -->|"loads coupons"| node_catalog
node_history -->|"reads orders"| node_cart
node_tracking -->|"reads order state"| node_cart
node_authui -->|"uses"| node_auth
node_auth -->|"authenticates"| node_supabase
node_auth -->|"persists profile"| node_storage
node_auth -->|"requests codes"| node_otp
node_dashboardui -->|"uses state"| node_dashboard
node_dashboardui -->|"renders"| node_complaints
node_dashboardui -->|"renders"| node_feedback
node_dashboard -->|"persists operations"| node_storage
node_dashboard -->|"loads initial data"| node_dashboarddata
node_dashboarddata -->|"seeds dishes"| node_catalog

click node_app "https://github.com/nikeshjainj007-dev/ofds/blob/main/src/App.tsx"
click node_catalog "https://github.com/nikeshjainj007-dev/ofds/blob/main/src/data/mockData.ts"
click node_browse "https://github.com/nikeshjainj007-dev/ofds/blob/main/src/components/RestaurantList.tsx"
click node_filters "https://github.com/nikeshjainj007-dev/ofds/blob/main/src/components/CategoryFilter.tsx"
click node_dish "https://github.com/nikeshjainj007-dev/ofds/blob/main/src/components/DishCard.tsx"
click node_cartui "https://github.com/nikeshjainj007-dev/ofds/blob/main/src/components/CartDrawer.tsx"
click node_cart "https://github.com/nikeshjainj007-dev/ofds/blob/main/src/context/CartContext.tsx"
click node_payment "https://github.com/nikeshjainj007-dev/ofds/blob/main/src/lib/razorpay.ts"
click node_history "https://github.com/nikeshjainj007-dev/ofds/blob/main/src/components/OrderHistoryModal.tsx"
click node_tracking "https://github.com/nikeshjainj007-dev/ofds/blob/main/src/components/OrderTrackingModal.tsx"
click node_authui "https://github.com/nikeshjainj007-dev/ofds/blob/main/src/components/AuthModal.tsx"
click node_auth "https://github.com/nikeshjainj007-dev/ofds/blob/main/src/context/AuthContext.tsx"
click node_supabase "https://github.com/nikeshjainj007-dev/ofds/blob/main/src/lib/supabaseClient.ts"
click node_otp "https://github.com/nikeshjainj007-dev/ofds/blob/main/api/send-otp.js"
click node_storage "https://github.com/nikeshjainj007-dev/ofds/blob/main/src/lib/storage.ts"
click node_schedule "https://github.com/nikeshjainj007-dev/ofds/blob/main/src/lib/campusSchedule.ts"
click node_dashboard "https://github.com/nikeshjainj007-dev/ofds/blob/main/src/context/DashboardContext.tsx"
click node_dashboarddata "https://github.com/nikeshjainj007-dev/ofds/blob/main/src/data/dashboardMockData.ts"
click node_dashboardui "https://github.com/nikeshjainj007-dev/ofds/blob/main/src/components/dashboard/DashboardModal.tsx"
click node_complaints "https://github.com/nikeshjainj007-dev/ofds/blob/main/src/components/dashboard/ComplaintsTab.tsx"
click node_feedback "https://github.com/nikeshjainj007-dev/ofds/blob/main/src/components/FeedbackModal.tsx"
click node_toast "https://github.com/nikeshjainj007-dev/ofds/blob/main/src/context/ToastContext.tsx"

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 toneBlue
class node_catalog,node_browse,node_filters,node_dish,node_cartui,node_history,node_tracking,node_authui toneAmber
class node_dashboard,node_dashboarddata,node_dashboardui,node_complaints,node_feedback toneMint
class node_cart,node_payment,node_auth,node_supabase,node_otp,node_storage,node_schedule,node_toast toneRose
class node_user,node_razorpay toneIndigo
```

## Components

### Application

- [App shell](https://github.com/nikeshjainj007-dev/ofds/blob/main/src/App.tsx): `src/App.tsx`

### Customer Ordering

- [Catalog data](https://github.com/nikeshjainj007-dev/ofds/blob/main/src/data/mockData.ts): `src/data/mockData.ts`
- [Browse menu](https://github.com/nikeshjainj007-dev/ofds/blob/main/src/components/RestaurantList.tsx): `src/components/RestaurantList.tsx`
- [Category filters](https://github.com/nikeshjainj007-dev/ofds/blob/main/src/components/CategoryFilter.tsx): `src/components/CategoryFilter.tsx`
- [Dish selection](https://github.com/nikeshjainj007-dev/ofds/blob/main/src/components/DishCard.tsx): `src/components/DishCard.tsx`
- [Cart and checkout](https://github.com/nikeshjainj007-dev/ofds/blob/main/src/components/CartDrawer.tsx): `src/components/CartDrawer.tsx`
- [Order history](https://github.com/nikeshjainj007-dev/ofds/blob/main/src/components/OrderHistoryModal.tsx): `src/components/OrderHistoryModal.tsx`
- [Order tracking](https://github.com/nikeshjainj007-dev/ofds/blob/main/src/components/OrderTrackingModal.tsx): `src/components/OrderTrackingModal.tsx`
- [Sign-in and profile](https://github.com/nikeshjainj007-dev/ofds/blob/main/src/components/AuthModal.tsx): `src/components/AuthModal.tsx`

### Canteen Operations

- [Dashboard state](https://github.com/nikeshjainj007-dev/ofds/blob/main/src/context/DashboardContext.tsx): `src/context/DashboardContext.tsx`
- [Operations seed data](https://github.com/nikeshjainj007-dev/ofds/blob/main/src/data/dashboardMockData.ts): `src/data/dashboardMockData.ts`
- [Dashboard sections](https://github.com/nikeshjainj007-dev/ofds/blob/main/src/components/dashboard/DashboardModal.tsx): `src/components/dashboard/DashboardModal.tsx`
- [Complaints](https://github.com/nikeshjainj007-dev/ofds/blob/main/src/components/dashboard/ComplaintsTab.tsx): `src/components/dashboard/ComplaintsTab.tsx`
- [Feedback](https://github.com/nikeshjainj007-dev/ofds/blob/main/src/components/FeedbackModal.tsx): `src/components/FeedbackModal.tsx`

### State And Services

- [Cart and orders](https://github.com/nikeshjainj007-dev/ofds/blob/main/src/context/CartContext.tsx): `src/context/CartContext.tsx`
- [Razorpay payment](https://github.com/nikeshjainj007-dev/ofds/blob/main/src/lib/razorpay.ts): `src/lib/razorpay.ts`
- [Authentication state](https://github.com/nikeshjainj007-dev/ofds/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [Supabase client](https://github.com/nikeshjainj007-dev/ofds/blob/main/src/lib/supabaseClient.ts): `src/lib/supabaseClient.ts`
- [OTP endpoints](https://github.com/nikeshjainj007-dev/ofds/blob/main/api/send-otp.js): `api/send-otp.js`
- [Browser storage](https://github.com/nikeshjainj007-dev/ofds/blob/main/src/lib/storage.ts): `src/lib/storage.ts`
- [Campus ordering schedule](https://github.com/nikeshjainj007-dev/ofds/blob/main/src/lib/campusSchedule.ts): `src/lib/campusSchedule.ts`
- [Toast notifications](https://github.com/nikeshjainj007-dev/ofds/blob/main/src/context/ToastContext.tsx): `src/context/ToastContext.tsx`

### Other components

- **Campus customer**
- **Razorpay**

## Connections

- Campus customer → App shell: uses
- App shell → Browse menu: renders (evidence: `src/App.tsx`)
- App shell → Category filters: renders (evidence: `src/App.tsx`)
- App shell → Dish selection: renders (evidence: `src/App.tsx`)
- App shell → Cart and checkout: renders (evidence: `src/App.tsx`)
- App shell → Sign-in and profile: renders (evidence: `src/App.tsx`)
- App shell → Order tracking: renders (evidence: `src/App.tsx`)
- App shell → Order history: renders (evidence: `src/App.tsx`)
- App shell → Dashboard sections: renders (evidence: `src/App.tsx`)
- Browse menu → Catalog data: reads (evidence: `src/components/RestaurantList.tsx`)
- Category filters → Catalog data: reads (evidence: `src/components/CategoryFilter.tsx`)
- Dish selection → Cart and orders: adds items (evidence: `src/components/DishCard.tsx`)
- Dish selection → Campus ordering schedule: checks timing (evidence: `src/components/DishCard.tsx`)
- Cart and checkout → Cart and orders: reads and updates (evidence: `src/components/CartDrawer.tsx`)
- Cart and checkout → Razorpay payment: initiates (evidence: `src/components/CartDrawer.tsx`)
- Razorpay payment → Razorpay: processes payment
- Cart and orders → Browser storage: persists cart (evidence: `src/context/CartContext.tsx`)
- Cart and orders → Catalog data: loads coupons (evidence: `src/context/CartContext.tsx`)
- Order history → Cart and orders: reads orders (evidence: `src/components/OrderHistoryModal.tsx`)
- Order tracking → Cart and orders: reads order state (evidence: `src/components/OrderTrackingModal.tsx`)
- Sign-in and profile → Authentication state: uses (evidence: `src/components/AuthModal.tsx`)
- Authentication state → Supabase client: authenticates (evidence: `src/context/AuthContext.tsx`)
- Authentication state → Browser storage: persists profile (evidence: `src/context/AuthContext.tsx`)
- Authentication state → OTP endpoints: requests codes (evidence: `src/context/AuthContext.tsx`)
- Dashboard sections → Dashboard state: uses state (evidence: `src/components/dashboard/DashboardModal.tsx`)
- Dashboard sections → Complaints: renders (evidence: `src/components/dashboard/DashboardModal.tsx`)
- Dashboard sections → Feedback: renders (evidence: `src/components/dashboard/DashboardModal.tsx`)
- Dashboard state → Browser storage: persists operations (evidence: `src/context/DashboardContext.tsx`)
- Dashboard state → Operations seed data: loads initial data (evidence: `src/context/DashboardContext.tsx`)
- Operations seed data → Catalog data: seeds dishes (evidence: `src/data/dashboardMockData.ts`)
