# sivasabariganesan/odoo-x-gcet-stock-sense architecture

> Architecture diagram of the GitHub repository sivasabariganesan/odoo-x-gcet-stock-sense, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sivasabariganesan/odoo-x-gcet-stock-sense
- Repository: https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense

## Overview

StockSense is a multi-warehouse inventory platform. Users work through a React SPA and authenticated API to manage product and location data, receive and deliver goods, transfer stock, adjust counts, and inspect balances and movement history. The README describes atomic inventory transactions and an immutable ledger, plus dashboard, AI, email, and real-time capabilities. Sampled routes confirm several API-to-service calls; unsampled service internals and frontend API wiring limit finer-grained links.

Main entry points: [`backend/src/server/index.ts`](https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/blob/main/backend/src/server/index.ts) (Hono server), [`backend/src/db/client.ts`](https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/blob/main/backend/src/db/client.ts) (Drizzle database), [`frontend/src/app/App.tsx`](https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/blob/main/frontend/src/app/App.tsx) (React SPA), [`frontend/src/app/router/index.tsx`](https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/blob/main/frontend/src/app/router/index.tsx) (App routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["User application"]
  node_spa["React SPA<br/>[App.tsx]"]
  node_router["App routes<br/>[index.tsx]"]
  node_feature_ui["Feature screens"]
  node_api_client["API client<br/>[apiClient.ts]"]
end

subgraph group_inventory["Inventory operations"]
  node_receipts["Receipt processing"]
  node_deliveries["Delivery processing"]
  node_transfers["Internal transfers<br/>[service.ts]"]
  node_adjustments["Inventory adjustments<br/>[service.ts]"]
  node_balances["Stock balances<br/>[service.ts]"]
  node_ledger["Movement ledger<br/>[service.ts]"]
end

subgraph group_platform["Platform services"]
  node_server["Hono server<br/>[index.ts]"]
  node_auth["Auth service<br/>[service.ts]"]
  node_auth_routes["Auth routes<br/>[route.ts]"]
  node_dashboard["Dashboard<br/>[service.ts]"]
  node_ai["AI assistant<br/>[orchestrator.ts]"]
  node_ws["WebSocket pub/sub"]
  node_metrics["Metrics<br/>[metrics.ts]"]
end

subgraph group_persistence["Data layer"]
  node_db["Drizzle database<br/>[client.ts]"]
  node_schema["Inventory tables<br/>[index.ts]"]
end

subgraph group_integrations["External systems"]
  node_postgres[("PostgreSQL")]
  node_groq["Groq API"]
  node_smtp["SMTP mail"]
end

node_operator(("Operator"))

node_operator -->|"uses"| node_spa
node_spa -->|"renders"| node_router
node_router -->|"routes to"| node_feature_ui
node_feature_ui -->|"requests data"| node_api_client
node_api_client -->|"HTTP and WS"| node_server
node_server -->|"dispatches"| node_auth_routes
node_auth_routes -->|"calls"| node_auth
node_server -->|"dispatches"| node_receipts
node_server -->|"dispatches"| node_deliveries
node_server -->|"dispatches"| node_transfers
node_server -->|"dispatches"| node_adjustments
node_server -->|"dispatches"| node_balances
node_server -->|"dispatches"| node_ledger
node_server -->|"dispatches"| node_dashboard
node_server -->|"dispatches"| node_ai
node_server -->|"dispatches"| node_ws
node_receipts -->|"transactional updates"| node_db
node_deliveries -->|"transactional updates"| node_db
node_transfers -->|"transactional updates"| node_db
node_adjustments -->|"transactional updates"| node_db
node_db -->|"uses tables"| node_schema
node_db -->|"queries"| node_postgres
node_dashboard -->|"reads summaries"| node_db
node_ai -.->|"LLM requests"| node_groq
node_ws -->|"broadcasts events"| node_operator
node_server -->|"records metrics"| node_metrics
node_auth -.->|"sends email"| node_smtp

click node_spa "https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/blob/main/frontend/src/app/App.tsx"
click node_router "https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/blob/main/frontend/src/app/router/index.tsx"
click node_feature_ui "https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/tree/main/frontend/src/features"
click node_api_client "https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/blob/main/frontend/src/lib/apiClient.ts"
click node_server "https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/blob/main/backend/src/server/index.ts"
click node_auth "https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/blob/main/backend/src/modules/auth/service.ts"
click node_auth_routes "https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/blob/main/backend/src/modules/auth/route.ts"
click node_receipts "https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/blob/main/backend/src/modules/receipts/processing.service.ts"
click node_deliveries "https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/blob/main/backend/src/modules/deliveries/processing.service.ts"
click node_transfers "https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/blob/main/backend/src/modules/transfers/service.ts"
click node_adjustments "https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/blob/main/backend/src/modules/adjustments/service.ts"
click node_balances "https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/blob/main/backend/src/modules/stock-balances/service.ts"
click node_ledger "https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/blob/main/backend/src/modules/stock-movements/service.ts"
click node_dashboard "https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/blob/main/backend/src/modules/dashboard/service.ts"
click node_ai "https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/blob/main/backend/src/modules/ai/orchestrator.ts"
click node_ws "https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/tree/main/backend/src/modules/websocket"
click node_metrics "https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/blob/main/backend/src/lib/metrics.ts"
click node_db "https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/blob/main/backend/src/db/client.ts"
click node_schema "https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/blob/main/backend/src/db/schema/index.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_spa,node_router,node_feature_ui,node_api_client toneBlue
class node_receipts,node_deliveries,node_transfers,node_adjustments,node_balances,node_ledger toneAmber
class node_server,node_auth,node_auth_routes,node_dashboard,node_ai,node_ws,node_metrics toneMint
class node_db,node_schema toneRose
class node_postgres,node_groq,node_smtp,node_operator toneIndigo
```

## Components

### User application

- [React SPA](https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/blob/main/frontend/src/app/App.tsx): `frontend/src/app/App.tsx`
- [App routes](https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/blob/main/frontend/src/app/router/index.tsx): `frontend/src/app/router/index.tsx`
- [Feature screens](https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/tree/main/frontend/src/features): `frontend/src/features`
- [API client](https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/blob/main/frontend/src/lib/apiClient.ts): `frontend/src/lib/apiClient.ts`

### Inventory operations

- [Receipt processing](https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/blob/main/backend/src/modules/receipts/processing.service.ts): `backend/src/modules/receipts/processing.service.ts`
- [Delivery processing](https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/blob/main/backend/src/modules/deliveries/processing.service.ts): `backend/src/modules/deliveries/processing.service.ts`
- [Internal transfers](https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/blob/main/backend/src/modules/transfers/service.ts): `backend/src/modules/transfers/service.ts`
- [Inventory adjustments](https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/blob/main/backend/src/modules/adjustments/service.ts): `backend/src/modules/adjustments/service.ts`
- [Stock balances](https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/blob/main/backend/src/modules/stock-balances/service.ts): `backend/src/modules/stock-balances/service.ts`
- [Movement ledger](https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/blob/main/backend/src/modules/stock-movements/service.ts): `backend/src/modules/stock-movements/service.ts`

### Platform services

- [Hono server](https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/blob/main/backend/src/server/index.ts): `backend/src/server/index.ts`
- [Auth service](https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/blob/main/backend/src/modules/auth/service.ts): `backend/src/modules/auth/service.ts`
- [Auth routes](https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/blob/main/backend/src/modules/auth/route.ts): `backend/src/modules/auth/route.ts`
- [Dashboard](https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/blob/main/backend/src/modules/dashboard/service.ts): `backend/src/modules/dashboard/service.ts`
- [AI assistant](https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/blob/main/backend/src/modules/ai/orchestrator.ts): `backend/src/modules/ai/orchestrator.ts`
- [WebSocket pub/sub](https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/tree/main/backend/src/modules/websocket): `backend/src/modules/websocket`
- [Metrics](https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/blob/main/backend/src/lib/metrics.ts): `backend/src/lib/metrics.ts`

### Data layer

- [Drizzle database](https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/blob/main/backend/src/db/client.ts): `backend/src/db/client.ts`
- [Inventory tables](https://github.com/sivasabariganesan/odoo-x-gcet-stock-sense/blob/main/backend/src/db/schema/index.ts): `backend/src/db/schema/index.ts`

### External systems

- **PostgreSQL**
- **Groq API**
- **SMTP mail**

### Other components

- **Operator**

## Connections

- Operator → React SPA: uses
- React SPA → App routes: renders
- App routes → Feature screens: routes to
- Feature screens → API client: requests data
- API client → Hono server: HTTP and WS
- Hono server → Auth routes: dispatches
- Auth routes → Auth service: calls
- Hono server → Receipt processing: dispatches
- Hono server → Delivery processing: dispatches
- Hono server → Internal transfers: dispatches
- Hono server → Inventory adjustments: dispatches
- Hono server → Stock balances: dispatches
- Hono server → Movement ledger: dispatches
- Hono server → Dashboard: dispatches
- Hono server → AI assistant: dispatches
- Hono server → WebSocket pub/sub: dispatches
- Receipt processing → Drizzle database: transactional updates
- Delivery processing → Drizzle database: transactional updates
- Internal transfers → Drizzle database: transactional updates
- Inventory adjustments → Drizzle database: transactional updates
- Drizzle database → Inventory tables: uses tables
- Drizzle database → PostgreSQL: queries
- Dashboard → Drizzle database: reads summaries
- AI assistant → Groq API: LLM requests
- WebSocket pub/sub → Operator: broadcasts events
- Hono server → Metrics: records metrics
- Auth service → SMTP mail: sends email
