# 1vannce/rcwheels-systems-integration architecture

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

- Interactive diagram: https://gitdiagram.com/1vannce/rcwheels-systems-integration
- Repository: https://github.com/1vannce/rcwheels-systems-integration

## Overview

RCWheels is a browser-based business-management prototype for staff to manage requisitions, inventory, purchasing, and delivery against a shared database. The main workflow is request submission and review, stock reservation and issue preparation, delivery, and acceptance with quantities and history tracked centrally. Authentication and role-based access gate the app; inventory services enforce stock movements. Purchasing and delivery are documented capabilities, but their implementations were not sampled, so their internal flows are not inferred. Links between stages reflect README statements where source evidence was unavailable.

Main entry points: [`src/modules/requisition`](https://github.com/1vannce/rcwheels-systems-integration/tree/main/src/modules/requisition) (Requisition workflow), [`src/db/index.ts`](https://github.com/1vannce/rcwheels-systems-integration/blob/main/src/db/index.ts) (PostgreSQL database), [`src/app/(app)/requisitions/[requisitionId]/page.tsx`](https://github.com/1vannce/rcwheels-systems-integration/blob/main/src/app/(app)/requisitions/%5BrequisitionId%5D/page.tsx) (Request detail page), [`src/modules/core/services/session.service.ts`](https://github.com/1vannce/rcwheels-systems-integration/blob/main/src/modules/core/services/session.service.ts) (Session and access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and shared services"]
  node_app["App routes"]
  node_auth["Session and access<br/>[session.service.ts]"]
  node_supabase["Supabase Auth"]
  node_shared["Audit and notifications"]
end

subgraph group_req["Requisition lifecycle"]
  node_requisition["Requisition workflow"]
  node_reqpage["Request detail page<br/>[page.tsx]"]
  node_reqstore["Requisition records"]
end

subgraph group_inv["Inventory control"]
  node_inventory["Inventory operations"]
  node_stock["Stock movements<br/>[stock.service.ts]"]
  node_stockrepo["Stock queries"]
end

subgraph group_ops["Business data and operations"]
  node_purchasing["Purchasing"]
  node_delivery["Delivery"]
  node_db[("PostgreSQL database<br/>[index.ts]")]
  node_schema["Shared domain schema"]
end

node_staff(("Staff"))

node_staff -->|"uses"| node_app
node_app -->|"requires identity"| node_auth
node_auth -->|"verifies session"| node_supabase
node_auth -->|"audits denials"| node_shared
node_app -.->|"routes to"| node_reqpage
node_reqpage -->|"requires user"| node_auth
node_reqpage -->|"loads details"| node_requisition
node_requisition -->|"queries records"| node_reqstore
node_requisition -->|"checks quantities"| node_inventory
node_requisition -->|"notifies roles"| node_shared
node_reqpage -->|"loads stock"| node_inventory
node_inventory -.->|"manages balances"| node_stock
node_stock -->|"updates stock"| node_stockrepo
node_requisition -.->|"prepares delivery"| node_delivery
node_requisition -.->|"connects purchasing"| node_purchasing
node_requisition -.->|"stores workflow data"| node_db
node_inventory -.->|"stores stock data"| node_db
node_purchasing -.->|"shares central data"| node_db
node_delivery -.->|"shares central data"| node_db
node_db -->|"uses tables"| node_schema

click node_app "https://github.com/1vannce/rcwheels-systems-integration/tree/main/src/app"
click node_auth "https://github.com/1vannce/rcwheels-systems-integration/blob/main/src/modules/core/services/session.service.ts"
click node_shared "https://github.com/1vannce/rcwheels-systems-integration/tree/main/src/modules/core"
click node_requisition "https://github.com/1vannce/rcwheels-systems-integration/tree/main/src/modules/requisition"
click node_reqpage "https://github.com/1vannce/rcwheels-systems-integration/blob/main/src/app/(app)/requisitions/%5BrequisitionId%5D/page.tsx"
click node_reqstore "https://github.com/1vannce/rcwheels-systems-integration/blob/main/src/modules/requisition/repositories/requisition.repository.ts"
click node_inventory "https://github.com/1vannce/rcwheels-systems-integration/tree/main/src/modules/inventory"
click node_stock "https://github.com/1vannce/rcwheels-systems-integration/blob/main/src/modules/inventory/services/stock.service.ts"
click node_stockrepo "https://github.com/1vannce/rcwheels-systems-integration/blob/main/src/modules/inventory/repositories/stock.repository.ts"
click node_purchasing "https://github.com/1vannce/rcwheels-systems-integration/tree/main/src/modules/purchasing"
click node_delivery "https://github.com/1vannce/rcwheels-systems-integration/tree/main/src/modules/delivery"
click node_db "https://github.com/1vannce/rcwheels-systems-integration/blob/main/src/db/index.ts"
click node_schema "https://github.com/1vannce/rcwheels-systems-integration/tree/main/src/db/schema"

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_auth,node_supabase,node_shared toneBlue
class node_requisition,node_reqpage,node_reqstore toneAmber
class node_inventory,node_stock,node_stockrepo toneMint
class node_purchasing,node_delivery,node_db,node_schema toneRose
class node_staff toneIndigo
```

## Components

### Access and shared services

- [App routes](https://github.com/1vannce/rcwheels-systems-integration/tree/main/src/app): `src/app`
- [Session and access](https://github.com/1vannce/rcwheels-systems-integration/blob/main/src/modules/core/services/session.service.ts): `src/modules/core/services/session.service.ts`
- **Supabase Auth**
- [Audit and notifications](https://github.com/1vannce/rcwheels-systems-integration/tree/main/src/modules/core): `src/modules/core`

### Requisition lifecycle

- [Requisition workflow](https://github.com/1vannce/rcwheels-systems-integration/tree/main/src/modules/requisition): `src/modules/requisition`
- [Request detail page](https://github.com/1vannce/rcwheels-systems-integration/blob/main/src/app/(app)/requisitions/%5BrequisitionId%5D/page.tsx): `src/app/(app)/requisitions/[requisitionId]/page.tsx`
- [Requisition records](https://github.com/1vannce/rcwheels-systems-integration/blob/main/src/modules/requisition/repositories/requisition.repository.ts): `src/modules/requisition/repositories/requisition.repository.ts`

### Inventory control

- [Inventory operations](https://github.com/1vannce/rcwheels-systems-integration/tree/main/src/modules/inventory): `src/modules/inventory`
- [Stock movements](https://github.com/1vannce/rcwheels-systems-integration/blob/main/src/modules/inventory/services/stock.service.ts): `src/modules/inventory/services/stock.service.ts`
- [Stock queries](https://github.com/1vannce/rcwheels-systems-integration/blob/main/src/modules/inventory/repositories/stock.repository.ts): `src/modules/inventory/repositories/stock.repository.ts`

### Business data and operations

- [Purchasing](https://github.com/1vannce/rcwheels-systems-integration/tree/main/src/modules/purchasing): `src/modules/purchasing`
- [Delivery](https://github.com/1vannce/rcwheels-systems-integration/tree/main/src/modules/delivery): `src/modules/delivery`
- [PostgreSQL database](https://github.com/1vannce/rcwheels-systems-integration/blob/main/src/db/index.ts): `src/db/index.ts`
- [Shared domain schema](https://github.com/1vannce/rcwheels-systems-integration/tree/main/src/db/schema): `src/db/schema`

### Other components

- **Staff**

## Connections

- Staff → App routes: uses
- App routes → Session and access: requires identity (evidence: `src/app/(app)/requisitions/[requisitionId]/page.tsx`)
- Session and access → Supabase Auth: verifies session (evidence: `src/modules/core/services/session.service.ts`)
- Session and access → Audit and notifications: audits denials (evidence: `src/modules/core/services/authorization.service.ts`)
- App routes → Request detail page: routes to
- Request detail page → Session and access: requires user (evidence: `src/app/(app)/requisitions/[requisitionId]/page.tsx`)
- Request detail page → Requisition workflow: loads details (evidence: `src/app/(app)/requisitions/[requisitionId]/page.tsx`)
- Requisition workflow → Requisition records: queries records (evidence: `src/modules/requisition/services/requisition.prep-AR.service.ts`)
- Requisition workflow → Inventory operations: checks quantities (evidence: `src/modules/requisition/services/requisition.prep-AR.service.ts`)
- Requisition workflow → Audit and notifications: notifies roles (evidence: `src/modules/requisition/services/requisition.prep-AR.service.ts`)
- Request detail page → Inventory operations: loads stock (evidence: `src/app/(app)/requisitions/[requisitionId]/page.tsx`)
- Inventory operations → Stock movements: manages balances (evidence: `src/modules/inventory/index.ts`)
- Stock movements → Stock queries: updates stock (evidence: `src/modules/inventory/services/stock.service.ts`)
- Requisition workflow → Delivery: prepares delivery
- Requisition workflow → Purchasing: connects purchasing
- Requisition workflow → PostgreSQL database: stores workflow data (evidence: `src/modules/requisition/repositories/requisition.repository.ts`)
- Inventory operations → PostgreSQL database: stores stock data (evidence: `src/modules/inventory/services/stock.service.ts`)
- Purchasing → PostgreSQL database: shares central data
- Delivery → PostgreSQL database: shares central data
- PostgreSQL database → Shared domain schema: uses tables (evidence: `src/db/index.ts`)
