# refrit2024/unifood architecture

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

- Interactive diagram: https://gitdiagram.com/refrit2024/unifood
- Repository: https://github.com/refrit2024/unifood

## Overview

Unifood is a campus food-ordering and student delivery platform, with student discovery and ordering alongside seller and administrator portals. The main workflow runs from campus stall discovery through menu selection and order submission to a digital receipt; seller operations and stall verification form separate management branches. The excerpts show App-level Firestore synchronization and security helpers, but do not expose every screen callback or the full order lifecycle, so those connections are limited to documented or visible relationships.

Main entry points: [`src/App.tsx`](https://github.com/refrit2024/unifood/blob/main/src/App.tsx) (Application shell), [`src/components/KatalogScreen.tsx`](https://github.com/refrit2024/unifood/blob/main/src/components/KatalogScreen.tsx) (Stall catalog), [`src/components/DetailStanScreen.tsx`](https://github.com/refrit2024/unifood/blob/main/src/components/DetailStanScreen.tsx) (Stall & ordering), [`src/components/KelolaMenuScreen.tsx`](https://github.com/refrit2024/unifood/blob/main/src/components/KelolaMenuScreen.tsx) (Menu management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_student["Student Experience"]
  node_catalog["Stall catalog<br/>[KatalogScreen.tsx]"]
  node_stall["Stall &amp; ordering"]
  node_receipt["Order receipt"]
end

subgraph group_operations["Stall Operations"]
  node_menu["Menu management"]
  node_stallqr["Stall QR poster<br/>[StallQrModal.tsx]"]
end

subgraph group_oversight["Verification &amp; Admin"]
  node_adminportal["Verification portal"]
end

subgraph group_foundation["App &amp; Data"]
  node_app["Application shell<br/>[App.tsx]"]
  node_auth["Role sign-in"]
  node_domain["Campus food data<br/>[kantinData.ts]"]
  node_security["Order &amp; login safeguards<br/>[securityGuard.ts]"]
  node_firebase["Firestore adapter<br/>[firebase.ts]"]
  node_store[("Firestore state")]
end

node_student(("Student"))
node_seller(("Stall seller"))
node_admin(("Campus admin"))
node_browser(("Browser runtime"))

node_browser -->|"mounts"| node_app
node_app -->|"renders"| node_auth
node_app -->|"renders"| node_catalog
node_app -->|"renders"| node_stall
node_app -->|"renders"| node_menu
node_app -->|"renders"| node_adminportal
node_student -.->|"discovers stalls"| node_catalog
node_catalog -.->|"selects stall"| node_stall
node_student -.->|"places order"| node_stall
node_stall -->|"opens receipt"| node_receipt
node_catalog -->|"shows receipt"| node_receipt
node_seller -.->|"signs in"| node_auth
node_seller -.->|"manages menu"| node_menu
node_menu -->|"opens QR"| node_stallqr
node_admin -.->|"signs in"| node_auth
node_admin -.->|"audits stalls"| node_adminportal
node_auth -->|"checks lockout"| node_security
node_stall -->|"validates order"| node_security
node_receipt -->|"signs receipt"| node_security
node_catalog -->|"uses stall data"| node_domain
node_menu -->|"uses menu data"| node_domain
node_stallqr -->|"builds stall URL"| node_domain
node_app -->|"syncs state"| node_firebase
node_firebase -.->|"reads and writes"| node_store

click node_app "https://github.com/refrit2024/unifood/blob/main/src/App.tsx"
click node_auth "https://github.com/refrit2024/unifood/blob/main/src/components/AuthPortalScreen.tsx"
click node_catalog "https://github.com/refrit2024/unifood/blob/main/src/components/KatalogScreen.tsx"
click node_stall "https://github.com/refrit2024/unifood/blob/main/src/components/DetailStanScreen.tsx"
click node_receipt "https://github.com/refrit2024/unifood/blob/main/src/components/OrderReceiptModal.tsx"
click node_menu "https://github.com/refrit2024/unifood/blob/main/src/components/KelolaMenuScreen.tsx"
click node_stallqr "https://github.com/refrit2024/unifood/blob/main/src/components/StallQrModal.tsx"
click node_adminportal "https://github.com/refrit2024/unifood/blob/main/src/components/AdminPortalScreen.tsx"
click node_domain "https://github.com/refrit2024/unifood/blob/main/src/data/kantinData.ts"
click node_security "https://github.com/refrit2024/unifood/blob/main/src/utils/securityGuard.ts"
click node_firebase "https://github.com/refrit2024/unifood/blob/main/src/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_catalog,node_stall,node_receipt,node_browser toneBlue
class node_menu,node_stallqr toneAmber
class node_adminportal toneMint
class node_app,node_auth,node_domain,node_security,node_firebase,node_store toneRose
class node_student,node_seller,node_admin toneIndigo
```

## Components

### Student Experience

- [Stall catalog](https://github.com/refrit2024/unifood/blob/main/src/components/KatalogScreen.tsx): `src/components/KatalogScreen.tsx`
- [Stall & ordering](https://github.com/refrit2024/unifood/blob/main/src/components/DetailStanScreen.tsx): `src/components/DetailStanScreen.tsx`
- [Order receipt](https://github.com/refrit2024/unifood/blob/main/src/components/OrderReceiptModal.tsx): `src/components/OrderReceiptModal.tsx`

### Stall Operations

- [Menu management](https://github.com/refrit2024/unifood/blob/main/src/components/KelolaMenuScreen.tsx): `src/components/KelolaMenuScreen.tsx`
- [Stall QR poster](https://github.com/refrit2024/unifood/blob/main/src/components/StallQrModal.tsx): `src/components/StallQrModal.tsx`

### Verification & Admin

- [Verification portal](https://github.com/refrit2024/unifood/blob/main/src/components/AdminPortalScreen.tsx): `src/components/AdminPortalScreen.tsx`

### App & Data

- [Application shell](https://github.com/refrit2024/unifood/blob/main/src/App.tsx): `src/App.tsx`
- [Role sign-in](https://github.com/refrit2024/unifood/blob/main/src/components/AuthPortalScreen.tsx): `src/components/AuthPortalScreen.tsx`
- [Campus food data](https://github.com/refrit2024/unifood/blob/main/src/data/kantinData.ts): `src/data/kantinData.ts`
- [Order & login safeguards](https://github.com/refrit2024/unifood/blob/main/src/utils/securityGuard.ts): `src/utils/securityGuard.ts`
- [Firestore adapter](https://github.com/refrit2024/unifood/blob/main/src/firebase.ts): `src/firebase.ts`
- **Firestore state**

### Other components

- **Student**
- **Stall seller**
- **Campus admin**
- **Browser runtime**

## Connections

- Browser runtime → Application shell: mounts
- Application shell → Role sign-in: renders (evidence: `src/App.tsx`)
- Application shell → Stall catalog: renders (evidence: `src/App.tsx`)
- Application shell → Stall & ordering: renders (evidence: `src/App.tsx`)
- Application shell → Menu management: renders (evidence: `src/App.tsx`)
- Application shell → Verification portal: renders (evidence: `src/App.tsx`)
- Student → Stall catalog: discovers stalls (evidence: `README.md`)
- Stall catalog → Stall & ordering: selects stall (evidence: `README.md`)
- Student → Stall & ordering: places order (evidence: `README.md`)
- Stall & ordering → Order receipt: opens receipt (evidence: `src/components/DetailStanScreen.tsx`)
- Stall catalog → Order receipt: shows receipt (evidence: `src/components/KatalogScreen.tsx`)
- Stall seller → Role sign-in: signs in (evidence: `README.md`)
- Stall seller → Menu management: manages menu (evidence: `README.md`)
- Menu management → Stall QR poster: opens QR (evidence: `src/components/KelolaMenuScreen.tsx`)
- Campus admin → Role sign-in: signs in (evidence: `README.md`)
- Campus admin → Verification portal: audits stalls (evidence: `README.md`)
- Role sign-in → Order & login safeguards: checks lockout (evidence: `src/components/AuthPortalScreen.tsx`)
- Stall & ordering → Order & login safeguards: validates order (evidence: `src/components/DetailStanScreen.tsx`)
- Order receipt → Order & login safeguards: signs receipt (evidence: `src/components/OrderReceiptModal.tsx`)
- Stall catalog → Campus food data: uses stall data (evidence: `src/components/KatalogScreen.tsx`)
- Menu management → Campus food data: uses menu data (evidence: `src/components/KelolaMenuScreen.tsx`)
- Stall QR poster → Campus food data: builds stall URL (evidence: `src/components/StallQrModal.tsx`)
- Application shell → Firestore adapter: syncs state (evidence: `src/App.tsx`)
- Firestore adapter → Firestore state: reads and writes
