# shreyas-sv1/vendor_app architecture

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

- Interactive diagram: https://gitdiagram.com/shreyas-sv1/vendor_app
- Repository: https://github.com/shreyas-sv1/vendor_app

## Overview

Vendor App is a mobile-first vendor management PWA backed by an Express API. Vendors use the frontend to register or sign in, configure their profile and location, manage orders, view earnings and order analytics, and access settings and support. The API handles authentication and password recovery, order operations, and dashboard data through route, controller, and service layers. The README documents maps, cart photo uploads, and notifications, but their implementation wiring is not shown in the sampled source; those capabilities are represented without speculative API connections.

Main entry points: [`backend/src/app.js`](https://github.com/shreyas-sv1/vendor_app/blob/main/backend/src/app.js) (Express API), [`frontend/src/App.jsx`](https://github.com/shreyas-sv1/vendor_app/blob/main/frontend/src/App.jsx) (React app), [`backend/src/config/database.js`](https://github.com/shreyas-sv1/vendor_app/blob/main/backend/src/config/database.js) (Prisma data access), [`backend/src/server.js`](https://github.com/shreyas-sv1/vendor_app/blob/main/backend/src/server.js) (HTTP server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Vendor PWA"]
  node_webapp["React app<br/>[App.jsx]"]
  node_authpages["Account access"]
  node_setup["Vendor setup"]
  node_dashboardpage["Dashboard view<br/>[Dashboard.jsx]"]
  node_orderspage["Order management<br/>[Orders.jsx]"]
  node_cartpage["Cart photos<br/>[UploadCart.jsx]"]
  node_settingspage["Profile &amp; support"]
end

subgraph group_auth["Authentication API"]
  node_authroutes["Auth routes<br/>[auth.routes.js]"]
  node_authcontroller["Auth handlers<br/>[authController.js]"]
  node_authservice["Auth services<br/>[authService.js]"]
end

subgraph group_operations["Orders &amp; Analytics API"]
  node_orderroutes["Order routes<br/>[orders.routes.js]"]
  node_ordercontroller["Order handlers<br/>[orderController.js]"]
  node_orderservice["Order services<br/>[orderService.js]"]
  node_dashroutes["Dashboard routes"]
  node_dashcontroller["Dashboard handlers"]
  node_dashservice["Dashboard services"]
end

subgraph group_runtime["API Runtime &amp; State"]
  node_api["Express API<br/>[app.js]"]
  node_server["HTTP server<br/>[server.js]"]
  node_middleware["Request middleware"]
  node_prisma["Prisma data access<br/>[database.js]"]
  node_database[("SQLite database<br/>[schema.prisma]")]
  node_redis[("Redis<br/>[redis.js]")]
end

node_vendor(("Vendor"))

node_vendor -->|"uses"| node_webapp
node_webapp -->|"routes to"| node_authpages
node_webapp -->|"routes to"| node_setup
node_webapp -->|"routes to"| node_dashboardpage
node_webapp -->|"routes to"| node_orderspage
node_webapp -->|"routes to"| node_cartpage
node_webapp -->|"routes to"| node_settingspage
node_authpages -->|"API requests"| node_api
node_orderspage -->|"API requests"| node_api
node_dashboardpage -->|"API requests"| node_api
node_api -->|"mounts"| node_authroutes
node_api -->|"mounts"| node_orderroutes
node_api -->|"mounts"| node_dashroutes
node_api -->|"applies"| node_middleware
node_authroutes -->|"dispatches"| node_authcontroller
node_authcontroller -->|"calls"| node_authservice
node_orderroutes -->|"dispatches"| node_ordercontroller
node_ordercontroller -->|"calls"| node_orderservice
node_dashroutes -->|"dispatches"| node_dashcontroller
node_dashcontroller -->|"calls"| node_dashservice
node_authservice -->|"reads/writes"| node_prisma
node_orderservice -->|"reads/writes"| node_prisma
node_dashservice -->|"reads"| node_prisma
node_prisma -->|"queries"| node_database
node_server -->|"serves"| node_api
node_server -->|"connects"| node_prisma
node_server -->|"pings"| node_redis

click node_webapp "https://github.com/shreyas-sv1/vendor_app/blob/main/frontend/src/App.jsx"
click node_authpages "https://github.com/shreyas-sv1/vendor_app/tree/main/frontend/src/pages"
click node_setup "https://github.com/shreyas-sv1/vendor_app/tree/main/frontend/src/pages"
click node_dashboardpage "https://github.com/shreyas-sv1/vendor_app/blob/main/frontend/src/pages/Dashboard.jsx"
click node_orderspage "https://github.com/shreyas-sv1/vendor_app/blob/main/frontend/src/pages/Orders.jsx"
click node_cartpage "https://github.com/shreyas-sv1/vendor_app/blob/main/frontend/src/pages/UploadCart.jsx"
click node_settingspage "https://github.com/shreyas-sv1/vendor_app/tree/main/frontend/src/pages"
click node_authroutes "https://github.com/shreyas-sv1/vendor_app/blob/main/backend/src/routes/auth.routes.js"
click node_authcontroller "https://github.com/shreyas-sv1/vendor_app/blob/main/backend/src/controllers/authController.js"
click node_authservice "https://github.com/shreyas-sv1/vendor_app/blob/main/backend/src/services/authService.js"
click node_orderroutes "https://github.com/shreyas-sv1/vendor_app/blob/main/backend/src/routes/orders.routes.js"
click node_ordercontroller "https://github.com/shreyas-sv1/vendor_app/blob/main/backend/src/controllers/orderController.js"
click node_orderservice "https://github.com/shreyas-sv1/vendor_app/blob/main/backend/src/services/orderService.js"
click node_dashroutes "https://github.com/shreyas-sv1/vendor_app/blob/main/backend/src/routes/dashboard.routes.js"
click node_dashcontroller "https://github.com/shreyas-sv1/vendor_app/blob/main/backend/src/controllers/dashboardController.js"
click node_dashservice "https://github.com/shreyas-sv1/vendor_app/blob/main/backend/src/services/dashboardService.js"
click node_api "https://github.com/shreyas-sv1/vendor_app/blob/main/backend/src/app.js"
click node_server "https://github.com/shreyas-sv1/vendor_app/blob/main/backend/src/server.js"
click node_middleware "https://github.com/shreyas-sv1/vendor_app/tree/main/backend/src/middleware"
click node_prisma "https://github.com/shreyas-sv1/vendor_app/blob/main/backend/src/config/database.js"
click node_database "https://github.com/shreyas-sv1/vendor_app/blob/main/backend/prisma/schema.prisma"
click node_redis "https://github.com/shreyas-sv1/vendor_app/blob/main/backend/src/config/redis.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_webapp,node_authpages,node_setup,node_dashboardpage,node_orderspage,node_cartpage,node_settingspage toneBlue
class node_authroutes,node_authcontroller,node_authservice toneAmber
class node_orderroutes,node_ordercontroller,node_orderservice,node_dashroutes,node_dashcontroller,node_dashservice toneMint
class node_api,node_server,node_middleware,node_prisma,node_database,node_redis toneRose
class node_vendor toneIndigo
```

## Components

### Vendor PWA

- [React app](https://github.com/shreyas-sv1/vendor_app/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Account access](https://github.com/shreyas-sv1/vendor_app/tree/main/frontend/src/pages): `frontend/src/pages`
- [Vendor setup](https://github.com/shreyas-sv1/vendor_app/tree/main/frontend/src/pages): `frontend/src/pages`
- [Dashboard view](https://github.com/shreyas-sv1/vendor_app/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [Order management](https://github.com/shreyas-sv1/vendor_app/blob/main/frontend/src/pages/Orders.jsx): `frontend/src/pages/Orders.jsx`
- [Cart photos](https://github.com/shreyas-sv1/vendor_app/blob/main/frontend/src/pages/UploadCart.jsx): `frontend/src/pages/UploadCart.jsx`
- [Profile & support](https://github.com/shreyas-sv1/vendor_app/tree/main/frontend/src/pages): `frontend/src/pages`

### Authentication API

- [Auth routes](https://github.com/shreyas-sv1/vendor_app/blob/main/backend/src/routes/auth.routes.js): `backend/src/routes/auth.routes.js`
- [Auth handlers](https://github.com/shreyas-sv1/vendor_app/blob/main/backend/src/controllers/authController.js): `backend/src/controllers/authController.js`
- [Auth services](https://github.com/shreyas-sv1/vendor_app/blob/main/backend/src/services/authService.js): `backend/src/services/authService.js`

### Orders & Analytics API

- [Order routes](https://github.com/shreyas-sv1/vendor_app/blob/main/backend/src/routes/orders.routes.js): `backend/src/routes/orders.routes.js`
- [Order handlers](https://github.com/shreyas-sv1/vendor_app/blob/main/backend/src/controllers/orderController.js): `backend/src/controllers/orderController.js`
- [Order services](https://github.com/shreyas-sv1/vendor_app/blob/main/backend/src/services/orderService.js): `backend/src/services/orderService.js`
- [Dashboard routes](https://github.com/shreyas-sv1/vendor_app/blob/main/backend/src/routes/dashboard.routes.js): `backend/src/routes/dashboard.routes.js`
- [Dashboard handlers](https://github.com/shreyas-sv1/vendor_app/blob/main/backend/src/controllers/dashboardController.js): `backend/src/controllers/dashboardController.js`
- [Dashboard services](https://github.com/shreyas-sv1/vendor_app/blob/main/backend/src/services/dashboardService.js): `backend/src/services/dashboardService.js`

### API Runtime & State

- [Express API](https://github.com/shreyas-sv1/vendor_app/blob/main/backend/src/app.js): `backend/src/app.js`
- [HTTP server](https://github.com/shreyas-sv1/vendor_app/blob/main/backend/src/server.js): `backend/src/server.js`
- [Request middleware](https://github.com/shreyas-sv1/vendor_app/tree/main/backend/src/middleware): `backend/src/middleware`
- [Prisma data access](https://github.com/shreyas-sv1/vendor_app/blob/main/backend/src/config/database.js): `backend/src/config/database.js`
- [SQLite database](https://github.com/shreyas-sv1/vendor_app/blob/main/backend/prisma/schema.prisma): `backend/prisma/schema.prisma`
- [Redis](https://github.com/shreyas-sv1/vendor_app/blob/main/backend/src/config/redis.js): `backend/src/config/redis.js`

### Other components

- **Vendor**

## Connections

- Vendor → React app: uses
- React app → Account access: routes to
- React app → Vendor setup: routes to
- React app → Dashboard view: routes to
- React app → Order management: routes to
- React app → Cart photos: routes to
- React app → Profile & support: routes to
- Account access → Express API: API requests
- Order management → Express API: API requests
- Dashboard view → Express API: API requests
- Express API → Auth routes: mounts
- Express API → Order routes: mounts
- Express API → Dashboard routes: mounts
- Express API → Request middleware: applies
- Auth routes → Auth handlers: dispatches
- Auth handlers → Auth services: calls
- Order routes → Order handlers: dispatches
- Order handlers → Order services: calls
- Dashboard routes → Dashboard handlers: dispatches
- Dashboard handlers → Dashboard services: calls
- Auth services → Prisma data access: reads/writes
- Order services → Prisma data access: reads/writes
- Dashboard services → Prisma data access: reads
- Prisma data access → SQLite database: queries
- HTTP server → Express API: serves
- HTTP server → Prisma data access: connects
- HTTP server → Redis: pings
