# pastaisfine/serve-easy architecture

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

- Interactive diagram: https://gitdiagram.com/pastaisfine/serve-easy
- Repository: https://github.com/pastaisfine/serve-easy

## Overview

ServeEasy is a UTM campus marketplace. Students browse and search listings, services, shops, cafeterias and menus; they create purchase requests, bookings or meal orders, then track updates and history. Providers manage listings and meal operations, while profiles and notifications support those workflows. The frontend’s server-side pages/actions call the FastAPI API, which authenticates users and persists domain records in PostgreSQL; photos use object storage. Telegram is an optional, read-only discovery channel. Edges follow README claims or shown imports/calls; unsampled feature wiring is left unasserted.

Main entry points: [`backend/app/main.py`](https://github.com/pastaisfine/serve-easy/blob/main/backend/app/main.py) (FastAPI application), [`backend/app/models`](https://github.com/pastaisfine/serve-easy/tree/main/backend/app/models) (Marketplace entities), [`backend/app/auth.py`](https://github.com/pastaisfine/serve-easy/blob/main/backend/app/auth.py) (JWT authentication), [`backend/app/routers/requests.py`](https://github.com/pastaisfine/serve-easy/blob/main/backend/app/routers/requests.py) (Purchase requests)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_web_pages["Marketplace pages"]
  node_auth_pages["Sign-in and signup"]
  node_api_client["Server API client<br/>[api.ts]"]
  node_write_client["Write API client<br/>[api-write.ts]"]
  node_auth_server["Auth session<br/>[server.ts]"]
end

subgraph group_api["API workflows"]
  node_api_app["FastAPI application<br/>[main.py]"]
  node_auth["JWT authentication<br/>[auth.py]"]
  node_listings["Marketplace listings<br/>[listings.py]"]
  node_requests["Purchase requests<br/>[requests.py]"]
  node_cafeterias["Cafeteria discovery<br/>[cafeterias.py]"]
  node_meals["Meal orders and management<br/>[meals.py]"]
  node_services["Service listings<br/>[services.py]"]
  node_shops["Student enterprises<br/>[shops.py]"]
  node_profiles["Student profiles<br/>[me.py]"]
  node_notifications["Notification inbox<br/>[notifications.py]"]
  node_uploads["Image uploads<br/>[uploads.py]"]
end

subgraph group_domain["Marketplace data"]
  node_schema["Request and response schemas<br/>[schemas.py]"]
  node_models["Marketplace entities"]
end

subgraph group_integrations["External integrations"]
  node_database[("PostgreSQL<br/>[db.py]")]
  node_object_storage[("Neon object storage")]
  node_telegram["Telegram bot<br/>[telegram_bot.py]"]
  node_bot_queries["Read-only bot queries<br/>[queries.py]"]
  node_neon_auth["Neon Auth"]
end

node_student(("Campus user"))

node_student -->|"browses and orders"| node_web_pages
node_student -->|"signs in"| node_auth_pages
node_web_pages -.->|"loads data"| node_api_client
node_web_pages -.->|"submits actions"| node_write_client
node_auth_pages -.->|"uses session"| node_auth_server
node_api_client -.->|"calls API"| node_api_app
node_write_client -.->|"calls API"| node_api_app
node_api_app -->|"routes requests"| node_listings
node_api_app -->|"routes requests"| node_cafeterias
node_api_app -->|"routes requests"| node_meals
node_api_app -->|"routes requests"| node_requests
node_api_app -->|"routes requests"| node_notifications
node_api_app -->|"routes requests"| node_services
node_api_app -->|"routes requests"| node_shops
node_api_app -->|"routes requests"| node_profiles
node_api_app -->|"routes requests"| node_uploads
node_api_app -->|"starts optional bot"| node_telegram
node_auth -->|"verifies JWT"| node_neon_auth
node_listings -->|"requires user"| node_auth
node_requests -->|"requires user"| node_auth
node_meals -->|"requires user"| node_auth
node_services -->|"requires user"| node_auth
node_profiles -->|"requires user"| node_auth
node_notifications -->|"requires user"| node_auth
node_listings -->|"reads and writes"| node_models
node_requests -->|"reads and writes"| node_models
node_cafeterias -->|"reads"| node_models
node_meals -->|"reads and writes"| node_models
node_services -->|"reads and writes"| node_models
node_shops -->|"reads"| node_models
node_profiles -->|"reads and writes"| node_models
node_notifications -->|"reads"| node_models
node_listings -->|"queries"| node_database
node_requests -->|"queries"| node_database
node_meals -->|"queries"| node_database
node_uploads -.->|"stores images"| node_object_storage
node_telegram -->|"dispatches searches"| node_bot_queries
node_bot_queries -.->|"read-only queries"| node_database
node_requests -->|"creates updates"| node_notifications

click node_web_pages "https://github.com/pastaisfine/serve-easy/tree/main/frontend/app/(tabs)"
click node_auth_pages "https://github.com/pastaisfine/serve-easy/tree/main/frontend/app/auth"
click node_api_client "https://github.com/pastaisfine/serve-easy/blob/main/frontend/lib/api.ts"
click node_write_client "https://github.com/pastaisfine/serve-easy/blob/main/frontend/lib/api-write.ts"
click node_auth_server "https://github.com/pastaisfine/serve-easy/blob/main/frontend/lib/auth/server.ts"
click node_api_app "https://github.com/pastaisfine/serve-easy/blob/main/backend/app/main.py"
click node_auth "https://github.com/pastaisfine/serve-easy/blob/main/backend/app/auth.py"
click node_listings "https://github.com/pastaisfine/serve-easy/blob/main/backend/app/routers/listings.py"
click node_requests "https://github.com/pastaisfine/serve-easy/blob/main/backend/app/routers/requests.py"
click node_cafeterias "https://github.com/pastaisfine/serve-easy/blob/main/backend/app/routers/cafeterias.py"
click node_meals "https://github.com/pastaisfine/serve-easy/blob/main/backend/app/routers/meals.py"
click node_services "https://github.com/pastaisfine/serve-easy/blob/main/backend/app/routers/services.py"
click node_shops "https://github.com/pastaisfine/serve-easy/blob/main/backend/app/routers/shops.py"
click node_profiles "https://github.com/pastaisfine/serve-easy/blob/main/backend/app/routers/me.py"
click node_notifications "https://github.com/pastaisfine/serve-easy/blob/main/backend/app/routers/notifications.py"
click node_uploads "https://github.com/pastaisfine/serve-easy/blob/main/backend/app/routers/uploads.py"
click node_schema "https://github.com/pastaisfine/serve-easy/blob/main/backend/app/schemas.py"
click node_models "https://github.com/pastaisfine/serve-easy/tree/main/backend/app/models"
click node_database "https://github.com/pastaisfine/serve-easy/blob/main/backend/app/db.py"
click node_telegram "https://github.com/pastaisfine/serve-easy/blob/main/backend/app/bot/telegram_bot.py"
click node_bot_queries "https://github.com/pastaisfine/serve-easy/blob/main/backend/app/bot/queries.py"

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_web_pages,node_auth_pages,node_api_client,node_write_client,node_auth_server,node_student toneBlue
class node_api_app,node_auth,node_listings,node_requests,node_cafeterias,node_meals,node_services,node_shops,node_profiles,node_notifications,node_uploads toneAmber
class node_schema,node_models toneMint
class node_database,node_object_storage,node_telegram,node_bot_queries,node_neon_auth toneRose
```

## Components

### Web experience

- [Marketplace pages](https://github.com/pastaisfine/serve-easy/tree/main/frontend/app/(tabs)): `frontend/app/(tabs)`
- [Sign-in and signup](https://github.com/pastaisfine/serve-easy/tree/main/frontend/app/auth): `frontend/app/auth`
- [Server API client](https://github.com/pastaisfine/serve-easy/blob/main/frontend/lib/api.ts): `frontend/lib/api.ts`
- [Write API client](https://github.com/pastaisfine/serve-easy/blob/main/frontend/lib/api-write.ts): `frontend/lib/api-write.ts`
- [Auth session](https://github.com/pastaisfine/serve-easy/blob/main/frontend/lib/auth/server.ts): `frontend/lib/auth/server.ts`

### API workflows

- [FastAPI application](https://github.com/pastaisfine/serve-easy/blob/main/backend/app/main.py): `backend/app/main.py`
- [JWT authentication](https://github.com/pastaisfine/serve-easy/blob/main/backend/app/auth.py): `backend/app/auth.py`
- [Marketplace listings](https://github.com/pastaisfine/serve-easy/blob/main/backend/app/routers/listings.py): `backend/app/routers/listings.py`
- [Purchase requests](https://github.com/pastaisfine/serve-easy/blob/main/backend/app/routers/requests.py): `backend/app/routers/requests.py`
- [Cafeteria discovery](https://github.com/pastaisfine/serve-easy/blob/main/backend/app/routers/cafeterias.py): `backend/app/routers/cafeterias.py`
- [Meal orders and management](https://github.com/pastaisfine/serve-easy/blob/main/backend/app/routers/meals.py): `backend/app/routers/meals.py`
- [Service listings](https://github.com/pastaisfine/serve-easy/blob/main/backend/app/routers/services.py): `backend/app/routers/services.py`
- [Student enterprises](https://github.com/pastaisfine/serve-easy/blob/main/backend/app/routers/shops.py): `backend/app/routers/shops.py`
- [Student profiles](https://github.com/pastaisfine/serve-easy/blob/main/backend/app/routers/me.py): `backend/app/routers/me.py`
- [Notification inbox](https://github.com/pastaisfine/serve-easy/blob/main/backend/app/routers/notifications.py): `backend/app/routers/notifications.py`
- [Image uploads](https://github.com/pastaisfine/serve-easy/blob/main/backend/app/routers/uploads.py): `backend/app/routers/uploads.py`

### Marketplace data

- [Request and response schemas](https://github.com/pastaisfine/serve-easy/blob/main/backend/app/schemas.py): `backend/app/schemas.py`
- [Marketplace entities](https://github.com/pastaisfine/serve-easy/tree/main/backend/app/models): `backend/app/models`

### External integrations

- [PostgreSQL](https://github.com/pastaisfine/serve-easy/blob/main/backend/app/db.py): `backend/app/db.py`
- **Neon object storage**
- [Telegram bot](https://github.com/pastaisfine/serve-easy/blob/main/backend/app/bot/telegram_bot.py): `backend/app/bot/telegram_bot.py`
- [Read-only bot queries](https://github.com/pastaisfine/serve-easy/blob/main/backend/app/bot/queries.py): `backend/app/bot/queries.py`
- **Neon Auth**

### Other components

- **Campus user**

## Connections

- Campus user → Marketplace pages: browses and orders (evidence: `README.md`)
- Campus user → Sign-in and signup: signs in (evidence: `README.md`)
- Marketplace pages → Server API client: loads data
- Marketplace pages → Write API client: submits actions
- Sign-in and signup → Auth session: uses session
- Server API client → FastAPI application: calls API
- Write API client → FastAPI application: calls API
- FastAPI application → Marketplace listings: routes requests (evidence: `backend/app/main.py`)
- FastAPI application → Cafeteria discovery: routes requests (evidence: `backend/app/main.py`)
- FastAPI application → Meal orders and management: routes requests (evidence: `backend/app/main.py`)
- FastAPI application → Purchase requests: routes requests (evidence: `backend/app/main.py`)
- FastAPI application → Notification inbox: routes requests (evidence: `backend/app/main.py`)
- FastAPI application → Service listings: routes requests (evidence: `backend/app/main.py`)
- FastAPI application → Student enterprises: routes requests (evidence: `backend/app/main.py`)
- FastAPI application → Student profiles: routes requests (evidence: `backend/app/main.py`)
- FastAPI application → Image uploads: routes requests (evidence: `backend/app/main.py`)
- FastAPI application → Telegram bot: starts optional bot (evidence: `backend/app/main.py`)
- JWT authentication → Neon Auth: verifies JWT (evidence: `backend/app/auth.py`)
- Marketplace listings → JWT authentication: requires user (evidence: `backend/app/routers/listings.py`)
- Purchase requests → JWT authentication: requires user (evidence: `backend/app/routers/requests.py`)
- Meal orders and management → JWT authentication: requires user (evidence: `backend/app/routers/meals.py`)
- Service listings → JWT authentication: requires user (evidence: `backend/app/routers/services.py`)
- Student profiles → JWT authentication: requires user (evidence: `backend/app/routers/me.py`)
- Notification inbox → JWT authentication: requires user (evidence: `backend/app/routers/notifications.py`)
- Marketplace listings → Marketplace entities: reads and writes (evidence: `backend/app/routers/listings.py`)
- Purchase requests → Marketplace entities: reads and writes (evidence: `backend/app/routers/requests.py`)
- Cafeteria discovery → Marketplace entities: reads (evidence: `backend/app/routers/cafeterias.py`)
- Meal orders and management → Marketplace entities: reads and writes (evidence: `backend/app/routers/meals.py`)
- Service listings → Marketplace entities: reads and writes (evidence: `backend/app/routers/services.py`)
- Student enterprises → Marketplace entities: reads (evidence: `backend/app/routers/shops.py`)
- Student profiles → Marketplace entities: reads and writes (evidence: `backend/app/routers/me.py`)
- Notification inbox → Marketplace entities: reads (evidence: `backend/app/routers/notifications.py`)
- Marketplace listings → PostgreSQL: queries (evidence: `backend/app/routers/listings.py`)
- Purchase requests → PostgreSQL: queries (evidence: `backend/app/routers/requests.py`)
- Meal orders and management → PostgreSQL: queries (evidence: `backend/app/routers/meals.py`)
- Image uploads → Neon object storage: stores images
- Telegram bot → Read-only bot queries: dispatches searches (evidence: `backend/app/bot/telegram_bot.py`)
- Read-only bot queries → PostgreSQL: read-only queries
- Purchase requests → Notification inbox: creates updates (evidence: `backend/app/routers/requests.py`)
