# sm85-code/frontend-marketplace-erp architecture

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

- Interactive diagram: https://gitdiagram.com/sm85-code/frontend-marketplace-erp
- Repository: https://github.com/sm85-code/frontend-marketplace-erp

## Overview

This is a private, staff-facing multi-marketplace ERP panel, not a storefront. Users authenticate, then manage shops and catalog/listings, process and ship orders, reconcile settlements, manage inventory, and administer ads and staff through routed pages backed by the Marketplace ERP API. The graph preserves README-documented screens even where their page implementations were not sampled; those paths come from the tree and those links are documented capabilities, not claims of source inspection.

Main entry points: [`src/api/endpoints.ts`](https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/api/endpoints.ts) (Route API client), [`src/App.tsx`](https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/App.tsx) (Routes and access), [`src/pages/PesananPage.tsx`](https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/pages/PesananPage.tsx) (Order inbox), [`src/lib/auth.tsx`](https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/lib/auth.tsx) (Authentication state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application access"]
  node_app["Routes and access<br/>[App.tsx]"]
  node_layout["Navigation shell<br/>[Layout.tsx]"]
  node_auth["Authentication state<br/>[auth.tsx]"]
  node_login["Sign in<br/>[LoginPage.tsx]"]
  node_staff["Staff administration<br/>[StaffPage.tsx]"]
  node_profile["User profile<br/>[ProfilePage.tsx]"]
end

subgraph group_commerce["Commerce operations"]
  node_shops["Marketplace shops<br/>[AkunPage.tsx]"]
  node_oauth["Shopee OAuth return"]
  node_products["Product catalog<br/>[ProdukPage.tsx]"]
  node_catalog["Catalog views<br/>[KatalogPage.tsx]"]
  node_listing["Shop listings<br/>[ListingPage.tsx]"]
  node_dashboard["Sales dashboard<br/>[DashboardPage.tsx]"]
end

subgraph group_fulfillment["Orders and inventory"]
  node_orders["Order inbox<br/>[PesananPage.tsx]"]
  node_orderdetail["Order processing"]
  node_warehouse["Warehouse and stock<br/>[GudangPage.tsx]"]
end

subgraph group_finance["Finance and growth"]
  node_settlement["Payout reconciliation<br/>[SettlementPage.tsx]"]
  node_ads["Campaign management<br/>[IklanPage.tsx]"]
  node_ad_detail["Campaign performance"]
end

subgraph group_shared["API and shared UI"]
  node_api["Route API client<br/>[endpoints.ts]"]
  node_http["HTTP transport<br/>[client.ts]"]
  node_types["API data contracts<br/>[types.ts]"]
  node_listui["Shared list toolkit<br/>[index.ts]"]
  node_orders_domain["Order rules<br/>[pesanan.ts]"]
  node_campaign_domain["Campaign rules<br/>[iklanKampanye.ts]"]
end

node_operator(("Panel user"))
node_backend["Marketplace ERP API"]

node_operator -->|"opens panel"| node_app
node_app -->|"provides auth"| node_auth
node_app -->|"routes to"| node_login
node_app -->|"wraps protected pages"| node_layout
node_login -.->|"signs in through"| node_auth
node_auth -->|"requests identity"| node_api
node_layout -->|"presents navigation"| node_operator
node_shops -.->|"manages shops"| node_api
node_shops -.->|"starts connection"| node_oauth
node_oauth -.->|"completes OAuth"| node_api
node_products -.->|"manages products"| node_api
node_catalog -.->|"loads catalog"| node_api
node_listing -.->|"manages listings"| node_api
node_orders -.->|"loads and mutates"| node_api
node_orders -->|"renders lists with"| node_listui
node_orders -.->|"applies transitions"| node_orders_domain
node_orderdetail -.->|"updates shipment"| node_api
node_warehouse -->|"manages stock"| node_api
node_warehouse -->|"renders lists with"| node_listui
node_dashboard -.->|"loads summaries"| node_api
node_settlement -.->|"reconciles payouts"| node_api
node_settlement -->|"renders lists with"| node_listui
node_ads -.->|"manages campaigns"| node_api
node_ads -->|"uses campaign rules"| node_campaign_domain
node_ad_detail -.->|"loads performance"| node_api
node_staff -.->|"manages staff"| node_api
node_profile -.->|"updates profile"| node_api
node_api -->|"sends requests through"| node_http
node_api -->|"uses contracts"| node_types
node_http -->|"sends API requests"| node_backend

click node_app "https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/App.tsx"
click node_layout "https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/components/Layout.tsx"
click node_auth "https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/lib/auth.tsx"
click node_login "https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/pages/LoginPage.tsx"
click node_shops "https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/pages/AkunPage.tsx"
click node_oauth "https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/pages/ShopeeCallbackPage.tsx"
click node_products "https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/pages/ProdukPage.tsx"
click node_catalog "https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/pages/KatalogPage.tsx"
click node_listing "https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/pages/ListingPage.tsx"
click node_orders "https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/pages/PesananPage.tsx"
click node_orderdetail "https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/pages/PesananDetailPage.tsx"
click node_warehouse "https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/pages/GudangPage.tsx"
click node_dashboard "https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/pages/DashboardPage.tsx"
click node_settlement "https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/pages/SettlementPage.tsx"
click node_ads "https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/pages/IklanPage.tsx"
click node_ad_detail "https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/pages/IklanDetailPage.tsx"
click node_staff "https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/pages/StaffPage.tsx"
click node_profile "https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/pages/ProfilePage.tsx"
click node_api "https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/api/endpoints.ts"
click node_http "https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/api/client.ts"
click node_types "https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/api/types.ts"
click node_listui "https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/components/daftar/index.ts"
click node_orders_domain "https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/lib/pesanan.ts"
click node_campaign_domain "https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/lib/iklanKampanye.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_layout,node_auth,node_login,node_staff,node_profile,node_operator toneBlue
class node_shops,node_oauth,node_products,node_catalog,node_listing,node_dashboard toneAmber
class node_orders,node_orderdetail,node_warehouse,node_backend toneMint
class node_settlement,node_ads,node_ad_detail toneRose
class node_api,node_http,node_types,node_listui,node_orders_domain,node_campaign_domain toneIndigo
```

## Components

### Application access

- [Routes and access](https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/App.tsx): `src/App.tsx`
- [Navigation shell](https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/components/Layout.tsx): `src/components/Layout.tsx`
- [Authentication state](https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/lib/auth.tsx): `src/lib/auth.tsx`
- [Sign in](https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/pages/LoginPage.tsx): `src/pages/LoginPage.tsx`
- [Staff administration](https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/pages/StaffPage.tsx): `src/pages/StaffPage.tsx`
- [User profile](https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/pages/ProfilePage.tsx): `src/pages/ProfilePage.tsx`

### Commerce operations

- [Marketplace shops](https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/pages/AkunPage.tsx): `src/pages/AkunPage.tsx`
- [Shopee OAuth return](https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/pages/ShopeeCallbackPage.tsx): `src/pages/ShopeeCallbackPage.tsx`
- [Product catalog](https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/pages/ProdukPage.tsx): `src/pages/ProdukPage.tsx`
- [Catalog views](https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/pages/KatalogPage.tsx): `src/pages/KatalogPage.tsx`
- [Shop listings](https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/pages/ListingPage.tsx): `src/pages/ListingPage.tsx`
- [Sales dashboard](https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/pages/DashboardPage.tsx): `src/pages/DashboardPage.tsx`

### Orders and inventory

- [Order inbox](https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/pages/PesananPage.tsx): `src/pages/PesananPage.tsx`
- [Order processing](https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/pages/PesananDetailPage.tsx): `src/pages/PesananDetailPage.tsx`
- [Warehouse and stock](https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/pages/GudangPage.tsx): `src/pages/GudangPage.tsx`

### Finance and growth

- [Payout reconciliation](https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/pages/SettlementPage.tsx): `src/pages/SettlementPage.tsx`
- [Campaign management](https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/pages/IklanPage.tsx): `src/pages/IklanPage.tsx`
- [Campaign performance](https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/pages/IklanDetailPage.tsx): `src/pages/IklanDetailPage.tsx`

### API and shared UI

- [Route API client](https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/api/endpoints.ts): `src/api/endpoints.ts`
- [HTTP transport](https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/api/client.ts): `src/api/client.ts`
- [API data contracts](https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/api/types.ts): `src/api/types.ts`
- [Shared list toolkit](https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/components/daftar/index.ts): `src/components/daftar/index.ts`
- [Order rules](https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/lib/pesanan.ts): `src/lib/pesanan.ts`
- [Campaign rules](https://github.com/sm85-code/frontend-marketplace-erp/blob/main/src/lib/iklanKampanye.ts): `src/lib/iklanKampanye.ts`

### Other components

- **Panel user**
- **Marketplace ERP API**

## Connections

- Panel user → Routes and access: opens panel (evidence: `src/App.tsx`)
- Routes and access → Authentication state: provides auth (evidence: `src/App.tsx`)
- Routes and access → Sign in: routes to (evidence: `src/App.tsx`)
- Routes and access → Navigation shell: wraps protected pages (evidence: `src/App.tsx`)
- Sign in → Authentication state: signs in through
- Authentication state → Route API client: requests identity (evidence: `src/lib/auth.tsx`)
- Navigation shell → Panel user: presents navigation (evidence: `src/components/Layout.tsx`)
- Marketplace shops → Route API client: manages shops
- Marketplace shops → Shopee OAuth return: starts connection
- Shopee OAuth return → Route API client: completes OAuth
- Product catalog → Route API client: manages products
- Catalog views → Route API client: loads catalog
- Shop listings → Route API client: manages listings
- Order inbox → Route API client: loads and mutates (evidence: `src/pages/PesananPage.tsx`)
- Order inbox → Shared list toolkit: renders lists with (evidence: `src/pages/PesananPage.tsx`)
- Order inbox → Order rules: applies transitions (evidence: `src/pages/PesananPage.tsx`)
- Order processing → Route API client: updates shipment
- Warehouse and stock → Route API client: manages stock (evidence: `src/pages/GudangPage.tsx`)
- Warehouse and stock → Shared list toolkit: renders lists with (evidence: `src/pages/GudangPage.tsx`)
- Sales dashboard → Route API client: loads summaries
- Payout reconciliation → Route API client: reconciles payouts
- Payout reconciliation → Shared list toolkit: renders lists with
- Campaign management → Route API client: manages campaigns
- Campaign management → Campaign rules: uses campaign rules
- Campaign performance → Route API client: loads performance
- Staff administration → Route API client: manages staff
- User profile → Route API client: updates profile
- Route API client → HTTP transport: sends requests through (evidence: `src/api/endpoints.ts`)
- Route API client → API data contracts: uses contracts (evidence: `src/api/endpoints.ts`)
- HTTP transport → Marketplace ERP API: sends API requests (evidence: `src/api/client.ts`)
