# git-happens-sih/project-reality-os architecture

> Architecture diagram of the GitHub repository git-happens-sih/project-reality-os, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/git-happens-sih/project-reality-os
- Repository: https://github.com/git-happens-sih/project-reality-os

## Overview

Nirmaan Setu is a browser-based construction progress reporting and planner-review demo. The principal workflow is: an engineer drafts and submits a site report; the local demo matches report text to work tasks; the engineer confirms suggested tasks; a planner approves or rejects them; approvals update dashboard progress and the audit trail. The sampled code explicitly describes local-only storage and keyword matching, not server sync or trained AI. The page tree documents additional auth, onboarding, settings, FAQ, and recommendation experiences; their internal wiring is not established by the sampled excerpts.

Main entry points: [`ns-demo.js`](https://github.com/git-happens-sih/project-reality-os/blob/main/ns-demo.js) (Demo UI controller), [`ns-demo-core.js`](https://github.com/git-happens-sih/project-reality-os/blob/main/ns-demo-core.js) (Demo domain model), [`nirmaan-setu-planner-review.html`](https://github.com/git-happens-sih/project-reality-os/blob/main/nirmaan-setu-planner-review.html) (Planner review), [`nirmaan-setu-site-report.html`](https://github.com/git-happens-sih/project-reality-os/blob/main/nirmaan-setu-site-report.html) (Site report)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_reporting["Field reporting"]
  node_report["Site report"]
  node_matching["Match confirmation"]
  node_processing["Processing screen"]
end

subgraph group_review["Planner review"]
  node_planner_review["Planner review"]
  node_conflict["Delay conflict"]
  node_dashboard["Project dashboard"]
  node_history["Audit history"]
  node_sync["Sync status"]
end

subgraph group_app["App experience"]
  node_landing["Landing page"]
  node_auth["Authentication"]
  node_auth_steps["Auth flows"]
  node_onboarding["Onboarding"]
  node_settings["Settings"]
  node_faq["FAQ"]
  node_recommendations["Recommendations"]
end

subgraph group_local["Local runtime"]
  node_controller["Demo UI controller<br/>[ns-demo.js]"]
  node_domain["Demo domain model<br/>[ns-demo-core.js]"]
  node_browser_store[("Browser storage")]
  node_service_worker["Offline page cache<br/>[ns-sw.js]"]
end

node_engineer(("Engineer"))
node_planner(("Planner"))

node_engineer -->|"writes report"| node_report
node_report -->|"handles form"| node_controller
node_controller -->|"submits report"| node_domain
node_domain -->|"reads and writes"| node_browser_store
node_controller -->|"loads demo state"| node_browser_store
node_controller -->|"navigates"| node_processing
node_controller -->|"navigates"| node_matching
node_matching -->|"confirms tasks"| node_controller
node_controller -->|"matches and confirms"| node_domain
node_controller -->|"navigates"| node_planner_review
node_planner -->|"reviews queue"| node_planner_review
node_planner_review -->|"approves or rejects"| node_controller
node_controller -->|"records decision"| node_domain
node_controller -->|"renders progress"| node_dashboard
node_controller -->|"renders audit"| node_history
node_controller -->|"opens conflict detail"| node_conflict
node_controller -->|"renders dashboard view"| node_sync
node_controller -->|"registers"| node_service_worker
node_service_worker -->|"caches shell"| node_browser_store
node_landing -.->|"offers entry"| node_auth
node_auth -.->|"continues auth"| node_auth_steps
node_onboarding -.->|"stores preferences"| node_browser_store

click node_report "https://github.com/git-happens-sih/project-reality-os/blob/main/nirmaan-setu-site-report.html"
click node_matching "https://github.com/git-happens-sih/project-reality-os/blob/main/nirmaan-setu-match-confirmation.html"
click node_processing "https://github.com/git-happens-sih/project-reality-os/blob/main/nirmaan-setu-ai-processing.html"
click node_planner_review "https://github.com/git-happens-sih/project-reality-os/blob/main/nirmaan-setu-planner-review.html"
click node_conflict "https://github.com/git-happens-sih/project-reality-os/blob/main/nirmaan-setu-delay-conflict.html"
click node_dashboard "https://github.com/git-happens-sih/project-reality-os/blob/main/nirmaan-setu-dashboard.html"
click node_history "https://github.com/git-happens-sih/project-reality-os/blob/main/nirmaan-setu-history.html"
click node_sync "https://github.com/git-happens-sih/project-reality-os/blob/main/nirmaan-setu-sync.html"
click node_landing "https://github.com/git-happens-sih/project-reality-os/blob/main/nirmaan-setu-landing.html"
click node_auth "https://github.com/git-happens-sih/project-reality-os/blob/main/nirmaan-setu-auth.html"
click node_auth_steps "https://github.com/git-happens-sih/project-reality-os/blob/main/nirmaan-setu-auth-chooser.html"
click node_onboarding "https://github.com/git-happens-sih/project-reality-os/blob/main/nirmaan-setu-onboarding.html"
click node_settings "https://github.com/git-happens-sih/project-reality-os/blob/main/nirmaan-setu-settings.html"
click node_faq "https://github.com/git-happens-sih/project-reality-os/blob/main/nirmaan-setu-faq.html"
click node_recommendations "https://github.com/git-happens-sih/project-reality-os/blob/main/recommendation-card.js"
click node_controller "https://github.com/git-happens-sih/project-reality-os/blob/main/ns-demo.js"
click node_domain "https://github.com/git-happens-sih/project-reality-os/blob/main/ns-demo-core.js"
click node_service_worker "https://github.com/git-happens-sih/project-reality-os/blob/main/ns-sw.js"

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_report,node_matching,node_processing toneBlue
class node_planner_review,node_conflict,node_dashboard,node_history,node_sync toneAmber
class node_landing,node_auth,node_auth_steps,node_onboarding,node_settings,node_faq,node_recommendations toneMint
class node_controller,node_domain,node_browser_store,node_service_worker toneRose
class node_engineer,node_planner toneIndigo
```

## Components

### Field reporting

- [Site report](https://github.com/git-happens-sih/project-reality-os/blob/main/nirmaan-setu-site-report.html): `nirmaan-setu-site-report.html`
- [Match confirmation](https://github.com/git-happens-sih/project-reality-os/blob/main/nirmaan-setu-match-confirmation.html): `nirmaan-setu-match-confirmation.html`
- [Processing screen](https://github.com/git-happens-sih/project-reality-os/blob/main/nirmaan-setu-ai-processing.html): `nirmaan-setu-ai-processing.html`

### Planner review

- [Planner review](https://github.com/git-happens-sih/project-reality-os/blob/main/nirmaan-setu-planner-review.html): `nirmaan-setu-planner-review.html`
- [Delay conflict](https://github.com/git-happens-sih/project-reality-os/blob/main/nirmaan-setu-delay-conflict.html): `nirmaan-setu-delay-conflict.html`
- [Project dashboard](https://github.com/git-happens-sih/project-reality-os/blob/main/nirmaan-setu-dashboard.html): `nirmaan-setu-dashboard.html`
- [Audit history](https://github.com/git-happens-sih/project-reality-os/blob/main/nirmaan-setu-history.html): `nirmaan-setu-history.html`
- [Sync status](https://github.com/git-happens-sih/project-reality-os/blob/main/nirmaan-setu-sync.html): `nirmaan-setu-sync.html`

### App experience

- [Landing page](https://github.com/git-happens-sih/project-reality-os/blob/main/nirmaan-setu-landing.html): `nirmaan-setu-landing.html`
- [Authentication](https://github.com/git-happens-sih/project-reality-os/blob/main/nirmaan-setu-auth.html): `nirmaan-setu-auth.html`
- [Auth flows](https://github.com/git-happens-sih/project-reality-os/blob/main/nirmaan-setu-auth-chooser.html): `nirmaan-setu-auth-chooser.html`
- [Onboarding](https://github.com/git-happens-sih/project-reality-os/blob/main/nirmaan-setu-onboarding.html): `nirmaan-setu-onboarding.html`
- [Settings](https://github.com/git-happens-sih/project-reality-os/blob/main/nirmaan-setu-settings.html): `nirmaan-setu-settings.html`
- [FAQ](https://github.com/git-happens-sih/project-reality-os/blob/main/nirmaan-setu-faq.html): `nirmaan-setu-faq.html`
- [Recommendations](https://github.com/git-happens-sih/project-reality-os/blob/main/recommendation-card.js): `recommendation-card.js`

### Local runtime

- [Demo UI controller](https://github.com/git-happens-sih/project-reality-os/blob/main/ns-demo.js): `ns-demo.js`
- [Demo domain model](https://github.com/git-happens-sih/project-reality-os/blob/main/ns-demo-core.js): `ns-demo-core.js`
- **Browser storage**
- [Offline page cache](https://github.com/git-happens-sih/project-reality-os/blob/main/ns-sw.js): `ns-sw.js`

### Other components

- **Engineer**
- **Planner**

## Connections

- Engineer → Site report: writes report
- Site report → Demo UI controller: handles form
- Demo UI controller → Demo domain model: submits report
- Demo domain model → Browser storage: reads and writes
- Demo UI controller → Browser storage: loads demo state
- Demo UI controller → Processing screen: navigates
- Demo UI controller → Match confirmation: navigates
- Match confirmation → Demo UI controller: confirms tasks
- Demo UI controller → Demo domain model: matches and confirms
- Demo UI controller → Planner review: navigates
- Planner → Planner review: reviews queue
- Planner review → Demo UI controller: approves or rejects
- Demo UI controller → Demo domain model: records decision
- Demo UI controller → Project dashboard: renders progress
- Demo UI controller → Audit history: renders audit
- Demo UI controller → Delay conflict: opens conflict detail
- Demo UI controller → Sync status: renders dashboard view
- Demo UI controller → Offline page cache: registers
- Offline page cache → Browser storage: caches shell
- Landing page → Authentication: offers entry
- Authentication → Auth flows: continues auth
- Onboarding → Browser storage: stores preferences
