CASE 01 / 04BUILDMETRICS AI   /   FIELD NOTESCLOSE [ESC] ×
// 01   SUMMARY READOUT

BuildMetrics AI

Moved a construction project-controls SaaS to Next.js 14 and made its heaviest workflows fast.

ROLEFull Stack Engineer
DATES / ENGAGEMENTCONTRACT · JUL 2026 TO PRESENT
STACKNext.js 14 · TypeScript · Supabase · Web Workers
// 02  THE PROBLEM

A construction project-controls SaaS had outgrown its React/Vite setup. The main dashboard was a single ~3,100-line component, large bill-of-quantities (BOQ) tables froze the browser, and data loaded through a chain of sequential queries.

// 03  WHAT I BUILT
01 / TECHNICAL DECISION

Move the application boundary

Migrated 57 routes to Next.js 14 App Router, with Supabase SSR authentication and middleware. The server owns access checks before a protected screen renders.

57 routes → App Router → SSR auth → middleware
02 / TECHNICAL DECISION

Make the dashboard understandable

Split the ~3,100-line dashboard into modular views, calculation services and export hooks. Enforced the API/data-access boundary with strict TypeScript and ESLint.

views → services → data access
          ↘ export hooks
03 / TECHNICAL DECISION

Keep heavy work off the interface

Virtualized BOQ tables with TanStack React Virtual. Moved Excel and PDF processing into Web Workers so exports no longer compete with interface work on the main thread.

visible rows → virtual window
exports → worker → download
04 / TECHNICAL DECISION

Retrieve data together

Replaced an O(N) Supabase query waterfall with consolidated server-side retrieval. The client requests the result in one round trip.

sequential requests → server retrieval → 1 round trip
05 / TECHNICAL DECISION

Put limits around AI

Added grounded validation of AI-generated narratives and database-backed usage limits. Validation and account limits sit alongside the feature rather than relying on the prompt alone.

request → account limit → generation → validation
// 04  RESULTS / KNOWN NUMBERS
57ROUTES MIGRATED
~3,100LINE DASHBOARD → MODULES
1CONSOLIDATED ROUND TRIP
// 05  SYSTEM ARCHITECTURE
FIG. 01 — SYSTEM MAPARCHITECTURE / NOT A PRODUCT SCREEN
01INTERFACE
02API BOUNDARY
03SERVER RETRIEVAL
04SUPABASE
Interfaces are only one part of the system.
// 06  WHAT I’D DO NEXT

I would add repeatable performance budgets around the largest BOQ datasets and export paths, and trace server retrieval separately from rendering. That would make regressions visible before users encounter them, and provide measured timings for the next iteration.

DISCUSS A PROJECT ↗