# rekovohq-commits/rekovohq architecture

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

- Interactive diagram: https://gitdiagram.com/rekovohq-commits/rekovohq
- Repository: https://github.com/rekovohq-commits/rekovohq

## Overview

RekovoHQ is a recycling and circular-economy operations platform: its interface supports recycler deposits and rewards alongside staff, collection, inventory, sales, finance, and regional administration. The main user workflow enters through role-aware application views; the deposit experience and broader operational features are represented by their substantial modules, but their internal call paths were not sampled. The excerpts show shared context using the API client, server routers persisting operational state, and offline scan synchronization. Unsampled feature-to-backend links are omitted rather than inferred.

Main entry points: [`src/App.tsx`](https://github.com/rekovohq-commits/rekovohq/blob/main/src/App.tsx) (Role-aware app), [`src/context/AppContext.tsx`](https://github.com/rekovohq-commits/rekovohq/blob/main/src/context/AppContext.tsx) (Shared app context), [`src/utils/offlineScanStorage.ts`](https://github.com/rekovohq-commits/rekovohq/blob/main/src/utils/offlineScanStorage.ts) (Offline scan sync), [`src/lib/api.ts`](https://github.com/rekovohq-commits/rekovohq/blob/main/src/lib/api.ts) (Client API and sockets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application and access"]
  node_app_shell["Role-aware app<br/>[App.tsx]"]
  node_login["Authentication<br/>[LoginPage.tsx]"]
end

subgraph group_recycling["Recycling and rewards"]
  node_deposit["Recycling deposits<br/>[DepositFlow.tsx]"]
  node_rewards["Rewards program<br/>[RewardsView.tsx]"]
  node_offline_scans["Offline scan sync"]
end

subgraph group_operations["Operational management"]
  node_dashboard["Operations dashboard<br/>[DashboardView.tsx]"]
  node_collections["Collection management"]
  node_operations_view["Operations control<br/>[OperationsView.tsx]"]
  node_finance["Finance and treasury"]
  node_offtakers["Offtaker sales"]
  node_users["User administration"]
  node_superadmin["Platform administration"]
end

subgraph group_platform["Services and state"]
  node_context["Shared app context<br/>[AppContext.tsx]"]
  node_api["Client API and sockets<br/>[api.ts]"]
  node_ops_router["Operations API"]
  node_finance_router["Finance API<br/>[financeRouter.ts]"]
  node_store[("Operational state store<br/>[store.ts]")]
  node_firebase["Firebase services<br/>[firebase.ts]"]
  node_mock_data["Seeded domain data<br/>[mockData.ts]"]
end

node_user(("Platform user"))

node_user -->|"uses"| node_app_shell
node_app_shell -->|"shows"| node_login
node_app_shell -->|"renders"| node_dashboard
node_app_shell -->|"renders"| node_finance
node_app_shell -->|"routes to"| node_operations_view
node_app_shell -->|"routes to"| node_collections
node_app_shell -->|"routes to"| node_offtakers
node_context -->|"calls"| node_api
node_context -->|"imports"| node_mock_data
node_ops_router -->|"persists via"| node_store
node_offline_scans -->|"syncs through"| node_api
node_offline_scans -->|"writes scans"| node_firebase
node_app_shell -->|"provides state"| node_context
node_finance_router -.->|"may persist"| node_store

click node_app_shell "https://github.com/rekovohq-commits/rekovohq/blob/main/src/App.tsx"
click node_login "https://github.com/rekovohq-commits/rekovohq/blob/main/src/components/LoginPage.tsx"
click node_context "https://github.com/rekovohq-commits/rekovohq/blob/main/src/context/AppContext.tsx"
click node_dashboard "https://github.com/rekovohq-commits/rekovohq/blob/main/src/components/DashboardView.tsx"
click node_deposit "https://github.com/rekovohq-commits/rekovohq/blob/main/src/components/DepositFlow.tsx"
click node_rewards "https://github.com/rekovohq-commits/rekovohq/blob/main/src/components/RewardsView.tsx"
click node_collections "https://github.com/rekovohq-commits/rekovohq/blob/main/src/components/Collections/CollectionsManagementView.tsx"
click node_operations_view "https://github.com/rekovohq-commits/rekovohq/blob/main/src/components/OperationsView.tsx"
click node_finance "https://github.com/rekovohq-commits/rekovohq/blob/main/src/components/Finance/FinanceDashboard.tsx"
click node_offtakers "https://github.com/rekovohq-commits/rekovohq/blob/main/src/components/OffTakers/OffTakerSalesView.tsx"
click node_users "https://github.com/rekovohq-commits/rekovohq/blob/main/src/components/Users/UsersManagementView.tsx"
click node_superadmin "https://github.com/rekovohq-commits/rekovohq/blob/main/src/components/SuperAdmin/SuperAdminDashboard.tsx"
click node_api "https://github.com/rekovohq-commits/rekovohq/blob/main/src/lib/api.ts"
click node_ops_router "https://github.com/rekovohq-commits/rekovohq/blob/main/src/server/operationsRouter.ts"
click node_finance_router "https://github.com/rekovohq-commits/rekovohq/blob/main/src/server/financeRouter.ts"
click node_store "https://github.com/rekovohq-commits/rekovohq/blob/main/src/server/store.ts"
click node_offline_scans "https://github.com/rekovohq-commits/rekovohq/blob/main/src/utils/offlineScanStorage.ts"
click node_firebase "https://github.com/rekovohq-commits/rekovohq/blob/main/src/lib/firebase.ts"
click node_mock_data "https://github.com/rekovohq-commits/rekovohq/blob/main/src/data/mockData.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_shell,node_login,node_user toneBlue
class node_deposit,node_rewards,node_offline_scans toneAmber
class node_dashboard,node_collections,node_operations_view,node_finance,node_offtakers,node_users,node_superadmin toneMint
class node_context,node_api,node_ops_router,node_finance_router,node_store,node_firebase,node_mock_data toneRose
```

## Components

### Application and access

- [Role-aware app](https://github.com/rekovohq-commits/rekovohq/blob/main/src/App.tsx): `src/App.tsx`
- [Authentication](https://github.com/rekovohq-commits/rekovohq/blob/main/src/components/LoginPage.tsx): `src/components/LoginPage.tsx`

### Recycling and rewards

- [Recycling deposits](https://github.com/rekovohq-commits/rekovohq/blob/main/src/components/DepositFlow.tsx): `src/components/DepositFlow.tsx`
- [Rewards program](https://github.com/rekovohq-commits/rekovohq/blob/main/src/components/RewardsView.tsx): `src/components/RewardsView.tsx`
- [Offline scan sync](https://github.com/rekovohq-commits/rekovohq/blob/main/src/utils/offlineScanStorage.ts): `src/utils/offlineScanStorage.ts`

### Operational management

- [Operations dashboard](https://github.com/rekovohq-commits/rekovohq/blob/main/src/components/DashboardView.tsx): `src/components/DashboardView.tsx`
- [Collection management](https://github.com/rekovohq-commits/rekovohq/blob/main/src/components/Collections/CollectionsManagementView.tsx): `src/components/Collections/CollectionsManagementView.tsx`
- [Operations control](https://github.com/rekovohq-commits/rekovohq/blob/main/src/components/OperationsView.tsx): `src/components/OperationsView.tsx`
- [Finance and treasury](https://github.com/rekovohq-commits/rekovohq/blob/main/src/components/Finance/FinanceDashboard.tsx): `src/components/Finance/FinanceDashboard.tsx`
- [Offtaker sales](https://github.com/rekovohq-commits/rekovohq/blob/main/src/components/OffTakers/OffTakerSalesView.tsx): `src/components/OffTakers/OffTakerSalesView.tsx`
- [User administration](https://github.com/rekovohq-commits/rekovohq/blob/main/src/components/Users/UsersManagementView.tsx): `src/components/Users/UsersManagementView.tsx`
- [Platform administration](https://github.com/rekovohq-commits/rekovohq/blob/main/src/components/SuperAdmin/SuperAdminDashboard.tsx): `src/components/SuperAdmin/SuperAdminDashboard.tsx`

### Services and state

- [Shared app context](https://github.com/rekovohq-commits/rekovohq/blob/main/src/context/AppContext.tsx): `src/context/AppContext.tsx`
- [Client API and sockets](https://github.com/rekovohq-commits/rekovohq/blob/main/src/lib/api.ts): `src/lib/api.ts`
- [Operations API](https://github.com/rekovohq-commits/rekovohq/blob/main/src/server/operationsRouter.ts): `src/server/operationsRouter.ts`
- [Finance API](https://github.com/rekovohq-commits/rekovohq/blob/main/src/server/financeRouter.ts): `src/server/financeRouter.ts`
- [Operational state store](https://github.com/rekovohq-commits/rekovohq/blob/main/src/server/store.ts): `src/server/store.ts`
- [Firebase services](https://github.com/rekovohq-commits/rekovohq/blob/main/src/lib/firebase.ts): `src/lib/firebase.ts`
- [Seeded domain data](https://github.com/rekovohq-commits/rekovohq/blob/main/src/data/mockData.ts): `src/data/mockData.ts`

### Other components

- **Platform user**

## Connections

- Platform user → Role-aware app: uses (evidence: `src/App.tsx`)
- Role-aware app → Authentication: shows (evidence: `src/App.tsx`)
- Role-aware app → Operations dashboard: renders (evidence: `src/App.tsx`)
- Role-aware app → Finance and treasury: renders (evidence: `src/App.tsx`)
- Role-aware app → Operations control: routes to (evidence: `src/App.tsx`)
- Role-aware app → Collection management: routes to (evidence: `src/App.tsx`)
- Role-aware app → Offtaker sales: routes to (evidence: `src/App.tsx`)
- Shared app context → Client API and sockets: calls (evidence: `src/context/AppContext.tsx`)
- Shared app context → Seeded domain data: imports (evidence: `src/context/AppContext.tsx`)
- Operations API → Operational state store: persists via (evidence: `src/server/operationsRouter.ts`)
- Offline scan sync → Client API and sockets: syncs through (evidence: `src/utils/offlineScanStorage.ts`)
- Offline scan sync → Firebase services: writes scans (evidence: `src/utils/offlineScanStorage.ts`)
- Role-aware app → Shared app context: provides state (evidence: `src/App.tsx`)
- Finance API → Operational state store: may persist
