# abedrrahman/hvac-maintenance-app architecture

> Architecture diagram of the GitHub repository abedrrahman/hvac-maintenance-app, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/abedrrahman/hvac-maintenance-app
- Repository: https://github.com/abedrrahman/hvac-maintenance-app

## Overview

This is an offline HVAC maintenance reporting app. A technician selects a machine, creates a report, completes its staged checklist and supporting details, captures photos and signatures, then exports a PDF; reports and machine records remain on-device. The graph also includes machine/template administration and report search. Sampled source shows the main screen, repository, checklist, and PDF relationships; some feature links rely on README documentation because their implementation files were not sampled.

Main entry points: [`db/repositories/reports.ts`](https://github.com/abedrrahman/hvac-maintenance-app/blob/v2/db/repositories/reports.ts) (Report repository), [`db/repositories/machines.ts`](https://github.com/abedrrahman/hvac-maintenance-app/blob/v2/db/repositories/machines.ts) (Machine repository), [`app/report/[id]/[step].tsx`](https://github.com/abedrrahman/hvac-maintenance-app/blob/v2/app/report/%5Bid%5D/%5Bstep%5D.tsx) (Report wizard), [`services/pdfGenerator.ts`](https://github.com/abedrrahman/hvac-maintenance-app/blob/v2/services/pdfGenerator.ts) (PDF generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Report workflow"]
  node_report_list["Report list<br/>[index.tsx]"]
  node_report_search["Search and filters<br/>[reports.tsx]"]
  node_new_report["New report<br/>[new.tsx]"]
  node_report_wizard["Report wizard<br/>[&#91;step&#93;.tsx]"]
  node_report_view["Report preview<br/>[view.tsx]"]
  node_form_components["Form components"]
  node_report_hook["Report loader<br/>[useReport.ts]"]
end

subgraph group_domain["HVAC domain"]
  node_machine_catalog["Machine catalog<br/>[index.tsx]"]
  node_machine_detail["Machine details<br/>[&#91;id&#93;.tsx]"]
  node_custom_templates["Custom templates"]
  node_checklist_templates["Checklist definitions<br/>[checklists.ts]"]
  node_chiller_fields["Dynamic chiller fields<br/>[chillerFields.ts]"]
end

subgraph group_storage["Local data"]
  node_report_repository["Report repository<br/>[reports.ts]"]
  node_machine_repository["Machine repository<br/>[machines.ts]"]
  node_sqlite[("SQLite database<br/>[database.ts]")]
  node_database_provider["Database provider"]
end

subgraph group_output["Report output"]
  node_pdf_generator["PDF generator<br/>[pdfGenerator.ts]"]
  node_share_sheet["Native share sheet"]
end

node_technician(("Technician"))

node_technician -->|"opens"| node_report_list
node_technician -->|"starts report"| node_new_report
node_technician -->|"completes steps"| node_report_wizard
node_technician -->|"manages machines"| node_machine_catalog
node_technician -->|"edits templates"| node_custom_templates
node_report_list -->|"loads reports"| node_report_repository
node_report_search -->|"searches reports"| node_report_repository
node_new_report -->|"creates report"| node_report_repository
node_new_report -->|"selects machine"| node_machine_repository
node_machine_catalog -->|"loads machines"| node_machine_repository
node_machine_detail -->|"loads machine"| node_machine_repository
node_machine_detail -->|"loads history"| node_report_repository
node_report_wizard -->|"saves report"| node_report_repository
node_report_wizard -->|"renders checklist"| node_checklist_templates
node_report_wizard -->|"renders fields"| node_form_components
node_form_components -->|"uses definitions"| node_checklist_templates
node_checklist_templates -->|"builds chiller fields"| node_chiller_fields
node_report_view -->|"loads report"| node_report_hook
node_report_hook -->|"fetches full report"| node_report_repository
node_report_view -->|"exports PDF"| node_pdf_generator
node_report_repository -->|"reads and writes"| node_sqlite
node_machine_repository -->|"reads and writes"| node_sqlite
node_database_provider -->|"initializes"| node_sqlite
node_report_repository -->|"uses machine templates"| node_machine_repository
node_pdf_generator -->|"formats checklist"| node_checklist_templates
node_pdf_generator -->|"formats chiller data"| node_chiller_fields
node_pdf_generator -->|"offers export"| node_share_sheet

click node_report_list "https://github.com/abedrrahman/hvac-maintenance-app/blob/v2/app/index.tsx"
click node_report_search "https://github.com/abedrrahman/hvac-maintenance-app/blob/v2/app/reports.tsx"
click node_new_report "https://github.com/abedrrahman/hvac-maintenance-app/blob/v2/app/new.tsx"
click node_report_wizard "https://github.com/abedrrahman/hvac-maintenance-app/blob/v2/app/report/%5Bid%5D/%5Bstep%5D.tsx"
click node_report_view "https://github.com/abedrrahman/hvac-maintenance-app/blob/v2/app/report/%5Bid%5D/view.tsx"
click node_machine_catalog "https://github.com/abedrrahman/hvac-maintenance-app/blob/v2/app/machines/index.tsx"
click node_machine_detail "https://github.com/abedrrahman/hvac-maintenance-app/blob/v2/app/machines/%5Bid%5D.tsx"
click node_custom_templates "https://github.com/abedrrahman/hvac-maintenance-app/blob/v2/app/custom-templates.tsx"
click node_checklist_templates "https://github.com/abedrrahman/hvac-maintenance-app/blob/v2/constants/checklists.ts"
click node_chiller_fields "https://github.com/abedrrahman/hvac-maintenance-app/blob/v2/utils/chillerFields.ts"
click node_form_components "https://github.com/abedrrahman/hvac-maintenance-app/blob/v2/components/ChecklistSection.tsx"
click node_report_hook "https://github.com/abedrrahman/hvac-maintenance-app/blob/v2/hooks/useReport.ts"
click node_report_repository "https://github.com/abedrrahman/hvac-maintenance-app/blob/v2/db/repositories/reports.ts"
click node_machine_repository "https://github.com/abedrrahman/hvac-maintenance-app/blob/v2/db/repositories/machines.ts"
click node_sqlite "https://github.com/abedrrahman/hvac-maintenance-app/blob/v2/db/database.ts"
click node_database_provider "https://github.com/abedrrahman/hvac-maintenance-app/blob/v2/context/DatabaseProvider.tsx"
click node_pdf_generator "https://github.com/abedrrahman/hvac-maintenance-app/blob/v2/services/pdfGenerator.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_report_list,node_report_search,node_new_report,node_report_wizard,node_report_view,node_form_components,node_report_hook toneBlue
class node_machine_catalog,node_machine_detail,node_custom_templates,node_checklist_templates,node_chiller_fields toneAmber
class node_report_repository,node_machine_repository,node_sqlite,node_database_provider toneMint
class node_pdf_generator,node_share_sheet toneRose
class node_technician toneIndigo
```

## Components

### Report workflow

- [Report list](https://github.com/abedrrahman/hvac-maintenance-app/blob/v2/app/index.tsx): `app/index.tsx`
- [Search and filters](https://github.com/abedrrahman/hvac-maintenance-app/blob/v2/app/reports.tsx): `app/reports.tsx`
- [New report](https://github.com/abedrrahman/hvac-maintenance-app/blob/v2/app/new.tsx): `app/new.tsx`
- [Report wizard](https://github.com/abedrrahman/hvac-maintenance-app/blob/v2/app/report/%5Bid%5D/%5Bstep%5D.tsx): `app/report/[id]/[step].tsx`
- [Report preview](https://github.com/abedrrahman/hvac-maintenance-app/blob/v2/app/report/%5Bid%5D/view.tsx): `app/report/[id]/view.tsx`
- [Form components](https://github.com/abedrrahman/hvac-maintenance-app/blob/v2/components/ChecklistSection.tsx): `components/ChecklistSection.tsx`
- [Report loader](https://github.com/abedrrahman/hvac-maintenance-app/blob/v2/hooks/useReport.ts): `hooks/useReport.ts`

### HVAC domain

- [Machine catalog](https://github.com/abedrrahman/hvac-maintenance-app/blob/v2/app/machines/index.tsx): `app/machines/index.tsx`
- [Machine details](https://github.com/abedrrahman/hvac-maintenance-app/blob/v2/app/machines/%5Bid%5D.tsx): `app/machines/[id].tsx`
- [Custom templates](https://github.com/abedrrahman/hvac-maintenance-app/blob/v2/app/custom-templates.tsx): `app/custom-templates.tsx`
- [Checklist definitions](https://github.com/abedrrahman/hvac-maintenance-app/blob/v2/constants/checklists.ts): `constants/checklists.ts`
- [Dynamic chiller fields](https://github.com/abedrrahman/hvac-maintenance-app/blob/v2/utils/chillerFields.ts): `utils/chillerFields.ts`

### Local data

- [Report repository](https://github.com/abedrrahman/hvac-maintenance-app/blob/v2/db/repositories/reports.ts): `db/repositories/reports.ts`
- [Machine repository](https://github.com/abedrrahman/hvac-maintenance-app/blob/v2/db/repositories/machines.ts): `db/repositories/machines.ts`
- [SQLite database](https://github.com/abedrrahman/hvac-maintenance-app/blob/v2/db/database.ts): `db/database.ts`
- [Database provider](https://github.com/abedrrahman/hvac-maintenance-app/blob/v2/context/DatabaseProvider.tsx): `context/DatabaseProvider.tsx`

### Report output

- [PDF generator](https://github.com/abedrrahman/hvac-maintenance-app/blob/v2/services/pdfGenerator.ts): `services/pdfGenerator.ts`
- **Native share sheet**

### Other components

- **Technician**

## Connections

- Technician → Report list: opens
- Technician → New report: starts report
- Technician → Report wizard: completes steps
- Technician → Machine catalog: manages machines
- Technician → Custom templates: edits templates
- Report list → Report repository: loads reports (evidence: `app/index.tsx`)
- Search and filters → Report repository: searches reports (evidence: `app/reports.tsx`)
- New report → Report repository: creates report (evidence: `app/new.tsx`)
- New report → Machine repository: selects machine (evidence: `app/new.tsx`)
- Machine catalog → Machine repository: loads machines (evidence: `app/machines/index.tsx`)
- Machine details → Machine repository: loads machine (evidence: `app/machines/[id].tsx`)
- Machine details → Report repository: loads history (evidence: `app/machines/[id].tsx`)
- Report wizard → Report repository: saves report (evidence: `app/report/[id]/[step].tsx`)
- Report wizard → Checklist definitions: renders checklist (evidence: `app/report/[id]/[step].tsx`)
- Report wizard → Form components: renders fields (evidence: `app/report/[id]/[step].tsx`)
- Form components → Checklist definitions: uses definitions (evidence: `components/ChecklistSection.tsx`)
- Checklist definitions → Dynamic chiller fields: builds chiller fields (evidence: `constants/checklists.ts`)
- Report preview → Report loader: loads report (evidence: `app/report/[id]/view.tsx`)
- Report loader → Report repository: fetches full report (evidence: `hooks/useReport.ts`)
- Report preview → PDF generator: exports PDF (evidence: `app/report/[id]/view.tsx`)
- Report repository → SQLite database: reads and writes (evidence: `db/repositories/reports.ts`)
- Machine repository → SQLite database: reads and writes (evidence: `db/repositories/machines.ts`)
- Database provider → SQLite database: initializes (evidence: `context/DatabaseProvider.tsx`)
- Report repository → Machine repository: uses machine templates (evidence: `db/repositories/reports.ts`)
- PDF generator → Checklist definitions: formats checklist (evidence: `services/pdfGenerator.ts`)
- PDF generator → Dynamic chiller fields: formats chiller data (evidence: `services/pdfGenerator.ts`)
- PDF generator → Native share sheet: offers export
