# rohitdvv/spark-homes-estimator architecture

> Architecture diagram of the GitHub repository rohitdvv/spark-homes-estimator, 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/rohitdvv/spark-homes-estimator
- Repository: https://github.com/rohitdvv/spark-homes-estimator

## Overview

Spark Homes is an offline-first, single-file PWA for property-acquisition agents. The agent walks a property, captures observations by voice or camera, builds a room-based repair estimate, evaluates deal economics, and hands off a report or workbook. README capabilities are represented using the documented `index.html` implementation; its source was not included in the excerpts, so internal call wiring is shown only where the README or sampled service-worker code supports it.

Main entry points: [`index.html`](https://github.com/rohitdvv/spark-homes-estimator/blob/main/index.html) (Estimator App), [`sw.js`](https://github.com/rohitdvv/spark-homes-estimator/blob/main/sw.js) (Service Worker), [`manifest.json`](https://github.com/rohitdvv/spark-homes-estimator/blob/main/manifest.json) (PWA Shell)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_field["Field Inspection"]
  node_app["Estimator App<br/>[index.html]"]
  node_walkthrough["Voice Walkthrough<br/>[index.html]"]
  node_capture["Photo Capture<br/>[index.html]"]
  node_ocr["Serial OCR<br/>[index.html]"]
  node_scope["Scope Detection<br/>[index.html]"]
end

subgraph group_analysis["Estimate &amp; Analysis"]
  node_estimate["Room Estimate<br/>[index.html]"]
  node_copilot["Copilot Agents<br/>[index.html]"]
  node_retrieval["Guidance Retrieval<br/>[index.html]"]
  node_deal["Deal Analyzer<br/>[index.html]"]
end

subgraph group_handoff["Handoff &amp; Records"]
  node_notes["Inspection Notes<br/>[index.html]"]
  node_history["History &amp; Snapshots<br/>[index.html]"]
  node_sharing["QR &amp; Link Sharing<br/>[index.html]"]
  node_export["Report &amp; Workbook<br/>[index.html]"]
end

subgraph group_offline["Offline Platform"]
  node_localstore[("Local Project Data<br/>[index.html]")]
  node_pwa["PWA Shell<br/>[manifest.json]"]
  node_worker["Service Worker<br/>[sw.js]"]
end

node_agent(("Acquisition Agent"))
node_models["On-device Models"]
node_browser["Browser APIs"]
node_recipient(("Client / Office"))

node_agent -->|"uses"| node_app
node_app -->|"dispatches"| node_walkthrough
node_app -->|"dispatches"| node_capture
node_capture -->|"reads serials"| node_ocr
node_capture -->|"requests suggestions"| node_scope
node_walkthrough -->|"fills scope"| node_estimate
node_scope -->|"suggests items"| node_estimate
node_app -->|"edits scope"| node_estimate
node_app -->|"dispatches"| node_copilot
node_copilot -->|"queries guidance"| node_retrieval
node_app -->|"opens analysis"| node_deal
node_deal -->|"reads total"| node_estimate
node_app -->|"records"| node_notes
node_app -->|"manages snapshots"| node_history
node_app -->|"shares estimate"| node_sharing
node_app -->|"exports"| node_export
node_export -->|"delivers report"| node_recipient
node_sharing -->|"transfers estimate"| node_recipient
node_app -->|"persists projects"| node_localstore
node_app -->|"uses speech and camera"| node_browser
node_walkthrough -.->|"transcribes offline"| node_models
node_scope -.->|"classifies images"| node_models
node_retrieval -.->|"embeds queries"| node_models
node_pwa -->|"registers offline shell"| node_worker
node_worker -->|"caches app"| node_app
node_worker -.->|"caches assets"| node_models

click node_app "https://github.com/rohitdvv/spark-homes-estimator/blob/main/index.html"
click node_walkthrough "https://github.com/rohitdvv/spark-homes-estimator/blob/main/index.html"
click node_capture "https://github.com/rohitdvv/spark-homes-estimator/blob/main/index.html"
click node_ocr "https://github.com/rohitdvv/spark-homes-estimator/blob/main/index.html"
click node_scope "https://github.com/rohitdvv/spark-homes-estimator/blob/main/index.html"
click node_estimate "https://github.com/rohitdvv/spark-homes-estimator/blob/main/index.html"
click node_copilot "https://github.com/rohitdvv/spark-homes-estimator/blob/main/index.html"
click node_retrieval "https://github.com/rohitdvv/spark-homes-estimator/blob/main/index.html"
click node_deal "https://github.com/rohitdvv/spark-homes-estimator/blob/main/index.html"
click node_notes "https://github.com/rohitdvv/spark-homes-estimator/blob/main/index.html"
click node_history "https://github.com/rohitdvv/spark-homes-estimator/blob/main/index.html"
click node_sharing "https://github.com/rohitdvv/spark-homes-estimator/blob/main/index.html"
click node_export "https://github.com/rohitdvv/spark-homes-estimator/blob/main/index.html"
click node_localstore "https://github.com/rohitdvv/spark-homes-estimator/blob/main/index.html"
click node_pwa "https://github.com/rohitdvv/spark-homes-estimator/blob/main/manifest.json"
click node_worker "https://github.com/rohitdvv/spark-homes-estimator/blob/main/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_app,node_walkthrough,node_capture,node_ocr,node_scope,node_browser,node_recipient toneBlue
class node_estimate,node_copilot,node_retrieval,node_deal toneAmber
class node_notes,node_history,node_sharing,node_export toneMint
class node_localstore,node_pwa,node_worker toneRose
class node_agent,node_models toneIndigo
```

## Components

### Field Inspection

- [Estimator App](https://github.com/rohitdvv/spark-homes-estimator/blob/main/index.html): `index.html`
- [Voice Walkthrough](https://github.com/rohitdvv/spark-homes-estimator/blob/main/index.html): `index.html`
- [Photo Capture](https://github.com/rohitdvv/spark-homes-estimator/blob/main/index.html): `index.html`
- [Serial OCR](https://github.com/rohitdvv/spark-homes-estimator/blob/main/index.html): `index.html`
- [Scope Detection](https://github.com/rohitdvv/spark-homes-estimator/blob/main/index.html): `index.html`

### Estimate & Analysis

- [Room Estimate](https://github.com/rohitdvv/spark-homes-estimator/blob/main/index.html): `index.html`
- [Copilot Agents](https://github.com/rohitdvv/spark-homes-estimator/blob/main/index.html): `index.html`
- [Guidance Retrieval](https://github.com/rohitdvv/spark-homes-estimator/blob/main/index.html): `index.html`
- [Deal Analyzer](https://github.com/rohitdvv/spark-homes-estimator/blob/main/index.html): `index.html`

### Handoff & Records

- [Inspection Notes](https://github.com/rohitdvv/spark-homes-estimator/blob/main/index.html): `index.html`
- [History & Snapshots](https://github.com/rohitdvv/spark-homes-estimator/blob/main/index.html): `index.html`
- [QR & Link Sharing](https://github.com/rohitdvv/spark-homes-estimator/blob/main/index.html): `index.html`
- [Report & Workbook](https://github.com/rohitdvv/spark-homes-estimator/blob/main/index.html): `index.html`

### Offline Platform

- [Local Project Data](https://github.com/rohitdvv/spark-homes-estimator/blob/main/index.html): `index.html`
- [PWA Shell](https://github.com/rohitdvv/spark-homes-estimator/blob/main/manifest.json): `manifest.json`
- [Service Worker](https://github.com/rohitdvv/spark-homes-estimator/blob/main/sw.js): `sw.js`

### Other components

- **Acquisition Agent**
- **On-device Models**
- **Browser APIs**
- **Client / Office**

## Connections

- Acquisition Agent → Estimator App: uses
- Estimator App → Voice Walkthrough: dispatches
- Estimator App → Photo Capture: dispatches
- Photo Capture → Serial OCR: reads serials
- Photo Capture → Scope Detection: requests suggestions
- Voice Walkthrough → Room Estimate: fills scope
- Scope Detection → Room Estimate: suggests items
- Estimator App → Room Estimate: edits scope
- Estimator App → Copilot Agents: dispatches
- Copilot Agents → Guidance Retrieval: queries guidance
- Estimator App → Deal Analyzer: opens analysis
- Deal Analyzer → Room Estimate: reads total
- Estimator App → Inspection Notes: records
- Estimator App → History & Snapshots: manages snapshots
- Estimator App → QR & Link Sharing: shares estimate
- Estimator App → Report & Workbook: exports
- Report & Workbook → Client / Office: delivers report
- QR & Link Sharing → Client / Office: transfers estimate
- Estimator App → Local Project Data: persists projects
- Estimator App → Browser APIs: uses speech and camera
- Voice Walkthrough → On-device Models: transcribes offline
- Scope Detection → On-device Models: classifies images
- Guidance Retrieval → On-device Models: embeds queries
- PWA Shell → Service Worker: registers offline shell
- Service Worker → Estimator App: caches app
- Service Worker → On-device Models: caches assets
