# manojhole/vegz-user architecture

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

- Interactive diagram: https://gitdiagram.com/manojhole/vegz-user
- Repository: https://github.com/manojhole/vegz-user

## Overview

Vegz is a customer vegetable-and-grocery ordering app backed by a monolithic FastAPI service. Customers browse a city-specific catalog, build a basket, verify a phone number, provide an address, choose payment, place an order, and view order status/history. The backend also supports multi-shop catalog synchronization and dispatch, plus support tickets. The web/PWA is the documented primary client; mobile and Android shells are separate clients. Some backend routes and the Android shell were not sampled, so those relationships are based on README statements rather than inspected implementation.

Main entry points: [`backend/app/main.py`](https://github.com/manojhole/vegz-user/blob/main/backend/app/main.py) (FastAPI application), [`frontend/app.js`](https://github.com/manojhole/vegz-user/blob/main/frontend/app.js) (Web storefront), [`backend/app/database.py`](https://github.com/manojhole/vegz-user/blob/main/backend/app/database.py) (Database session), [`android/app/src/main/java/com/vegz/user/MainActivity.kt`](https://github.com/manojhole/vegz-user/blob/main/android/app/src/main/java/com/vegz/user/MainActivity.kt) (Android WebView shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Customer clients"]
  node_web_app["Web storefront<br/>[app.js]"]
  node_pwa["PWA offline shell<br/>[sw.js]"]
  node_android_shell["Android WebView shell<br/>[MainActivity.kt]"]
end

subgraph group_customer_flow["Shopping flow"]
  node_catalog_basket["Catalog and basket<br/>[app.js]"]
  node_checkout_identity["OTP verification<br/>[app.js]"]
  node_checkout_address["Delivery address<br/>[app.js]"]
  node_checkout_payment["Payment choice<br/>[app.js]"]
  node_orders_tracking["Orders and status<br/>[main.py]"]
  node_support["Order support<br/>[main.py]"]
end

subgraph group_backend["Customer API"]
  node_api["FastAPI application<br/>[main.py]"]
  node_schemas["Request and response schemas<br/>[schemas.py]"]
  node_models["Domain models<br/>[models.py]"]
  node_database_config["Database session<br/>[database.py]"]
  node_database[("Application database<br/>[database.py]")]
end

subgraph group_integrations["External services"]
  node_shop_service["Shop service"]
  node_agent_service["Agent service"]
  node_otp_sms["AWS SNS SMS"]
end

node_customer(("Customer"))

node_customer -->|"uses"| node_web_app
node_web_app -->|"renders"| node_catalog_basket
node_catalog_basket -->|"requests catalog"| node_api
node_checkout_identity -->|"requests OTP"| node_api
node_checkout_address -->|"saves address"| node_api
node_checkout_payment -.->|"places order"| node_api
node_web_app -->|"uses offline cache"| node_pwa
node_customer -->|"uses"| node_android_shell
node_android_shell -->|"loads customer app"| node_web_app
node_api -->|"uses schemas"| node_schemas
node_api -->|"uses models"| node_models
node_models -->|"uses base"| node_database_config
node_api -->|"opens sessions"| node_database_config
node_database_config -->|"connects"| node_database
node_api -->|"serves order status"| node_orders_tracking
node_api -->|"serves tickets"| node_support
node_api -->|"syncs catalog"| node_shop_service
node_api -->|"sends dispatch"| node_agent_service
node_api -.->|"sends OTP"| node_otp_sms

click node_web_app "https://github.com/manojhole/vegz-user/blob/main/frontend/app.js"
click node_pwa "https://github.com/manojhole/vegz-user/blob/main/frontend/sw.js"
click node_android_shell "https://github.com/manojhole/vegz-user/blob/main/android/app/src/main/java/com/vegz/user/MainActivity.kt"
click node_catalog_basket "https://github.com/manojhole/vegz-user/blob/main/frontend/app.js"
click node_checkout_identity "https://github.com/manojhole/vegz-user/blob/main/frontend/app.js"
click node_checkout_address "https://github.com/manojhole/vegz-user/blob/main/frontend/app.js"
click node_checkout_payment "https://github.com/manojhole/vegz-user/blob/main/frontend/app.js"
click node_orders_tracking "https://github.com/manojhole/vegz-user/blob/main/backend/app/main.py"
click node_support "https://github.com/manojhole/vegz-user/blob/main/backend/app/main.py"
click node_api "https://github.com/manojhole/vegz-user/blob/main/backend/app/main.py"
click node_schemas "https://github.com/manojhole/vegz-user/blob/main/backend/app/schemas.py"
click node_models "https://github.com/manojhole/vegz-user/blob/main/backend/app/models.py"
click node_database_config "https://github.com/manojhole/vegz-user/blob/main/backend/app/database.py"
click node_database "https://github.com/manojhole/vegz-user/blob/main/backend/app/database.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_app,node_pwa,node_android_shell toneBlue
class node_catalog_basket,node_checkout_identity,node_checkout_address,node_checkout_payment,node_orders_tracking,node_support toneAmber
class node_api,node_schemas,node_models,node_database_config,node_database toneMint
class node_shop_service,node_agent_service,node_otp_sms toneRose
class node_customer toneIndigo
```

## Components

### Customer clients

- [Web storefront](https://github.com/manojhole/vegz-user/blob/main/frontend/app.js): `frontend/app.js`
- [PWA offline shell](https://github.com/manojhole/vegz-user/blob/main/frontend/sw.js): `frontend/sw.js`
- [Android WebView shell](https://github.com/manojhole/vegz-user/blob/main/android/app/src/main/java/com/vegz/user/MainActivity.kt): `android/app/src/main/java/com/vegz/user/MainActivity.kt`

### Shopping flow

- [Catalog and basket](https://github.com/manojhole/vegz-user/blob/main/frontend/app.js): `frontend/app.js`
- [OTP verification](https://github.com/manojhole/vegz-user/blob/main/frontend/app.js): `frontend/app.js`
- [Delivery address](https://github.com/manojhole/vegz-user/blob/main/frontend/app.js): `frontend/app.js`
- [Payment choice](https://github.com/manojhole/vegz-user/blob/main/frontend/app.js): `frontend/app.js`
- [Orders and status](https://github.com/manojhole/vegz-user/blob/main/backend/app/main.py): `backend/app/main.py`
- [Order support](https://github.com/manojhole/vegz-user/blob/main/backend/app/main.py): `backend/app/main.py`

### Customer API

- [FastAPI application](https://github.com/manojhole/vegz-user/blob/main/backend/app/main.py): `backend/app/main.py`
- [Request and response schemas](https://github.com/manojhole/vegz-user/blob/main/backend/app/schemas.py): `backend/app/schemas.py`
- [Domain models](https://github.com/manojhole/vegz-user/blob/main/backend/app/models.py): `backend/app/models.py`
- [Database session](https://github.com/manojhole/vegz-user/blob/main/backend/app/database.py): `backend/app/database.py`
- [Application database](https://github.com/manojhole/vegz-user/blob/main/backend/app/database.py): `backend/app/database.py`

### External services

- **Shop service**
- **Agent service**
- **AWS SNS SMS**

### Other components

- **Customer**

## Connections

- Customer → Web storefront: uses (evidence: `README.md`)
- Web storefront → Catalog and basket: renders (evidence: `frontend/app.js`)
- Catalog and basket → FastAPI application: requests catalog (evidence: `frontend/app.js`)
- OTP verification → FastAPI application: requests OTP (evidence: `frontend/app.js`)
- Delivery address → FastAPI application: saves address (evidence: `frontend/app.js`)
- Payment choice → FastAPI application: places order
- Web storefront → PWA offline shell: uses offline cache (evidence: `README.md`)
- Customer → Android WebView shell: uses (evidence: `README.md`)
- Android WebView shell → Web storefront: loads customer app (evidence: `README.md`)
- FastAPI application → Request and response schemas: uses schemas (evidence: `backend/app/main.py`)
- FastAPI application → Domain models: uses models (evidence: `backend/app/main.py`)
- Domain models → Database session: uses base (evidence: `backend/app/models.py`)
- FastAPI application → Database session: opens sessions (evidence: `backend/app/main.py`)
- Database session → Application database: connects (evidence: `backend/app/database.py`)
- FastAPI application → Orders and status: serves order status (evidence: `README.md`)
- FastAPI application → Order support: serves tickets (evidence: `backend/app/main.py`)
- FastAPI application → Shop service: syncs catalog (evidence: `README.md`)
- FastAPI application → Agent service: sends dispatch (evidence: `README.md`)
- FastAPI application → AWS SNS SMS: sends OTP (evidence: `README.md`)
