SWAG Estimates
Capital project estimating at any scale.
A modern web-based estimating platform for major industrial construction — factories, manufacturing plants, wind farms, power plants, and beyond. Built from an Excel system that evolved over 30 years of in-field use and has priced some of the largest capital projects in the world.
Overview
Large industrial capital projects — greenfield factories, manufacturing plant redesigns, wind energy installations, municipal power plants — require cost estimates that span dozens of disciplines: civil, structural, mechanical, piping, electrical, production equipment, subcontractors, and more. Managing that across a maze of spreadsheets means version confusion, broken formulas, and no single source of truth.
SWAG Estimates replaces that maze with one structured estimating platform. It was born from a multi-sheet Excel system refined over 30 years of in-field use, pricing projects at the scale of full manufacturing plant builds, factory overhauls, utility-scale wind farms, city power plants, and — at its most ambitious — the world's largest concrete plant (at the time of construction).
The application converts that Excel methodology into a modern, offline-capable web app. Estimates are organized into the same discipline-level worksheets as the original system — 18 tabs covering everything from Engineering and Civil through Structural Steel, Piping, Electrical, Rental Equipment, and Subcontractor breakdowns — with 1,453 input fields and 5,121 live formula cells that update in real time across all sheets the moment any input changes.
New estimates are generated from a master template: enter a project number and client name, and the system clones the template — clearing prior project data while preserving every formula, label, and cross-sheet dependency — so estimators start fresh with a fully wired structure every time. Existing estimates can be imported directly from .xlsx files; the parser reads each cell's type, value, and number format and maps currencies, percentages, and dates to the appropriate UI inputs automatically.
Offline-first architecture means estimators can work in the field, in a trailer, or anywhere connectivity is unreliable. Edits are cached locally in the browser and pushed to the cloud database when a connection is restored. The dashboard gives project managers a live view of all estimates by status — Draft, In Progress, or Completed — with full CRUD controls.
What you get
- Battle-tested estimating structure — 18 discipline worksheets mirroring a methodology proven on some of the largest industrial capital projects ever priced.
- Live cross-sheet formula engine — 5,121 computed cells update in real time as inputs change, replicating the full Excel formula dependency graph in the browser via HyperFormula.
- Template-based estimate generation — create a new project in seconds; the system clones the master template, clears prior data, and leaves a fully wired estimate ready for input.
- Excel import — drag in an existing .xlsx file; the parser identifies every cell's role (input, formula, label), maps currency and percentage formats to the right UI components, and converts dates to UTC for storage.
- Offline-first operation — works without internet; edits queue locally in IndexedDB and sync to the cloud database automatically when connectivity returns.
- Estimate dashboard — row-based CRUD list of all estimates with status (Draft / In Progress / Completed), edit, duplicate, and delete controls.
- Flexible sidebar navigation — the discipline worksheet menu can be docked left, right, or hidden, with per-user preferences persisted to the database.
- User preferences — timezone, date format (MM/DD/YYYY or DD/MM/YYYY), and UI layout stored per user and synced across sessions.
- Multi-tenant cloud deployment — Docker + PostgreSQL architecture ready for AWS EC2; each client's data is isolated and the stack runs the same in development and production.
Estimate worksheets
Every estimate is structured across 18 discipline tabs, matching the breakdown used on real capital projects. The Summary sheet rolls up totals from all discipline sheets in real time.
| Worksheet | Covers |
|---|---|
| Large Job Status Review | High-level project status dashboard across all active estimates. |
| Breakdown | Top-level cost breakdown structure linking all discipline totals. |
| BME Breakdown | Bulk material and equipment cost breakdown detail. |
| Summary | Consolidated project total — the deliverable sheet presented to stakeholders. |
| Engineering | Engineering fees, design hours, and deliverable costs. |
| Misc. | Miscellaneous project costs, temporary facilities, and allowances. |
| Demolition | Demolition and abatement scope and unit costs. |
| Civil | Site work, grading, foundations, concrete, and civil infrastructure. |
| Electrical | Power distribution, instrumentation, lighting, and electrical installation. |
| Mechanical | HVAC, process equipment, and mechanical systems. |
| Piping | Process piping, fittings, insulation, and testing. |
| Structural Steel | Structural steel fabrication, erection, and connections. |
| Rental Equipment | Cranes, lifts, and heavy equipment rental durations and rates. |
| Fixture Schedule | Fixtures, fittings, and installed items by area. |
| Production Equipment | Process and production equipment procurement costs. |
| Subcontractor | Subcontractor scopes, bid comparisons, and award values. |
| Drop Downs | Reference lists and controlled vocabulary for data-entry consistency. |
| Estimate Rates | Labor rates, burden factors, and unit cost basis for the entire estimate. |
Technology stack
Application
| Layer | Technology | Notes |
|---|---|---|
| Framework | Next.js 16 | App Router; runs on port 4173 in dev and production. |
| Language | TypeScript 5 | Strict typing across all application and data layers. |
| UI library | React 19 | Component-based UI with server and client components via Next.js App Router. |
| Styling | Tailwind CSS 4 | Utility-first CSS; dark-mode design system. |
| Icons | Lucide React | Consistent icon set for CRUD controls, navigation, and status indicators. |
Formula engine
| Layer | Technology | Notes |
|---|---|---|
| Formula evaluation | HyperFormula | Browser-side formula engine that mirrors Excel cross-sheet dependencies. All 5,121 computed cells update in real time as inputs change. |
| Excel parsing | ExcelJS | Deep cell-by-cell parse of .xlsx imports: identifies inputs, formulas, and labels; maps Excel number formats (currency, percentage, date) to UI components. |
Offline storage & sync
| Layer | Technology | Notes |
|---|---|---|
| Local cache | Dexie.js (IndexedDB) | Caches estimates and worksheet entries in the browser; edits work fully offline. |
| Sync engine | Mutation queue | Offline edits are queued and pushed to the server when connectivity is restored; idempotent by composite key. |
Data & persistence
| Layer | Technology | Notes |
|---|---|---|
| Database | PostgreSQL | Production relational store for estimates and worksheet entries. |
| Driver | pg + @prisma/adapter-pg | Node.js PostgreSQL driver wired through Prisma's adapter layer. |
| ORM | Prisma 7 | Type-safe database access; schema defines Estimate and WorksheetEntry models. All timestamps stored as UTC. |
Deployment & operations
| Item | Details |
|---|---|
| Docker | Next.js app image plus PostgreSQL via Compose; identical stack in development and production. |
| AWS EC2 | Cloud deployment target; port 4173 exposed through the nginx ingress layer. |
| Scripts | PowerShell deploy and EC2 management helpers (zdeploy.ps1, zec2.ps1) for build, upload, and restart workflows. |
The estimate data model uses a composite cell key
(estimateId::worksheetName::cellAddress) so that cloud sync and offline
mutations are fully idempotent — the same edit applied twice produces the same result.