# vjy123vjy/vegito architecture

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

- Interactive diagram: https://gitdiagram.com/vjy123vjy/vegito
- Repository: https://github.com/vjy123vjy/vegito

## Overview

VEGITO is a vegetable marketplace and delivery platform. Customers browse produce, manage a cart, place orders, pay, and track delivery; sellers manage products, inventory, and fulfillment, while delivery partners handle tasks and admins oversee operations. The frontend is a Next.js client, and the backend is a FastAPI API with SQLAlchemy persistence. The tree and application description establish the major product areas, but sampled implementation wiring is limited; only the review flow is traced through its router and service.

Main entry points: [`backend/app/services/review_service.py`](https://github.com/vjy123vjy/vegito/blob/main/backend/app/services/review_service.py) (Review Service), [`backend/app/routers/reviews.py`](https://github.com/vjy123vjy/vegito/blob/main/backend/app/routers/reviews.py) (Review Routes), [`backend/app/main.py`](https://github.com/vjy123vjy/vegito/blob/main/backend/app/main.py) (FastAPI Application), [`backend/app/database.py`](https://github.com/vjy123vjy/vegito/blob/main/backend/app/database.py) (SQL Database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Customer and Staff App"]
  node_customer_ui["Customer Experience"]
  node_seller_ui["Seller Portal"]
  node_delivery_ui["Delivery Portal"]
  node_admin_ui["Admin Portal"]
  node_api_client["API Client<br/>[client.ts]"]
end

subgraph group_api["Backend API"]
  node_api_app["FastAPI Application<br/>[main.py]"]
  node_routers["Domain Routes"]
end

subgraph group_commerce["Marketplace Operations"]
  node_catalog["Catalog and Inventory<br/>[products.py]"]
  node_cart_orders["Cart and Orders<br/>[orders.py]"]
  node_payments["Payments and Offers<br/>[payments.py]"]
  node_seller_fulfillment["Seller Fulfillment"]
  node_reviews_router["Review Routes<br/>[reviews.py]"]
  node_reviews_service["Review Service<br/>[review_service.py]"]
  node_review_records["Review Records<br/>[review.py]"]
end

subgraph group_delivery["Delivery Operations"]
  node_delivery_ops["Delivery and Tracking"]
  node_mapbox["Mapbox"]
end

subgraph group_platform["Shared Platform"]
  node_auth["Authentication<br/>[auth_service.py]"]
  node_admin_ops["Administration and Analytics<br/>[admin_analytics.py]"]
  node_database[("SQL Database<br/>[database.py]")]
  node_otp_provider["OTP Provider"]
end

node_customer(("Customer"))
node_seller(("Seller"))
node_courier(("Delivery Partner"))
node_admin(("Administrator"))

node_customer -->|"uses"| node_customer_ui
node_seller -->|"uses"| node_seller_ui
node_courier -->|"uses"| node_delivery_ui
node_admin -->|"uses"| node_admin_ui
node_api_client -->|"sends API requests"| node_api_app
node_api_app -->|"registers routes"| node_routers
node_reviews_router -->|"calls"| node_reviews_service
node_reviews_router -->|"gets session"| node_database
node_reviews_service -->|"queries and writes"| node_database
node_reviews_service -->|"reads and creates"| node_review_records
node_auth -.->|"sends OTP"| node_otp_provider
node_delivery_ops -.->|"map integration"| node_mapbox

click node_customer_ui "https://github.com/vjy123vjy/vegito/tree/main/frontend/app/customer"
click node_seller_ui "https://github.com/vjy123vjy/vegito/tree/main/frontend/app/seller"
click node_delivery_ui "https://github.com/vjy123vjy/vegito/tree/main/frontend/app/delivery"
click node_admin_ui "https://github.com/vjy123vjy/vegito/tree/main/frontend/app/admin"
click node_api_client "https://github.com/vjy123vjy/vegito/blob/main/frontend/lib/api/client.ts"
click node_api_app "https://github.com/vjy123vjy/vegito/blob/main/backend/app/main.py"
click node_routers "https://github.com/vjy123vjy/vegito/tree/main/backend/app/routers"
click node_auth "https://github.com/vjy123vjy/vegito/blob/main/backend/app/services/auth_service.py"
click node_catalog "https://github.com/vjy123vjy/vegito/blob/main/backend/app/routers/products.py"
click node_cart_orders "https://github.com/vjy123vjy/vegito/blob/main/backend/app/routers/orders.py"
click node_payments "https://github.com/vjy123vjy/vegito/blob/main/backend/app/routers/payments.py"
click node_seller_fulfillment "https://github.com/vjy123vjy/vegito/blob/main/backend/app/services/seller_fulfillment_service.py"
click node_delivery_ops "https://github.com/vjy123vjy/vegito/blob/main/backend/app/routers/delivery_tracking.py"
click node_admin_ops "https://github.com/vjy123vjy/vegito/blob/main/backend/app/routers/admin_analytics.py"
click node_reviews_router "https://github.com/vjy123vjy/vegito/blob/main/backend/app/routers/reviews.py"
click node_reviews_service "https://github.com/vjy123vjy/vegito/blob/main/backend/app/services/review_service.py"
click node_review_records "https://github.com/vjy123vjy/vegito/blob/main/backend/app/models/review.py"
click node_database "https://github.com/vjy123vjy/vegito/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_customer_ui,node_seller_ui,node_delivery_ui,node_admin_ui,node_api_client toneBlue
class node_api_app,node_routers toneAmber
class node_catalog,node_cart_orders,node_payments,node_seller_fulfillment,node_reviews_router,node_reviews_service,node_review_records toneMint
class node_delivery_ops,node_mapbox toneRose
class node_auth,node_admin_ops,node_database,node_otp_provider,node_customer,node_seller,node_courier,node_admin toneIndigo
```

## Components

### Customer and Staff App

- [Customer Experience](https://github.com/vjy123vjy/vegito/tree/main/frontend/app/customer): `frontend/app/customer`
- [Seller Portal](https://github.com/vjy123vjy/vegito/tree/main/frontend/app/seller): `frontend/app/seller`
- [Delivery Portal](https://github.com/vjy123vjy/vegito/tree/main/frontend/app/delivery): `frontend/app/delivery`
- [Admin Portal](https://github.com/vjy123vjy/vegito/tree/main/frontend/app/admin): `frontend/app/admin`
- [API Client](https://github.com/vjy123vjy/vegito/blob/main/frontend/lib/api/client.ts): `frontend/lib/api/client.ts`

### Backend API

- [FastAPI Application](https://github.com/vjy123vjy/vegito/blob/main/backend/app/main.py): `backend/app/main.py`
- [Domain Routes](https://github.com/vjy123vjy/vegito/tree/main/backend/app/routers): `backend/app/routers`

### Marketplace Operations

- [Catalog and Inventory](https://github.com/vjy123vjy/vegito/blob/main/backend/app/routers/products.py): `backend/app/routers/products.py`
- [Cart and Orders](https://github.com/vjy123vjy/vegito/blob/main/backend/app/routers/orders.py): `backend/app/routers/orders.py`
- [Payments and Offers](https://github.com/vjy123vjy/vegito/blob/main/backend/app/routers/payments.py): `backend/app/routers/payments.py`
- [Seller Fulfillment](https://github.com/vjy123vjy/vegito/blob/main/backend/app/services/seller_fulfillment_service.py): `backend/app/services/seller_fulfillment_service.py`
- [Review Routes](https://github.com/vjy123vjy/vegito/blob/main/backend/app/routers/reviews.py): `backend/app/routers/reviews.py`
- [Review Service](https://github.com/vjy123vjy/vegito/blob/main/backend/app/services/review_service.py): `backend/app/services/review_service.py`
- [Review Records](https://github.com/vjy123vjy/vegito/blob/main/backend/app/models/review.py): `backend/app/models/review.py`

### Delivery Operations

- [Delivery and Tracking](https://github.com/vjy123vjy/vegito/blob/main/backend/app/routers/delivery_tracking.py): `backend/app/routers/delivery_tracking.py`
- **Mapbox**

### Shared Platform

- [Authentication](https://github.com/vjy123vjy/vegito/blob/main/backend/app/services/auth_service.py): `backend/app/services/auth_service.py`
- [Administration and Analytics](https://github.com/vjy123vjy/vegito/blob/main/backend/app/routers/admin_analytics.py): `backend/app/routers/admin_analytics.py`
- [SQL Database](https://github.com/vjy123vjy/vegito/blob/main/backend/app/database.py): `backend/app/database.py`
- **OTP Provider**

### Other components

- **Customer**
- **Seller**
- **Delivery Partner**
- **Administrator**

## Connections

- Customer → Customer Experience: uses
- Seller → Seller Portal: uses
- Delivery Partner → Delivery Portal: uses
- Administrator → Admin Portal: uses
- API Client → FastAPI Application: sends API requests
- FastAPI Application → Domain Routes: registers routes
- Review Routes → Review Service: calls
- Review Routes → SQL Database: gets session
- Review Service → SQL Database: queries and writes
- Review Service → Review Records: reads and creates
- Authentication → OTP Provider: sends OTP
- Delivery and Tracking → Mapbox: map integration
