# sasankoffice/ombrix-web architecture

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

- Interactive diagram: https://gitdiagram.com/sasankoffice/ombrix-web
- Repository: https://github.com/sasankoffice/ombrix-web

## Overview

Ombrix is an enterprise construction ERP. Its principal workflow is staff sign-in, role- and page-based authorization, then role-specific work across project progress, junctions, billing/reconciliation, stores, and administration. The API provides these feature areas and persists operational state through Prisma; shared code supplies role and domain rules. The tree also shows web views for the major work areas and support, uploads, and documents. The README is empty and most feature modules and web routes were not sampled, so uncertain cross-app calls and internal feature flows are omitted.

Main entry points: [`apps/api/src/app.module.ts`](https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/app.module.ts) (API composition), [`apps/web/components/shell/AppShell.tsx`](https://github.com/sasankoffice/ombrix-web/blob/master/apps/web/components/shell/AppShell.tsx) (Role workspace), [`apps/api/src/prisma/prisma.service.ts`](https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/prisma/prisma.service.ts) (Relational database access), [`apps/api/src/auth/auth.controller.ts`](https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/auth/auth.controller.ts) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_authui["Sign-in pages<br/>[page.tsx]"]
  node_websession["Session client<br/>[session.tsx]"]
  node_webapi["API client<br/>[api.ts]"]
  node_shell["Role workspace<br/>[AppShell.tsx]"]
  node_progressview["DPR review<br/>[DprReviewPage.tsx]"]
  node_siteview["Site reporting<br/>[SiteEngineer.tsx]"]
  node_junctionview["Junction workspace<br/>[JunctionsPage.tsx]"]
  node_billingview["Billing reconciliation"]
  node_storeview["Store operations<br/>[StorePages.tsx]"]
  node_techview["Tech administration<br/>[TechPages.tsx]"]
end

subgraph group_identity["Identity and access"]
  node_auth["Authentication<br/>[auth.controller.ts]"]
  node_otp["OTP delivery<br/>[otp.sender.ts]"]
  node_authorization["Session access guard<br/>[access.service.ts]"]
  node_sharedrules["Roles and rules<br/>[roles.ts]"]
end

subgraph group_operations["Project operations"]
  node_dpr["Progress reports<br/>[dpr.module.ts]"]
  node_junctions["Junction records"]
  node_sites["Site management<br/>[sites.module.ts]"]
end

subgraph group_commercial["Commercial and stores"]
  node_billing["Billing<br/>[billing.module.ts]"]
  node_recon["Reconciliation<br/>[recon.module.ts]"]
  node_store["Inventory and stores<br/>[store.module.ts]"]
  node_vendors["Vendor management<br/>[vendors.module.ts]"]
end

subgraph group_platform["API platform"]
  node_upload["File uploads<br/>[upload.module.ts]"]
  node_documents["Documents"]
  node_support["Support tickets<br/>[support.module.ts]"]
  node_users["User administration<br/>[users.module.ts]"]
  node_tech["System oversight<br/>[tech.module.ts]"]
  node_overview["Overview metrics<br/>[overview.module.ts]"]
  node_meta["Reference data<br/>[meta.module.ts]"]
  node_apiapp["API composition<br/>[app.module.ts]"]
  node_prisma["Relational database access<br/>[prisma.service.ts]"]
  node_database[("Application database")]
  node_common["Audit and notifications<br/>[common.services.ts]"]
  node_storage["File storage<br/>[storage.service.ts]"]
end

node_staff(("ERP users"))

node_staff -.->|"signs in"| node_authui
node_authui -.->|"starts session"| node_websession
node_websession -.->|"requests API"| node_webapi
node_webapi -.->|"calls API"| node_apiapp
node_apiapp -->|"registers"| node_auth
node_apiapp -->|"registers guard"| node_authorization
node_apiapp -->|"loads provider"| node_prisma
node_apiapp -->|"loads services"| node_common
node_apiapp -->|"loads service"| node_storage
node_apiapp -->|"registers features"| node_dpr
node_apiapp -->|"registers features"| node_junctions
node_apiapp -->|"registers features"| node_sites
node_apiapp -->|"registers features"| node_billing
node_apiapp -->|"registers features"| node_recon
node_apiapp -->|"registers features"| node_store
node_apiapp -->|"registers features"| node_vendors
node_apiapp -->|"registers features"| node_upload
node_apiapp -->|"registers features"| node_documents
node_apiapp -->|"registers features"| node_support
node_apiapp -->|"registers features"| node_users
node_apiapp -->|"registers features"| node_tech
node_apiapp -->|"registers features"| node_overview
node_apiapp -->|"registers features"| node_meta
node_auth -->|"reads and updates"| node_prisma
node_auth -->|"writes audit events"| node_common
node_authorization -->|"loads user access"| node_prisma
node_junctions -->|"queries records"| node_prisma
node_prisma -.->|"persists data"| node_database
node_staff -.->|"uses workspace"| node_shell
node_shell -.->|"opens work area"| node_progressview
node_shell -.->|"opens work area"| node_siteview
node_shell -.->|"opens work area"| node_junctionview
node_shell -.->|"opens work area"| node_billingview
node_shell -.->|"opens work area"| node_storeview
node_shell -.->|"opens work area"| node_techview
node_sharedrules -->|"provides role rules"| node_authorization
node_sharedrules -->|"provides role helpers"| node_auth

click node_authui "https://github.com/sasankoffice/ombrix-web/blob/master/apps/web/app/(auth)/page.tsx"
click node_websession "https://github.com/sasankoffice/ombrix-web/blob/master/apps/web/lib/session.tsx"
click node_webapi "https://github.com/sasankoffice/ombrix-web/blob/master/apps/web/lib/api.ts"
click node_shell "https://github.com/sasankoffice/ombrix-web/blob/master/apps/web/components/shell/AppShell.tsx"
click node_progressview "https://github.com/sasankoffice/ombrix-web/blob/master/apps/web/views/DprReviewPage.tsx"
click node_siteview "https://github.com/sasankoffice/ombrix-web/blob/master/apps/web/views/SiteEngineer.tsx"
click node_junctionview "https://github.com/sasankoffice/ombrix-web/blob/master/apps/web/views/JunctionsPage.tsx"
click node_billingview "https://github.com/sasankoffice/ombrix-web/blob/master/apps/web/views/BillingReconPage.tsx"
click node_storeview "https://github.com/sasankoffice/ombrix-web/blob/master/apps/web/views/StorePages.tsx"
click node_techview "https://github.com/sasankoffice/ombrix-web/blob/master/apps/web/views/TechPages.tsx"
click node_auth "https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/auth/auth.controller.ts"
click node_otp "https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/auth/otp.sender.ts"
click node_authorization "https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/common/access.service.ts"
click node_sharedrules "https://github.com/sasankoffice/ombrix-web/blob/master/packages/shared/src/roles.ts"
click node_dpr "https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/modules/dpr.module.ts"
click node_junctions "https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/modules/junctions.module.ts"
click node_sites "https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/modules/sites.module.ts"
click node_billing "https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/modules/billing.module.ts"
click node_recon "https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/modules/recon.module.ts"
click node_store "https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/modules/store.module.ts"
click node_vendors "https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/modules/vendors.module.ts"
click node_upload "https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/modules/upload.module.ts"
click node_documents "https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/modules/documents.module.ts"
click node_support "https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/modules/support.module.ts"
click node_users "https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/modules/users.module.ts"
click node_tech "https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/modules/tech.module.ts"
click node_overview "https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/modules/overview.module.ts"
click node_meta "https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/modules/meta.module.ts"
click node_apiapp "https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/app.module.ts"
click node_prisma "https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/prisma/prisma.service.ts"
click node_common "https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/common/common.services.ts"
click node_storage "https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/common/storage.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_authui,node_websession,node_webapi,node_shell,node_progressview,node_siteview,node_junctionview,node_billingview,node_storeview,node_techview,node_staff toneBlue
class node_auth,node_otp,node_authorization,node_sharedrules toneAmber
class node_dpr,node_junctions,node_sites toneMint
class node_billing,node_recon,node_store,node_vendors toneRose
class node_upload,node_documents,node_support,node_users,node_tech,node_overview,node_meta,node_apiapp,node_prisma,node_database,node_common,node_storage toneIndigo
```

## Components

### Web application

- [Sign-in pages](https://github.com/sasankoffice/ombrix-web/blob/master/apps/web/app/(auth)/page.tsx): `apps/web/app/(auth)/page.tsx`
- [Session client](https://github.com/sasankoffice/ombrix-web/blob/master/apps/web/lib/session.tsx): `apps/web/lib/session.tsx`
- [API client](https://github.com/sasankoffice/ombrix-web/blob/master/apps/web/lib/api.ts): `apps/web/lib/api.ts`
- [Role workspace](https://github.com/sasankoffice/ombrix-web/blob/master/apps/web/components/shell/AppShell.tsx): `apps/web/components/shell/AppShell.tsx`
- [DPR review](https://github.com/sasankoffice/ombrix-web/blob/master/apps/web/views/DprReviewPage.tsx): `apps/web/views/DprReviewPage.tsx`
- [Site reporting](https://github.com/sasankoffice/ombrix-web/blob/master/apps/web/views/SiteEngineer.tsx): `apps/web/views/SiteEngineer.tsx`
- [Junction workspace](https://github.com/sasankoffice/ombrix-web/blob/master/apps/web/views/JunctionsPage.tsx): `apps/web/views/JunctionsPage.tsx`
- [Billing reconciliation](https://github.com/sasankoffice/ombrix-web/blob/master/apps/web/views/BillingReconPage.tsx): `apps/web/views/BillingReconPage.tsx`
- [Store operations](https://github.com/sasankoffice/ombrix-web/blob/master/apps/web/views/StorePages.tsx): `apps/web/views/StorePages.tsx`
- [Tech administration](https://github.com/sasankoffice/ombrix-web/blob/master/apps/web/views/TechPages.tsx): `apps/web/views/TechPages.tsx`

### Identity and access

- [Authentication](https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/auth/auth.controller.ts): `apps/api/src/auth/auth.controller.ts`
- [OTP delivery](https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/auth/otp.sender.ts): `apps/api/src/auth/otp.sender.ts`
- [Session access guard](https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/common/access.service.ts): `apps/api/src/common/access.service.ts`
- [Roles and rules](https://github.com/sasankoffice/ombrix-web/blob/master/packages/shared/src/roles.ts): `packages/shared/src/roles.ts`

### Project operations

- [Progress reports](https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/modules/dpr.module.ts): `apps/api/src/modules/dpr.module.ts`
- [Junction records](https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/modules/junctions.module.ts): `apps/api/src/modules/junctions.module.ts`
- [Site management](https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/modules/sites.module.ts): `apps/api/src/modules/sites.module.ts`

### Commercial and stores

- [Billing](https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/modules/billing.module.ts): `apps/api/src/modules/billing.module.ts`
- [Reconciliation](https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/modules/recon.module.ts): `apps/api/src/modules/recon.module.ts`
- [Inventory and stores](https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/modules/store.module.ts): `apps/api/src/modules/store.module.ts`
- [Vendor management](https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/modules/vendors.module.ts): `apps/api/src/modules/vendors.module.ts`

### API platform

- [File uploads](https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/modules/upload.module.ts): `apps/api/src/modules/upload.module.ts`
- [Documents](https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/modules/documents.module.ts): `apps/api/src/modules/documents.module.ts`
- [Support tickets](https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/modules/support.module.ts): `apps/api/src/modules/support.module.ts`
- [User administration](https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/modules/users.module.ts): `apps/api/src/modules/users.module.ts`
- [System oversight](https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/modules/tech.module.ts): `apps/api/src/modules/tech.module.ts`
- [Overview metrics](https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/modules/overview.module.ts): `apps/api/src/modules/overview.module.ts`
- [Reference data](https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/modules/meta.module.ts): `apps/api/src/modules/meta.module.ts`
- [API composition](https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/app.module.ts): `apps/api/src/app.module.ts`
- [Relational database access](https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/prisma/prisma.service.ts): `apps/api/src/prisma/prisma.service.ts`
- **Application database**
- [Audit and notifications](https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/common/common.services.ts): `apps/api/src/common/common.services.ts`
- [File storage](https://github.com/sasankoffice/ombrix-web/blob/master/apps/api/src/common/storage.service.ts): `apps/api/src/common/storage.service.ts`

### Other components

- **ERP users**

## Connections

- ERP users → Sign-in pages: signs in
- Sign-in pages → Session client: starts session
- Session client → API client: requests API (evidence: `apps/web/lib/session.tsx`)
- API client → API composition: calls API
- API composition → Authentication: registers (evidence: `apps/api/src/app.module.ts`)
- API composition → Session access guard: registers guard (evidence: `apps/api/src/app.module.ts`)
- API composition → Relational database access: loads provider (evidence: `apps/api/src/app.module.ts`)
- API composition → Audit and notifications: loads services (evidence: `apps/api/src/app.module.ts`)
- API composition → File storage: loads service (evidence: `apps/api/src/app.module.ts`)
- API composition → Progress reports: registers features
- API composition → Junction records: registers features
- API composition → Site management: registers features
- API composition → Billing: registers features
- API composition → Reconciliation: registers features
- API composition → Inventory and stores: registers features
- API composition → Vendor management: registers features
- API composition → File uploads: registers features
- API composition → Documents: registers features
- API composition → Support tickets: registers features
- API composition → User administration: registers features
- API composition → System oversight: registers features
- API composition → Overview metrics: registers features
- API composition → Reference data: registers features
- Authentication → Relational database access: reads and updates (evidence: `apps/api/src/auth/auth.controller.ts`)
- Authentication → Audit and notifications: writes audit events (evidence: `apps/api/src/auth/auth.controller.ts`)
- Session access guard → Relational database access: loads user access (evidence: `apps/api/src/common/access.service.ts`)
- Junction records → Relational database access: queries records (evidence: `apps/api/src/modules/junctions.module.ts`)
- Relational database access → Application database: persists data
- ERP users → Role workspace: uses workspace
- Role workspace → DPR review: opens work area
- Role workspace → Site reporting: opens work area
- Role workspace → Junction workspace: opens work area
- Role workspace → Billing reconciliation: opens work area
- Role workspace → Store operations: opens work area
- Role workspace → Tech administration: opens work area
- Roles and rules → Session access guard: provides role rules (evidence: `apps/api/src/common/access.service.ts`)
- Roles and rules → Authentication: provides role helpers (evidence: `apps/api/src/auth/auth.controller.ts`)
