# gozzagu/storv-ui architecture

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

- Interactive diagram: https://gitdiagram.com/gozzagu/storv-ui
- Repository: https://github.com/gozzagu/storv-ui

## Overview

Storvv UI is a multi-branch retail operations platform: staff and owners sign in, select a store, and manage inventory and sales through a dashboard, with payment processing and other retail capabilities alongside that core workflow. The Nuxt client uses Firebase-backed state and server APIs; Paystack handles payment integrations. The graph preserves documented product areas, but many feature-specific page-to-service connections were not shown in the excerpts, so those links are omitted rather than inferred.

Main entry points: [`server/utils/payments/link-webhook.ts`](https://github.com/gozzagu/storv-ui/blob/main/server/utils/payments/link-webhook.ts) (Payment processing), [`stores/auth.ts`](https://github.com/gozzagu/storv-ui/blob/main/stores/auth.ts) (Authentication state), [`pages/dashboard/index.vue`](https://github.com/gozzagu/storv-ui/blob/main/pages/dashboard/index.vue) (Operations dashboard), [`stores/receipts.ts`](https://github.com/gozzagu/storv-ui/blob/main/stores/receipts.ts) (Sales and receipts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity and workspace"]
  node_auth["Authentication state<br/>[auth.ts]"]
  node_firebaseauth["Firebase Auth"]
  node_profile["User profile<br/>[user.ts]"]
  node_workspace["Branch workspace"]
end

subgraph group_operations["Retail operations"]
  node_dashboard["Operations dashboard<br/>[index.vue]"]
  node_inventory["Inventory management<br/>[inventory.ts]"]
  node_receipts["Sales and receipts<br/>[receipts.ts]"]
  node_leads["Sales leads<br/>[salesLeads.ts]"]
  node_firestore[("Firestore")]
end

subgraph group_payments["Payments"]
  node_paymentui["Payment links<br/>[usePaymentLinks.ts]"]
  node_paymentapi["Payment processing<br/>[link-webhook.ts]"]
  node_paymentrecords["Payment records<br/>[records.ts]"]
  node_paystack["Paystack"]
end

subgraph group_commerce["Commerce extensions"]
  node_storefront["Online storefront<br/>[index.get.ts]"]
  node_trade["Trade and loans<br/>[loans.ts]"]
  node_loyalty["Customer loyalty<br/>[sync.ts]"]
  node_branches["Branch transfers<br/>[service.ts]"]
end

subgraph group_insights["Analytics and discovery"]
  node_search["Global search<br/>[search.ts]"]
  node_analytics["Retail analytics<br/>[analytics.vue]"]
end

node_staff(("Owner or staff"))

node_staff -->|"signs in"| node_auth
node_auth -->|"authenticates with"| node_firebaseauth
node_auth -->|"loads profile"| node_profile
node_staff -.->|"uses"| node_dashboard
node_dashboard -.->|"offers access"| node_inventory
node_dashboard -.->|"loads sales"| node_receipts
node_inventory -->|"reads and writes"| node_firestore
node_receipts -->|"reads and writes"| node_firestore
node_profile -->|"reads and writes"| node_firestore
node_search -->|"fetches when needed"| node_receipts
node_paymentapi -->|"records payments"| node_paymentrecords
node_paymentapi -->|"settles loan payment"| node_trade
node_paymentapi -->|"handles webhook"| node_paystack

click node_auth "https://github.com/gozzagu/storv-ui/blob/main/stores/auth.ts"
click node_profile "https://github.com/gozzagu/storv-ui/blob/main/stores/user.ts"
click node_workspace "https://github.com/gozzagu/storv-ui/blob/main/composables/useStaffWorkspaceContext.ts"
click node_dashboard "https://github.com/gozzagu/storv-ui/blob/main/pages/dashboard/index.vue"
click node_inventory "https://github.com/gozzagu/storv-ui/blob/main/stores/inventory.ts"
click node_receipts "https://github.com/gozzagu/storv-ui/blob/main/stores/receipts.ts"
click node_leads "https://github.com/gozzagu/storv-ui/blob/main/stores/salesLeads.ts"
click node_search "https://github.com/gozzagu/storv-ui/blob/main/stores/search.ts"
click node_analytics "https://github.com/gozzagu/storv-ui/blob/main/pages/dashboard/analytics.vue"
click node_paymentui "https://github.com/gozzagu/storv-ui/blob/main/composables/usePaymentLinks.ts"
click node_paymentapi "https://github.com/gozzagu/storv-ui/blob/main/server/utils/payments/link-webhook.ts"
click node_paymentrecords "https://github.com/gozzagu/storv-ui/blob/main/server/utils/payments/records.ts"
click node_storefront "https://github.com/gozzagu/storv-ui/blob/main/server/api/storefront/%5Bslug%5D/index.get.ts"
click node_trade "https://github.com/gozzagu/storv-ui/blob/main/server/utils/trade/loans.ts"
click node_loyalty "https://github.com/gozzagu/storv-ui/blob/main/server/utils/loyalty/sync.ts"
click node_branches "https://github.com/gozzagu/storv-ui/blob/main/server/utils/transfers/service.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_auth,node_firebaseauth,node_profile,node_workspace toneBlue
class node_dashboard,node_inventory,node_receipts,node_leads,node_firestore toneAmber
class node_paymentui,node_paymentapi,node_paymentrecords,node_paystack toneMint
class node_storefront,node_trade,node_loyalty,node_branches toneRose
class node_search,node_analytics,node_staff toneIndigo
```

## Components

### Identity and workspace

- [Authentication state](https://github.com/gozzagu/storv-ui/blob/main/stores/auth.ts): `stores/auth.ts`
- **Firebase Auth**
- [User profile](https://github.com/gozzagu/storv-ui/blob/main/stores/user.ts): `stores/user.ts`
- [Branch workspace](https://github.com/gozzagu/storv-ui/blob/main/composables/useStaffWorkspaceContext.ts): `composables/useStaffWorkspaceContext.ts`

### Retail operations

- [Operations dashboard](https://github.com/gozzagu/storv-ui/blob/main/pages/dashboard/index.vue): `pages/dashboard/index.vue`
- [Inventory management](https://github.com/gozzagu/storv-ui/blob/main/stores/inventory.ts): `stores/inventory.ts`
- [Sales and receipts](https://github.com/gozzagu/storv-ui/blob/main/stores/receipts.ts): `stores/receipts.ts`
- [Sales leads](https://github.com/gozzagu/storv-ui/blob/main/stores/salesLeads.ts): `stores/salesLeads.ts`
- **Firestore**

### Payments

- [Payment links](https://github.com/gozzagu/storv-ui/blob/main/composables/usePaymentLinks.ts): `composables/usePaymentLinks.ts`
- [Payment processing](https://github.com/gozzagu/storv-ui/blob/main/server/utils/payments/link-webhook.ts): `server/utils/payments/link-webhook.ts`
- [Payment records](https://github.com/gozzagu/storv-ui/blob/main/server/utils/payments/records.ts): `server/utils/payments/records.ts`
- **Paystack**

### Commerce extensions

- [Online storefront](https://github.com/gozzagu/storv-ui/blob/main/server/api/storefront/%5Bslug%5D/index.get.ts): `server/api/storefront/[slug]/index.get.ts`
- [Trade and loans](https://github.com/gozzagu/storv-ui/blob/main/server/utils/trade/loans.ts): `server/utils/trade/loans.ts`
- [Customer loyalty](https://github.com/gozzagu/storv-ui/blob/main/server/utils/loyalty/sync.ts): `server/utils/loyalty/sync.ts`
- [Branch transfers](https://github.com/gozzagu/storv-ui/blob/main/server/utils/transfers/service.ts): `server/utils/transfers/service.ts`

### Analytics and discovery

- [Global search](https://github.com/gozzagu/storv-ui/blob/main/stores/search.ts): `stores/search.ts`
- [Retail analytics](https://github.com/gozzagu/storv-ui/blob/main/pages/dashboard/analytics.vue): `pages/dashboard/analytics.vue`

### Other components

- **Owner or staff**

## Connections

- Owner or staff → Authentication state: signs in (evidence: `stores/auth.ts`)
- Authentication state → Firebase Auth: authenticates with (evidence: `stores/auth.ts`)
- Authentication state → User profile: loads profile (evidence: `stores/user.ts`)
- Owner or staff → Operations dashboard: uses
- Operations dashboard → Inventory management: offers access (evidence: `pages/dashboard/index.vue`)
- Operations dashboard → Sales and receipts: loads sales (evidence: `pages/dashboard/index.vue`)
- Inventory management → Firestore: reads and writes (evidence: `stores/inventory.ts`)
- Sales and receipts → Firestore: reads and writes (evidence: `stores/receipts.ts`)
- User profile → Firestore: reads and writes (evidence: `stores/user.ts`)
- Global search → Sales and receipts: fetches when needed (evidence: `stores/search.ts`)
- Payment processing → Payment records: records payments (evidence: `server/utils/payments/link-webhook.ts`)
- Payment processing → Trade and loans: settles loan payment (evidence: `server/utils/payments/link-webhook.ts`)
- Payment processing → Paystack: handles webhook
