← Back to Projects

Brannack Electric Estimate Generator

An AI-powered estimating tool for a Hartford, CT electrical contractor — built for a real client pitch and an Applied AI final simultaneously. Enter job details, get a professional estimate in under 60 seconds, download a branded PDF.

React Vite Gemini API Prompt Engineering PDF Generation AI Application

The Problem

Small electrical contractors lose commercial jobs because their estimates are slow and unprofessional — emails, Word docs, handwritten notes. Competitors delivering clean, itemized PDFs win the bid. Tim Brannack at Brannack Electric, a Hartford, CT operation in business since 1980, needed a faster workflow without hiring an office manager or learning new software.

The Solution

A browser-based React app where Tim enters job details into a form — client, address, job type, scope, materials, estimated hours — hits Generate, and receives a complete professional estimate with a one-click PDF download. No backend, no accounts, no setup. It runs entirely in the browser using the Gemini API.

The same project served two purposes: a real-world client proof-of-concept for Brannack Electric, and the final project for AI 202 Applied AI at Bryant University.

How It Works

  • User fills out a job details form (client info, job type, scope, materials, hours)
  • Structured prompt sends form data to Gemini 2.0 Flash with responseMimeType: application/json to enforce clean output
  • AI generates itemized line items, labor, material markup, and CT sales tax
  • Hardcoded business rules keep results consistent: $95/hr labor, 20% materials markup, 6.35% CT tax
  • Estimate preview renders instantly; html2canvas + jsPDF exports a branded PDF
  • API key modal on first load — no persistence, no backend required

Prompt Engineering

The Prompt Lab tab in the app documents three iterations of the generation prompt. v1 returned unstructured text that was hard to parse. v2 added JSON enforcement but still produced inconsistent line item formatting. v3 locked the schema with explicit field names and business rule constraints, which resolved the math reliability issue and made the rendered output predictable.

Testing Results

Five scenarios were tested to stress the system across normal and edge case inputs. The math engine proved reliable; the risk is input quality, not arithmetic.

Scenario Result Note
Normal Case — commercial panel upgrade Pass Clean output, math verified
Small Simple Job — EV charger install Pass $508.34 total, math perfect
Math Verification — 6 calculated values Pass All 6 values matched exactly
Vague Input — "needs rewiring done" Fail $1,780 estimate; real cost $8K–$15K. No warning shown.
Out of Scope — solar + fleet EV Fail $42,022 with no scope disclaimer

What Makes It Interesting

Two birds, one stone: the project was designed to satisfy a real client need and a course rubric at the same time, which forced every design decision to be practical rather than academic.

The failure modes are documented, not hidden. Vague input produces confident but wrong estimates with no user warning — that's a real limitation, and it's a more honest finding than most student projects surface. The interesting story is that the math engine is reliable but the system fails silently on bad input, which is exactly the kind of thing a production version would need to address.

The Prompt Lab tab shows three real iterations of the generation prompt, including what broke in each version. Most AI demos skip this entirely. Including it is the difference between a demo and a project.


← Previous: Barnum Lawn All Projects →