# sweezalsuares/quickcrave architecture

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

- Interactive diagram: https://gitdiagram.com/sweezalsuares/quickcrave
- Repository: https://github.com/sweezalsuares/quickcrave

## Overview

QuickCrave is a campus dining pre-order and pickup platform. Students and faculty browse vendor menus, reserve a pickup slot, and track orders through QR pickup; vendors manage preparation and admins manage campus operations. The graph follows the React portals through the shared API client to the Express service and persistence layer. README capabilities include group ordering, economy pricing, analytics, and operations tools; unsampled implementation details are grouped by their documented portal or server subsystem.

Main entry points: [`src/App.js`](https://github.com/sweezalsuares/quickcrave/blob/main/src/App.js) (App shell), [`src/lib/api.js`](https://github.com/sweezalsuares/quickcrave/blob/main/src/lib/api.js) (API and socket client), [`src/components/StudentPortal.js`](https://github.com/sweezalsuares/quickcrave/blob/main/src/components/StudentPortal.js) (Student ordering), [`src/components/VendorPortal.js`](https://github.com/sweezalsuares/quickcrave/blob/main/src/components/VendorPortal.js) (Vendor kitchen)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_app["App shell<br/>[App.js]"]
  node_landing["Landing experience<br/>[LandingPage.js]"]
  node_auth["Authentication<br/>[AuthView.js]"]
  node_student["Student ordering<br/>[StudentPortal.js]"]
  node_vendor["Vendor kitchen<br/>[VendorPortal.js]"]
  node_admin["Campus operations<br/>[AdminPortal.js]"]
  node_assistant["AI assistant UI<br/>[AiAssistant.js]"]
  node_brand["Reload splash<br/>[QuickCraveLogo.js]"]
  node_api["API and socket client<br/>[api.js]"]
  node_analytics["Meal analytics<br/>[analytics.js]"]
  node_sound["Audio feedback<br/>[sound.js]"]
end

subgraph group_service["Campus services"]
  node_server["REST and realtime service<br/>[server.js]"]
end

subgraph group_data["Persistence"]
  node_db["Database access<br/>[db.js]"]
  node_models["Domain schemas<br/>[index.js]"]
end

subgraph group_insights["Intelligence"]
  node_ml["Forecasting and AI<br/>[ml.js]"]
end

node_campus_user(("Campus user"))
node_mongo[("MongoDB")]
node_gemini{{"Google Gemini"}}

node_campus_user -.->|"uses"| node_app
node_app -->|"renders"| node_landing
node_app -->|"renders"| node_auth
node_app -->|"routes to"| node_student
node_app -->|"routes to"| node_vendor
node_app -->|"routes to"| node_admin
node_app -->|"renders"| node_assistant
node_app -->|"renders"| node_brand
node_app -->|"calls"| node_api
node_app -->|"plays"| node_sound
node_landing -->|"plays"| node_sound
node_auth -->|"requests"| node_api
node_student -->|"requests"| node_api
node_vendor -->|"requests"| node_api
node_admin -->|"requests"| node_api
node_student -->|"aggregates"| node_analytics
node_vendor -->|"aggregates"| node_analytics
node_admin -->|"aggregates"| node_analytics
node_assistant -->|"requests"| node_api
node_api -->|"sends HTTP and socket events"| node_server
node_server -->|"loads and saves"| node_db
node_server -->|"calls forecasts"| node_ml
node_db -->|"uses schemas"| node_models
node_db -->|"persists data"| node_mongo
node_ml -.->|"generates responses"| node_gemini

click node_app "https://github.com/sweezalsuares/quickcrave/blob/main/src/App.js"
click node_landing "https://github.com/sweezalsuares/quickcrave/blob/main/src/components/LandingPage.js"
click node_auth "https://github.com/sweezalsuares/quickcrave/blob/main/src/components/AuthView.js"
click node_student "https://github.com/sweezalsuares/quickcrave/blob/main/src/components/StudentPortal.js"
click node_vendor "https://github.com/sweezalsuares/quickcrave/blob/main/src/components/VendorPortal.js"
click node_admin "https://github.com/sweezalsuares/quickcrave/blob/main/src/components/AdminPortal.js"
click node_assistant "https://github.com/sweezalsuares/quickcrave/blob/main/src/components/AiAssistant.js"
click node_brand "https://github.com/sweezalsuares/quickcrave/blob/main/src/components/QuickCraveLogo.js"
click node_api "https://github.com/sweezalsuares/quickcrave/blob/main/src/lib/api.js"
click node_analytics "https://github.com/sweezalsuares/quickcrave/blob/main/src/lib/analytics.js"
click node_sound "https://github.com/sweezalsuares/quickcrave/blob/main/src/lib/sound.js"
click node_server "https://github.com/sweezalsuares/quickcrave/blob/main/server.js"
click node_ml "https://github.com/sweezalsuares/quickcrave/blob/main/server/ml.js"
click node_db "https://github.com/sweezalsuares/quickcrave/blob/main/server/db.js"
click node_models "https://github.com/sweezalsuares/quickcrave/blob/main/server/models/index.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_app,node_landing,node_auth,node_student,node_vendor,node_admin,node_assistant,node_brand,node_api,node_analytics,node_sound,node_campus_user toneBlue
class node_server,node_mongo toneAmber
class node_db,node_models toneMint
class node_ml toneRose
class node_gemini toneIndigo
```

## Components

### Web experience

- [App shell](https://github.com/sweezalsuares/quickcrave/blob/main/src/App.js): `src/App.js`
- [Landing experience](https://github.com/sweezalsuares/quickcrave/blob/main/src/components/LandingPage.js): `src/components/LandingPage.js`
- [Authentication](https://github.com/sweezalsuares/quickcrave/blob/main/src/components/AuthView.js): `src/components/AuthView.js`
- [Student ordering](https://github.com/sweezalsuares/quickcrave/blob/main/src/components/StudentPortal.js): `src/components/StudentPortal.js`
- [Vendor kitchen](https://github.com/sweezalsuares/quickcrave/blob/main/src/components/VendorPortal.js): `src/components/VendorPortal.js`
- [Campus operations](https://github.com/sweezalsuares/quickcrave/blob/main/src/components/AdminPortal.js): `src/components/AdminPortal.js`
- [AI assistant UI](https://github.com/sweezalsuares/quickcrave/blob/main/src/components/AiAssistant.js): `src/components/AiAssistant.js`
- [Reload splash](https://github.com/sweezalsuares/quickcrave/blob/main/src/components/QuickCraveLogo.js): `src/components/QuickCraveLogo.js`
- [API and socket client](https://github.com/sweezalsuares/quickcrave/blob/main/src/lib/api.js): `src/lib/api.js`
- [Meal analytics](https://github.com/sweezalsuares/quickcrave/blob/main/src/lib/analytics.js): `src/lib/analytics.js`
- [Audio feedback](https://github.com/sweezalsuares/quickcrave/blob/main/src/lib/sound.js): `src/lib/sound.js`

### Campus services

- [REST and realtime service](https://github.com/sweezalsuares/quickcrave/blob/main/server.js): `server.js`

### Persistence

- [Database access](https://github.com/sweezalsuares/quickcrave/blob/main/server/db.js): `server/db.js`
- [Domain schemas](https://github.com/sweezalsuares/quickcrave/blob/main/server/models/index.js): `server/models/index.js`

### Intelligence

- [Forecasting and AI](https://github.com/sweezalsuares/quickcrave/blob/main/server/ml.js): `server/ml.js`

### Other components

- **Campus user**
- **MongoDB**
- **Google Gemini**

## Connections

- Campus user → App shell: uses (evidence: `README.md`)
- App shell → Landing experience: renders (evidence: `src/App.js`)
- App shell → Authentication: renders (evidence: `src/App.js`)
- App shell → Student ordering: routes to (evidence: `src/App.js`)
- App shell → Vendor kitchen: routes to (evidence: `src/App.js`)
- App shell → Campus operations: routes to (evidence: `src/App.js`)
- App shell → AI assistant UI: renders (evidence: `src/App.js`)
- App shell → Reload splash: renders (evidence: `src/App.js`)
- App shell → API and socket client: calls (evidence: `src/App.js`)
- App shell → Audio feedback: plays (evidence: `src/App.js`)
- Landing experience → Audio feedback: plays (evidence: `README.md`)
- Authentication → API and socket client: requests (evidence: `src/components/AuthView.js`)
- Student ordering → API and socket client: requests (evidence: `src/components/StudentPortal.js`)
- Vendor kitchen → API and socket client: requests (evidence: `src/components/VendorPortal.js`)
- Campus operations → API and socket client: requests (evidence: `src/components/AdminPortal.js`)
- Student ordering → Meal analytics: aggregates (evidence: `src/components/StudentPortal.js`)
- Vendor kitchen → Meal analytics: aggregates (evidence: `src/components/VendorPortal.js`)
- Campus operations → Meal analytics: aggregates (evidence: `src/components/AdminPortal.js`)
- AI assistant UI → API and socket client: requests (evidence: `src/components/AiAssistant.js`)
- API and socket client → REST and realtime service: sends HTTP and socket events (evidence: `README.md`)
- REST and realtime service → Database access: loads and saves (evidence: `server.js`)
- REST and realtime service → Forecasting and AI: calls forecasts (evidence: `server.js`)
- Database access → Domain schemas: uses schemas (evidence: `server/db.js`)
- Database access → MongoDB: persists data (evidence: `README.md`)
- Forecasting and AI → Google Gemini: generates responses (evidence: `server/ml.js`)
