Information

Architecture diagrams and process maps for PlumbCalc

Architecture Overview

Tech Stack

  • Next.js 15 (App Router)
  • TypeScript + React 19
  • Tailwind CSS v4
  • shadcn/ui components
  • Lucide React icons
  • Recharts (analytics charts)
  • Mermaid.js (info diagrams)

Data Layer

  • JSON file storage (no database)
  • price-list.json — 95 trade items
  • estimates.json — saved estimates
  • surveys.json — saved surveys
  • customers.json — customer records
  • company-profile.json — settings
  • maintenance-jobs.json — callouts
  • API routes for CRUD operations

Key Features

  • 5 job estimators (live calculation)
  • Survey wizard (8 scopes)
  • Quote workflow (send/track)
  • Invoice & payment tracking
  • Customer management
  • Analytics dashboard + charts
  • Heat loss calculator
  • Pipework calculator (20 runs)
  • Job scheduling & tracking
  • Maintenance callout workflow
  • PWA with offline support
  • PDF via browser print
  • VAT: 20% UK standard rate

Project Structure

src/app/Pages and API routes (App Router)
src/components/Reusable UI + layout components
src/lib/Business logic, stores, analytics, utilities
src/types/TypeScript interfaces
src/hooks/Custom React hooks (sync status)
data/JSON file storage (gitignored)
public/PWA manifest, service worker, icons
docs/Process maps, wireframes, activity log
Colour Scheme

Dark Blue

#2C3E50

Headers, sidebar

Mid Blue

#34495E

Sub-headers

Light Blue

#D4E6F1

Totals rows

Yellow

#FFFFCC

Input fields

Grey

#BDC3C7

Column headers

Green

#27AE60

Success, paid

Red

#C0392B

Alerts, costs

Process Maps

Click any section to expand and view the Mermaid diagram. 14 diagrams covering all app capabilities.

Price Categories Reference
Copper Pipe
Plastic Push-Fit
Copper Fittings
Push-Fit Fittings
Sanitaryware
Waste & Soil
Heating
Hot Water
Kitchen
Sundries
Labour
Estimator Line Items
EstimatorLine ItemsKey Items
Full RefurbishmentCombinedCombines all 4 job types into sections with enable/disable toggles, property overview
Bathroom22Toilet, basin, bath, shower, taps, pipes, fittings, labour, tiling
Central Heating18Boiler, radiators, TRVs, controls, programmer, filter, pipes
Kitchen13Sink, tap, dishwasher valve, washing machine valve, pipes
Hot Water13Cylinder types, immersion, expansion vessel, PRV, pipes
Status Lifecycle Reference

Quote Status

Draft
Sent
Viewed
Accepted
Rejected
Expired

Invoice Status

Not Invoiced
Invoiced
Paid
Overdue
Void

Job Status

Unscheduled
Booked
In Progress
Completed
On Hold

Maintenance Status

Reported
Scheduled
Diagnosed
Quoted
Approved
In Progress
Completed
Invoiced
Paid