# vishwavinoth/dropship-admin architecture

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

- Interactive diagram: https://gitdiagram.com/vishwavinoth/dropship-admin
- Repository: https://github.com/vishwavinoth/dropship-admin

## Overview

This is a multi-store e-commerce admin CMS and API, with Stripe checkout and order processing. Administrators authenticate, select or create a store, manage its catalog and settings, then expose store-scoped API routes; customers can check out, and Stripe webhooks mark orders paid. The dashboard also reports orders, sales, and revenue. The graph preserves documented capabilities whose implementation was not sampled; dashed links mark relationships documented at a high level rather than verified in excerpts.

Main entry points: [`lib/prismadb.ts`](https://github.com/vishwavinoth/dropship-admin/blob/main/lib/prismadb.ts) (Prisma Database), [`app/(dashboard)/[storeId]/(routes)`](https://github.com/vishwavinoth/dropship-admin/tree/main/app/(dashboard)/%5BstoreId%5D/(routes)) (Catalog CMS), [`app/(dashboard)/[storeId]/(routes)/categories/components/client.tsx`](https://github.com/vishwavinoth/dropship-admin/blob/main/app/(dashboard)/%5BstoreId%5D/(routes)/categories/components/client.tsx) (Resource Tables), [`app/api/[storeId]/checkout/route.ts`](https://github.com/vishwavinoth/dropship-admin/blob/main/app/api/%5BstoreId%5D/checkout/route.ts) (Checkout Handler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and Stores"]
  node_clerk["Clerk Sign-in"]
  node_store_setup["Store Setup<br/>[store-modal.tsx]"]
  node_store_switcher["Store Switcher<br/>[store-switcher.tsx]"]
  node_store_modal_hook["Store Modal State"]
end

subgraph group_management["Store Management"]
  node_dashboard["Store Dashboard"]
  node_catalog["Catalog CMS"]
  node_product_forms["Product Forms<br/>[product-form.tsx]"]
  node_resource_tables["Resource Tables<br/>[client.tsx]"]
  node_orders_analytics["Orders and Analytics"]
  node_revenue_actions["Revenue Metrics"]
end

subgraph group_commerce["Commerce and Data"]
  node_store_api["Store API"]
  node_store_api_routes["Store Endpoints"]
  node_checkout["Checkout Handler<br/>[route.ts]"]
  node_stripe_webhook["Stripe Webhook<br/>[route.ts]"]
  node_database[("Prisma Database<br/>[prismadb.ts]")]
end

subgraph group_shared["Shared UI"]
  node_data_table["Data Table<br/>[data-table.tsx]"]
  node_api_docs["API Reference UI<br/>[api-list.tsx]"]
  node_ui_primitives["UI Primitives<br/>[button.tsx]"]
end

node_admin(("Administrator"))
node_stripe["Stripe"]
node_customer(("Store Customer"))

node_admin -.->|"signs in"| node_clerk
node_admin -.->|"creates store"| node_store_setup
node_store_setup -->|"uses state"| node_store_modal_hook
node_store_switcher -->|"opens modal"| node_store_modal_hook
node_admin -.->|"selects store"| node_store_switcher
node_dashboard -.->|"opens sections"| node_catalog
node_catalog -.->|"edits products"| node_product_forms
node_catalog -.->|"renders lists"| node_resource_tables
node_resource_tables -->|"renders"| node_data_table
node_resource_tables -->|"shows endpoints"| node_api_docs
node_api_docs -->|"documents routes"| node_store_api
node_store_api -->|"reads and writes"| node_database
node_store_api_routes -->|"reads and writes"| node_database
node_customer -.->|"starts checkout"| node_checkout
node_checkout -->|"creates session"| node_stripe
node_checkout -->|"creates order"| node_database
node_stripe -.->|"sends event"| node_stripe_webhook
node_stripe_webhook -->|"verifies event"| node_stripe
node_stripe_webhook -->|"updates order"| node_database
node_orders_analytics -.->|"reports revenue"| node_revenue_actions
node_revenue_actions -->|"queries metrics"| node_database
node_ui_primitives -->|"supports controls"| node_data_table

click node_clerk "https://github.com/vishwavinoth/dropship-admin/tree/main/app/(auth)/(routes)"
click node_store_setup "https://github.com/vishwavinoth/dropship-admin/blob/main/components/modals/store-modal.tsx"
click node_store_switcher "https://github.com/vishwavinoth/dropship-admin/blob/main/components/store-switcher.tsx"
click node_dashboard "https://github.com/vishwavinoth/dropship-admin/tree/main/app/(dashboard)/%5BstoreId%5D/(routes)"
click node_catalog "https://github.com/vishwavinoth/dropship-admin/tree/main/app/(dashboard)/%5BstoreId%5D/(routes)"
click node_product_forms "https://github.com/vishwavinoth/dropship-admin/blob/main/app/(dashboard)/%5BstoreId%5D/(routes)/products/%5BproductId%5D/components/product-form.tsx"
click node_resource_tables "https://github.com/vishwavinoth/dropship-admin/blob/main/app/(dashboard)/%5BstoreId%5D/(routes)/categories/components/client.tsx"
click node_data_table "https://github.com/vishwavinoth/dropship-admin/blob/main/components/ui/data-table.tsx"
click node_api_docs "https://github.com/vishwavinoth/dropship-admin/blob/main/components/ui/api-list.tsx"
click node_store_api "https://github.com/vishwavinoth/dropship-admin/tree/main/app/api/%5BstoreId%5D"
click node_store_api_routes "https://github.com/vishwavinoth/dropship-admin/tree/main/app/api/stores"
click node_checkout "https://github.com/vishwavinoth/dropship-admin/blob/main/app/api/%5BstoreId%5D/checkout/route.ts"
click node_stripe_webhook "https://github.com/vishwavinoth/dropship-admin/blob/main/app/api/webhook/route.ts"
click node_orders_analytics "https://github.com/vishwavinoth/dropship-admin/tree/main/app/(dashboard)/%5BstoreId%5D/(routes)/orders"
click node_revenue_actions "https://github.com/vishwavinoth/dropship-admin/blob/main/actions/get-graph-revenue.ts"
click node_database "https://github.com/vishwavinoth/dropship-admin/blob/main/lib/prismadb.ts"
click node_ui_primitives "https://github.com/vishwavinoth/dropship-admin/blob/main/components/ui/button.tsx"
click node_store_modal_hook "https://github.com/vishwavinoth/dropship-admin/blob/main/hooks/use-store-modal.tsx"

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_clerk,node_store_setup,node_store_switcher,node_store_modal_hook toneBlue
class node_dashboard,node_catalog,node_product_forms,node_resource_tables,node_orders_analytics,node_revenue_actions toneAmber
class node_store_api,node_store_api_routes,node_checkout,node_stripe_webhook,node_database toneMint
class node_data_table,node_api_docs,node_ui_primitives toneRose
class node_admin,node_stripe,node_customer toneIndigo
```

## Components

### Access and Stores

- [Clerk Sign-in](https://github.com/vishwavinoth/dropship-admin/tree/main/app/(auth)/(routes)): `app/(auth)/(routes)`
- [Store Setup](https://github.com/vishwavinoth/dropship-admin/blob/main/components/modals/store-modal.tsx): `components/modals/store-modal.tsx`
- [Store Switcher](https://github.com/vishwavinoth/dropship-admin/blob/main/components/store-switcher.tsx): `components/store-switcher.tsx`
- [Store Modal State](https://github.com/vishwavinoth/dropship-admin/blob/main/hooks/use-store-modal.tsx): `hooks/use-store-modal.tsx`

### Store Management

- [Store Dashboard](https://github.com/vishwavinoth/dropship-admin/tree/main/app/(dashboard)/%5BstoreId%5D/(routes)): `app/(dashboard)/[storeId]/(routes)`
- [Catalog CMS](https://github.com/vishwavinoth/dropship-admin/tree/main/app/(dashboard)/%5BstoreId%5D/(routes)): `app/(dashboard)/[storeId]/(routes)`
- [Product Forms](https://github.com/vishwavinoth/dropship-admin/blob/main/app/(dashboard)/%5BstoreId%5D/(routes)/products/%5BproductId%5D/components/product-form.tsx): `app/(dashboard)/[storeId]/(routes)/products/[productId]/components/product-form.tsx`
- [Resource Tables](https://github.com/vishwavinoth/dropship-admin/blob/main/app/(dashboard)/%5BstoreId%5D/(routes)/categories/components/client.tsx): `app/(dashboard)/[storeId]/(routes)/categories/components/client.tsx`
- [Orders and Analytics](https://github.com/vishwavinoth/dropship-admin/tree/main/app/(dashboard)/%5BstoreId%5D/(routes)/orders): `app/(dashboard)/[storeId]/(routes)/orders`
- [Revenue Metrics](https://github.com/vishwavinoth/dropship-admin/blob/main/actions/get-graph-revenue.ts): `actions/get-graph-revenue.ts`

### Commerce and Data

- [Store API](https://github.com/vishwavinoth/dropship-admin/tree/main/app/api/%5BstoreId%5D): `app/api/[storeId]`
- [Store Endpoints](https://github.com/vishwavinoth/dropship-admin/tree/main/app/api/stores): `app/api/stores`
- [Checkout Handler](https://github.com/vishwavinoth/dropship-admin/blob/main/app/api/%5BstoreId%5D/checkout/route.ts): `app/api/[storeId]/checkout/route.ts`
- [Stripe Webhook](https://github.com/vishwavinoth/dropship-admin/blob/main/app/api/webhook/route.ts): `app/api/webhook/route.ts`
- [Prisma Database](https://github.com/vishwavinoth/dropship-admin/blob/main/lib/prismadb.ts): `lib/prismadb.ts`

### Shared UI

- [Data Table](https://github.com/vishwavinoth/dropship-admin/blob/main/components/ui/data-table.tsx): `components/ui/data-table.tsx`
- [API Reference UI](https://github.com/vishwavinoth/dropship-admin/blob/main/components/ui/api-list.tsx): `components/ui/api-list.tsx`
- [UI Primitives](https://github.com/vishwavinoth/dropship-admin/blob/main/components/ui/button.tsx): `components/ui/button.tsx`

### Other components

- **Administrator**
- **Stripe**
- **Store Customer**

## Connections

- Administrator → Clerk Sign-in: signs in
- Administrator → Store Setup: creates store
- Store Setup → Store Modal State: uses state (evidence: `components/modals/store-modal.tsx`)
- Store Switcher → Store Modal State: opens modal (evidence: `components/store-switcher.tsx`)
- Administrator → Store Switcher: selects store
- Store Dashboard → Catalog CMS: opens sections
- Catalog CMS → Product Forms: edits products
- Catalog CMS → Resource Tables: renders lists (evidence: `app/(dashboard)/[storeId]/(routes)/categories/components/client.tsx`)
- Resource Tables → Data Table: renders (evidence: `app/(dashboard)/[storeId]/(routes)/categories/components/client.tsx`)
- Resource Tables → API Reference UI: shows endpoints (evidence: `app/(dashboard)/[storeId]/(routes)/categories/components/client.tsx`)
- API Reference UI → Store API: documents routes (evidence: `components/ui/api-list.tsx`)
- Store API → Prisma Database: reads and writes (evidence: `app/api/[storeId]/categories/route.ts`)
- Store Endpoints → Prisma Database: reads and writes (evidence: `app/api/stores/route.ts`)
- Store Customer → Checkout Handler: starts checkout
- Checkout Handler → Stripe: creates session (evidence: `app/api/[storeId]/checkout/route.ts`)
- Checkout Handler → Prisma Database: creates order (evidence: `app/api/[storeId]/checkout/route.ts`)
- Stripe → Stripe Webhook: sends event
- Stripe Webhook → Stripe: verifies event (evidence: `app/api/webhook/route.ts`)
- Stripe Webhook → Prisma Database: updates order (evidence: `app/api/webhook/route.ts`)
- Orders and Analytics → Revenue Metrics: reports revenue
- Revenue Metrics → Prisma Database: queries metrics (evidence: `actions/get-graph-revenue.ts`)
- UI Primitives → Data Table: supports controls (evidence: `components/ui/data-table.tsx`)
