# yasubdemissie/urbanmart-swift-deliveries architecture

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

- Interactive diagram: https://gitdiagram.com/yasubdemissie/urbanmart-swift-deliveries
- Repository: https://github.com/yasubdemissie/urbanmart-swift-deliveries

## Overview

UrbanMart is a full-stack commerce and delivery platform. Customers browse products, manage a cart, check out, and track orders; authentication and role-based dashboards support customer, admin, merchant, and delivery workflows. The React application routes users to domain pages and uses a shared API client to reach Express route modules backed by Prisma. The README documents the major product capabilities, while several frontend pages and backend route implementations were not sampled, so those documented relationships are shown without asserting unverified internal calls.

Main entry points: [`src/App.tsx`](https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/src/App.tsx) (React app router), [`server/src/index.ts`](https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/server/src/index.ts) (Express app), [`src/lib/api.ts`](https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/src/lib/api.ts) (API client), [`server/src/routes/auth.ts`](https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/server/src/routes/auth.ts) (Auth and user routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Customer storefront"]
  node_app["React app router<br/>[App.tsx]"]
  node_catalog["Browse catalog<br/>[Shop.tsx]"]
  node_product["Product details<br/>[ProductDetail.tsx]"]
  node_checkout["Checkout<br/>[Checkout.tsx]"]
  node_tracking["Order tracking<br/>[TrackOrder.tsx]"]
end

subgraph group_identity["Identity and cart"]
  node_signin["Sign in and profile<br/>[SignIn.tsx]"]
  node_authstate["Auth state<br/>[useAuth.ts]"]
  node_cart["Cart state<br/>[cartContext.tsx]"]
end

subgraph group_operations["Role dashboards"]
  node_admin["Admin workflows<br/>[Admin.tsx]"]
  node_merchant["Merchant workflows<br/>[MerchantPage.tsx]"]
  node_delivery["Delivery workflows"]
  node_orgdelivery["Delivery organization"]
end

subgraph group_backend["Express API"]
  node_server["Express app<br/>[index.ts]"]
  node_authroutes["Auth and user routes<br/>[auth.ts]"]
  node_catalogroutes["Catalog routes<br/>[products.ts]"]
  node_orderroutes["Cart and order routes<br/>[orders.ts]"]
  node_adminroutes["Admin and reports<br/>[admin.ts]"]
  node_merchantroutes["Merchant routes<br/>[merchant.ts]"]
  node_deliveryroutes["Delivery routes<br/>[delivery.ts]"]
  node_orgdeliveryroutes["Delivery org routes<br/>[delivery-org.ts]"]
  node_reviews["Reviews<br/>[reviews.ts]"]
end

subgraph group_platform["Shared infrastructure"]
  node_api["API client<br/>[api.ts]"]
  node_authmw["JWT and role checks<br/>[auth.ts]"]
  node_validation["Request validation<br/>[validation.ts]"]
  node_prisma["Prisma client<br/>[prisma.ts]"]
  node_database[("PostgreSQL")]
end

node_customer(("Customer"))

node_customer -->|"uses"| node_app
node_app -->|"routes to"| node_catalog
node_app -->|"routes to"| node_checkout
node_app -->|"routes to"| node_tracking
node_app -->|"routes to"| node_signin
node_app -->|"routes to"| node_admin
node_app -->|"routes to"| node_merchant
node_app -->|"routes to"| node_delivery
node_app -->|"routes to"| node_orgdelivery
node_customer -.->|"views"| node_product
node_customer -.->|"manages"| node_cart
node_checkout -->|"uses"| node_cart
node_signin -->|"submits auth"| node_authstate
node_authstate -->|"calls"| node_api
node_checkout -->|"submits order"| node_api
node_product -->|"adds items"| node_cart
node_catalog -.->|"fetches catalog"| node_api
node_tracking -.->|"requests status"| node_api
node_admin -.->|"requests admin data"| node_api
node_merchant -->|"requests merchant data"| node_api
node_delivery -.->|"requests delivery data"| node_api
node_orgdelivery -.->|"requests assignments"| node_api
node_api -->|"HTTP requests"| node_server
node_server -->|"mounts"| node_authroutes
node_server -->|"mounts"| node_catalogroutes
node_server -->|"mounts"| node_orderroutes
node_server -->|"mounts"| node_adminroutes
node_server -->|"mounts"| node_merchantroutes
node_server -->|"mounts"| node_deliveryroutes
node_server -->|"mounts"| node_orgdeliveryroutes
node_server -->|"mounts"| node_reviews
node_authroutes -->|"authenticates"| node_authmw
node_authroutes -->|"validates"| node_validation
node_reviews -->|"authorizes"| node_authmw
node_reviews -->|"validates"| node_validation
node_authmw -->|"checks user"| node_prisma
node_authroutes -->|"queries"| node_prisma
node_reviews -->|"queries"| node_prisma
node_prisma -.->|"persists data"| node_database

click node_app "https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/src/App.tsx"
click node_catalog "https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/src/pages/Shop.tsx"
click node_product "https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/src/pages/ProductDetail.tsx"
click node_checkout "https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/src/pages/Checkout.tsx"
click node_tracking "https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/src/pages/TrackOrder.tsx"
click node_signin "https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/src/pages/SignIn.tsx"
click node_authstate "https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/src/hooks/useAuth.ts"
click node_cart "https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/src/context/cartContext.tsx"
click node_api "https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/src/lib/api.ts"
click node_admin "https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/src/pages/Admin.tsx"
click node_merchant "https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/src/components/Merchant/MerchantPage.tsx"
click node_delivery "https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/src/pages/DeliveryDashboard.tsx"
click node_orgdelivery "https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/src/pages/DeliveryOrgDashboard.tsx"
click node_server "https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/server/src/index.ts"
click node_authroutes "https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/server/src/routes/auth.ts"
click node_catalogroutes "https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/server/src/routes/products.ts"
click node_orderroutes "https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/server/src/routes/orders.ts"
click node_adminroutes "https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/server/src/routes/admin.ts"
click node_merchantroutes "https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/server/src/routes/merchant.ts"
click node_deliveryroutes "https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/server/src/routes/delivery.ts"
click node_orgdeliveryroutes "https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/server/src/routes/delivery-org.ts"
click node_reviews "https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/server/src/routes/reviews.ts"
click node_authmw "https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/server/src/middleware/auth.ts"
click node_validation "https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/server/src/utils/validation.ts"
click node_prisma "https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/server/src/lib/prisma.ts"

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_catalog,node_product,node_checkout,node_tracking toneBlue
class node_signin,node_authstate,node_cart toneAmber
class node_admin,node_merchant,node_delivery,node_orgdelivery toneMint
class node_server,node_authroutes,node_catalogroutes,node_orderroutes,node_adminroutes,node_merchantroutes,node_deliveryroutes,node_orgdeliveryroutes,node_reviews toneRose
class node_api,node_authmw,node_validation,node_prisma,node_database,node_customer toneIndigo
```

## Components

### Customer storefront

- [React app router](https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/src/App.tsx): `src/App.tsx`
- [Browse catalog](https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/src/pages/Shop.tsx): `src/pages/Shop.tsx`
- [Product details](https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/src/pages/ProductDetail.tsx): `src/pages/ProductDetail.tsx`
- [Checkout](https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/src/pages/Checkout.tsx): `src/pages/Checkout.tsx`
- [Order tracking](https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/src/pages/TrackOrder.tsx): `src/pages/TrackOrder.tsx`

### Identity and cart

- [Sign in and profile](https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/src/pages/SignIn.tsx): `src/pages/SignIn.tsx`
- [Auth state](https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/src/hooks/useAuth.ts): `src/hooks/useAuth.ts`
- [Cart state](https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/src/context/cartContext.tsx): `src/context/cartContext.tsx`

### Role dashboards

- [Admin workflows](https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/src/pages/Admin.tsx): `src/pages/Admin.tsx`
- [Merchant workflows](https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/src/components/Merchant/MerchantPage.tsx): `src/components/Merchant/MerchantPage.tsx`
- [Delivery workflows](https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/src/pages/DeliveryDashboard.tsx): `src/pages/DeliveryDashboard.tsx`
- [Delivery organization](https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/src/pages/DeliveryOrgDashboard.tsx): `src/pages/DeliveryOrgDashboard.tsx`

### Express API

- [Express app](https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/server/src/index.ts): `server/src/index.ts`
- [Auth and user routes](https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/server/src/routes/auth.ts): `server/src/routes/auth.ts`
- [Catalog routes](https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/server/src/routes/products.ts): `server/src/routes/products.ts`
- [Cart and order routes](https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/server/src/routes/orders.ts): `server/src/routes/orders.ts`
- [Admin and reports](https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/server/src/routes/admin.ts): `server/src/routes/admin.ts`
- [Merchant routes](https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/server/src/routes/merchant.ts): `server/src/routes/merchant.ts`
- [Delivery routes](https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/server/src/routes/delivery.ts): `server/src/routes/delivery.ts`
- [Delivery org routes](https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/server/src/routes/delivery-org.ts): `server/src/routes/delivery-org.ts`
- [Reviews](https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/server/src/routes/reviews.ts): `server/src/routes/reviews.ts`

### Shared infrastructure

- [API client](https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/src/lib/api.ts): `src/lib/api.ts`
- [JWT and role checks](https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/server/src/middleware/auth.ts): `server/src/middleware/auth.ts`
- [Request validation](https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/server/src/utils/validation.ts): `server/src/utils/validation.ts`
- [Prisma client](https://github.com/yasubdemissie/urbanmart-swift-deliveries/blob/main/server/src/lib/prisma.ts): `server/src/lib/prisma.ts`
- **PostgreSQL**

### Other components

- **Customer**

## Connections

- Customer → React app router: uses (evidence: `src/App.tsx`)
- React app router → Browse catalog: routes to (evidence: `src/App.tsx`)
- React app router → Checkout: routes to (evidence: `src/App.tsx`)
- React app router → Order tracking: routes to (evidence: `src/App.tsx`)
- React app router → Sign in and profile: routes to (evidence: `src/App.tsx`)
- React app router → Admin workflows: routes to (evidence: `src/App.tsx`)
- React app router → Merchant workflows: routes to (evidence: `src/App.tsx`)
- React app router → Delivery workflows: routes to (evidence: `src/App.tsx`)
- React app router → Delivery organization: routes to (evidence: `src/App.tsx`)
- Customer → Product details: views
- Customer → Cart state: manages
- Checkout → Cart state: uses (evidence: `src/pages/Checkout.tsx`)
- Sign in and profile → Auth state: submits auth
- Auth state → API client: calls (evidence: `src/hooks/useAuth.ts`)
- Checkout → API client: submits order (evidence: `src/pages/Checkout.tsx`)
- Product details → Cart state: adds items
- Browse catalog → API client: fetches catalog
- Order tracking → API client: requests status
- Admin workflows → API client: requests admin data
- Merchant workflows → API client: requests merchant data (evidence: `src/components/Merchant/MerchantPage.tsx`)
- Delivery workflows → API client: requests delivery data
- Delivery organization → API client: requests assignments
- API client → Express app: HTTP requests (evidence: `src/lib/api.ts`)
- Express app → Auth and user routes: mounts (evidence: `server/src/index.ts`)
- Express app → Catalog routes: mounts (evidence: `server/src/index.ts`)
- Express app → Cart and order routes: mounts (evidence: `server/src/index.ts`)
- Express app → Admin and reports: mounts (evidence: `server/src/index.ts`)
- Express app → Merchant routes: mounts (evidence: `server/src/index.ts`)
- Express app → Delivery routes: mounts (evidence: `server/src/index.ts`)
- Express app → Delivery org routes: mounts (evidence: `server/src/index.ts`)
- Express app → Reviews: mounts (evidence: `server/src/index.ts`)
- Auth and user routes → JWT and role checks: authenticates (evidence: `server/src/routes/auth.ts`)
- Auth and user routes → Request validation: validates (evidence: `server/src/routes/auth.ts`)
- Reviews → JWT and role checks: authorizes (evidence: `server/src/routes/reviews.ts`)
- Reviews → Request validation: validates (evidence: `server/src/routes/reviews.ts`)
- JWT and role checks → Prisma client: checks user (evidence: `server/src/middleware/auth.ts`)
- Auth and user routes → Prisma client: queries (evidence: `server/src/routes/auth.ts`)
- Reviews → Prisma client: queries (evidence: `server/src/routes/reviews.ts`)
- Prisma client → PostgreSQL: persists data
