# jomo424947-arch/orderfast architecture

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

- Interactive diagram: https://gitdiagram.com/jomo424947-arch/orderfast
- Repository: https://github.com/jomo424947-arch/orderfast

## Overview

OrderFAST is a campus kiosk ordering platform, with student ordering and kiosk order handling as its central workflow. The repository includes a broad Next.js frontend and a Fastify API with domain services, PostgreSQL persistence, and Supabase authentication. The README describes the web frontend as the current phase and its services as mock-backed; backend capabilities are represented from the API tree and sampled route/service references. Some frontend and worker wiring is unsampled, so uncertain relationships are omitted.

Main entry points: [`apps/api/src/db/schema.ts`](https://github.com/jomo424947-arch/orderfast/blob/main/apps/api/src/db/schema.ts) (PostgreSQL data), [`apps/api/src/app.ts`](https://github.com/jomo424947-arch/orderfast/blob/main/apps/api/src/app.ts) (API route registration), [`apps/web/app`](https://github.com/jomo424947-arch/orderfast/tree/main/apps/web/app) (Web application), [`apps/api/src/modules/notifications/notification.service.ts`](https://github.com/jomo424947-arch/orderfast/blob/main/apps/api/src/modules/notifications/notification.service.ts) (Notifications)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web Experience"]
  node_webapp["Web application"]
  node_webservices["Web services"]
  node_webstate["Client state"]
end

subgraph group_identity["Identity &amp; Access"]
  node_authroutes["Auth routes<br/>[auth.routes.ts]"]
  node_authservice["Auth service<br/>[auth.service.ts]"]
  node_authguard["Auth middleware<br/>[auth.ts]"]
  node_supabase["Supabase Auth<br/>[index.ts]"]
end

subgraph group_commerce["Campus Commerce"]
  node_kioskroutes["Kiosk routes<br/>[kiosk.routes.ts]"]
  node_kioskservice["Kiosk service<br/>[kiosk.service.ts]"]
  node_catalogroutes["Catalog routes<br/>[catalog.routes.ts]"]
  node_catalogservice["Catalog service<br/>[catalog.service.ts]"]
  node_orderroutes["Order routes<br/>[order.routes.ts]"]
  node_orderservice["Order service<br/>[order.service.ts]"]
  node_feeservice["Service fees"]
end

subgraph group_engagement["Engagement &amp; Support"]
  node_leagueservice["League service<br/>[league.service.ts]"]
  node_notificationservice["Notifications"]
  node_marketingservice["Marketing campaigns"]
  node_supportservice["Support<br/>[support.service.ts]"]
end

subgraph group_platform["API &amp; Persistence"]
  node_database[("PostgreSQL data<br/>[schema.ts]")]
  node_approuter["API route registration<br/>[app.ts]"]
end

node_student(("Student"))
node_kioskstaff(("Kiosk staff"))
node_admin(("Administrator"))

node_student -->|"uses"| node_webapp
node_kioskstaff -->|"uses"| node_webapp
node_admin -->|"uses"| node_webapp
node_webapp -.->|"uses"| node_webservices
node_webservices -.->|"updates"| node_webstate
node_approuter -->|"registers"| node_authroutes
node_approuter -->|"registers"| node_kioskroutes
node_approuter -->|"registers"| node_catalogroutes
node_approuter -->|"registers"| node_orderroutes
node_approuter -.->|"registers routes"| node_notificationservice
node_authroutes -->|"calls"| node_authservice
node_authservice -->|"authenticates"| node_supabase
node_authroutes -->|"guards"| node_authguard
node_kioskroutes -->|"calls"| node_kioskservice
node_catalogroutes -->|"calls"| node_catalogservice
node_orderroutes -->|"calls"| node_orderservice
node_catalogservice -->|"reads/writes"| node_database
node_kioskservice -->|"reads/writes"| node_database
node_authservice -->|"reads/writes"| node_database
node_authguard -->|"verifies tokens"| node_supabase
node_orderroutes -->|"guards"| node_authguard
node_orderservice -.->|"reads/writes"| node_database
node_feeservice -.->|"reads/writes"| node_database
node_leagueservice -->|"reads/writes"| node_database
node_leagueservice -->|"sends push"| node_notificationservice
node_marketingservice -->|"reads/writes"| node_database
node_marketingservice -->|"sends push"| node_notificationservice
node_notificationservice -->|"reads/writes"| node_database
node_supportservice -.->|"persists"| node_database

click node_webapp "https://github.com/jomo424947-arch/orderfast/tree/main/apps/web/app"
click node_webservices "https://github.com/jomo424947-arch/orderfast/tree/main/apps/web/lib/services"
click node_webstate "https://github.com/jomo424947-arch/orderfast/tree/main/apps/web/stores"
click node_authroutes "https://github.com/jomo424947-arch/orderfast/blob/main/apps/api/src/modules/auth/auth.routes.ts"
click node_authservice "https://github.com/jomo424947-arch/orderfast/blob/main/apps/api/src/modules/auth/auth.service.ts"
click node_authguard "https://github.com/jomo424947-arch/orderfast/blob/main/apps/api/src/shared/middleware/auth.ts"
click node_supabase "https://github.com/jomo424947-arch/orderfast/blob/main/apps/api/src/shared/supabase/index.ts"
click node_kioskroutes "https://github.com/jomo424947-arch/orderfast/blob/main/apps/api/src/modules/kiosks/kiosk.routes.ts"
click node_kioskservice "https://github.com/jomo424947-arch/orderfast/blob/main/apps/api/src/modules/kiosks/kiosk.service.ts"
click node_catalogroutes "https://github.com/jomo424947-arch/orderfast/blob/main/apps/api/src/modules/catalog/catalog.routes.ts"
click node_catalogservice "https://github.com/jomo424947-arch/orderfast/blob/main/apps/api/src/modules/catalog/catalog.service.ts"
click node_orderroutes "https://github.com/jomo424947-arch/orderfast/blob/main/apps/api/src/modules/orders/order.routes.ts"
click node_orderservice "https://github.com/jomo424947-arch/orderfast/blob/main/apps/api/src/modules/orders/order.service.ts"
click node_feeservice "https://github.com/jomo424947-arch/orderfast/blob/main/apps/api/src/modules/orders/service-fee.service.ts"
click node_leagueservice "https://github.com/jomo424947-arch/orderfast/blob/main/apps/api/src/modules/league/league.service.ts"
click node_notificationservice "https://github.com/jomo424947-arch/orderfast/blob/main/apps/api/src/modules/notifications/notification.service.ts"
click node_marketingservice "https://github.com/jomo424947-arch/orderfast/blob/main/apps/api/src/modules/notifications/marketing.service.ts"
click node_supportservice "https://github.com/jomo424947-arch/orderfast/blob/main/apps/api/src/modules/support/support.service.ts"
click node_database "https://github.com/jomo424947-arch/orderfast/blob/main/apps/api/src/db/schema.ts"
click node_approuter "https://github.com/jomo424947-arch/orderfast/blob/main/apps/api/src/app.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_webapp,node_webservices,node_webstate toneBlue
class node_authroutes,node_authservice,node_authguard,node_supabase toneAmber
class node_kioskroutes,node_kioskservice,node_catalogroutes,node_catalogservice,node_orderroutes,node_orderservice,node_feeservice toneMint
class node_leagueservice,node_notificationservice,node_marketingservice,node_supportservice toneRose
class node_database,node_approuter,node_student,node_kioskstaff,node_admin toneIndigo
```

## Components

### Web Experience

- [Web application](https://github.com/jomo424947-arch/orderfast/tree/main/apps/web/app): `apps/web/app`
- [Web services](https://github.com/jomo424947-arch/orderfast/tree/main/apps/web/lib/services): `apps/web/lib/services`
- [Client state](https://github.com/jomo424947-arch/orderfast/tree/main/apps/web/stores): `apps/web/stores`

### Identity & Access

- [Auth routes](https://github.com/jomo424947-arch/orderfast/blob/main/apps/api/src/modules/auth/auth.routes.ts): `apps/api/src/modules/auth/auth.routes.ts`
- [Auth service](https://github.com/jomo424947-arch/orderfast/blob/main/apps/api/src/modules/auth/auth.service.ts): `apps/api/src/modules/auth/auth.service.ts`
- [Auth middleware](https://github.com/jomo424947-arch/orderfast/blob/main/apps/api/src/shared/middleware/auth.ts): `apps/api/src/shared/middleware/auth.ts`
- [Supabase Auth](https://github.com/jomo424947-arch/orderfast/blob/main/apps/api/src/shared/supabase/index.ts): `apps/api/src/shared/supabase/index.ts`

### Campus Commerce

- [Kiosk routes](https://github.com/jomo424947-arch/orderfast/blob/main/apps/api/src/modules/kiosks/kiosk.routes.ts): `apps/api/src/modules/kiosks/kiosk.routes.ts`
- [Kiosk service](https://github.com/jomo424947-arch/orderfast/blob/main/apps/api/src/modules/kiosks/kiosk.service.ts): `apps/api/src/modules/kiosks/kiosk.service.ts`
- [Catalog routes](https://github.com/jomo424947-arch/orderfast/blob/main/apps/api/src/modules/catalog/catalog.routes.ts): `apps/api/src/modules/catalog/catalog.routes.ts`
- [Catalog service](https://github.com/jomo424947-arch/orderfast/blob/main/apps/api/src/modules/catalog/catalog.service.ts): `apps/api/src/modules/catalog/catalog.service.ts`
- [Order routes](https://github.com/jomo424947-arch/orderfast/blob/main/apps/api/src/modules/orders/order.routes.ts): `apps/api/src/modules/orders/order.routes.ts`
- [Order service](https://github.com/jomo424947-arch/orderfast/blob/main/apps/api/src/modules/orders/order.service.ts): `apps/api/src/modules/orders/order.service.ts`
- [Service fees](https://github.com/jomo424947-arch/orderfast/blob/main/apps/api/src/modules/orders/service-fee.service.ts): `apps/api/src/modules/orders/service-fee.service.ts`

### Engagement & Support

- [League service](https://github.com/jomo424947-arch/orderfast/blob/main/apps/api/src/modules/league/league.service.ts): `apps/api/src/modules/league/league.service.ts`
- [Notifications](https://github.com/jomo424947-arch/orderfast/blob/main/apps/api/src/modules/notifications/notification.service.ts): `apps/api/src/modules/notifications/notification.service.ts`
- [Marketing campaigns](https://github.com/jomo424947-arch/orderfast/blob/main/apps/api/src/modules/notifications/marketing.service.ts): `apps/api/src/modules/notifications/marketing.service.ts`
- [Support](https://github.com/jomo424947-arch/orderfast/blob/main/apps/api/src/modules/support/support.service.ts): `apps/api/src/modules/support/support.service.ts`

### API & Persistence

- [PostgreSQL data](https://github.com/jomo424947-arch/orderfast/blob/main/apps/api/src/db/schema.ts): `apps/api/src/db/schema.ts`
- [API route registration](https://github.com/jomo424947-arch/orderfast/blob/main/apps/api/src/app.ts): `apps/api/src/app.ts`

### Other components

- **Student**
- **Kiosk staff**
- **Administrator**

## Connections

- Student → Web application: uses (evidence: `README.md`)
- Kiosk staff → Web application: uses (evidence: `README.md`)
- Administrator → Web application: uses (evidence: `README.md`)
- Web application → Web services: uses
- Web services → Client state: updates
- API route registration → Auth routes: registers (evidence: `apps/api/src/app.ts`)
- API route registration → Kiosk routes: registers (evidence: `apps/api/src/app.ts`)
- API route registration → Catalog routes: registers (evidence: `apps/api/src/app.ts`)
- API route registration → Order routes: registers (evidence: `apps/api/src/app.ts`)
- API route registration → Notifications: registers routes
- Auth routes → Auth service: calls (evidence: `apps/api/src/modules/auth/auth.routes.ts`)
- Auth service → Supabase Auth: authenticates (evidence: `apps/api/src/modules/auth/auth.service.ts`)
- Auth routes → Auth middleware: guards (evidence: `apps/api/src/modules/auth/auth.routes.ts`)
- Kiosk routes → Kiosk service: calls (evidence: `apps/api/src/modules/kiosks/kiosk.routes.ts`)
- Catalog routes → Catalog service: calls (evidence: `apps/api/src/modules/catalog/catalog.routes.ts`)
- Order routes → Order service: calls (evidence: `apps/api/src/modules/orders/order.routes.ts`)
- Catalog service → PostgreSQL data: reads/writes (evidence: `apps/api/src/modules/catalog/catalog.service.ts`)
- Kiosk service → PostgreSQL data: reads/writes (evidence: `apps/api/src/modules/kiosks/kiosk.service.ts`)
- Auth service → PostgreSQL data: reads/writes (evidence: `apps/api/src/modules/auth/auth.service.ts`)
- Auth middleware → Supabase Auth: verifies tokens (evidence: `apps/api/src/shared/middleware/auth.ts`)
- Order routes → Auth middleware: guards (evidence: `apps/api/src/modules/orders/order.routes.ts`)
- Order service → PostgreSQL data: reads/writes
- Service fees → PostgreSQL data: reads/writes
- League service → PostgreSQL data: reads/writes (evidence: `apps/api/src/modules/league/league.service.ts`)
- League service → Notifications: sends push (evidence: `apps/api/src/modules/league/league.service.ts`)
- Marketing campaigns → PostgreSQL data: reads/writes (evidence: `apps/api/src/modules/notifications/marketing.service.ts`)
- Marketing campaigns → Notifications: sends push (evidence: `apps/api/src/modules/notifications/marketing.service.ts`)
- Notifications → PostgreSQL data: reads/writes (evidence: `apps/api/src/modules/notifications/notification.service.ts`)
- Support → PostgreSQL data: persists
