Building CalcRig
Welcome to the story behind CalcRig — a calculator app built for the people who actually carry tools. Construction, HVAC, electrical, and plumbing pros need numbers fast, in the field, often without signal. Spreadsheets and chains of "what's the formula again?" Google searches don't cut it on a roof or in a crawlspace. CalcRig replaces that mess with a single mobile app that's offline-first, code-aware, and fast enough to use one-handed.
CalcRig is in active development and shipping new calculators weekly.
The Problem We Set Out to Solve
Every trade has the same three problems on the jobsite: you need a calculation, you need to know the code reference behind it, and you need a record of what you ran two days ago when the inspector asks. The current toolkit for this is a mix of generic calculator apps, paper formula cards taped to truck dashboards, and PDFs of the NEC and IPC that nobody can search on a 5-inch screen with gloves on.
We built CalcRig as one app that handles the calculation, shows the formula and code reference, saves history per project, and lets you export a clean PDF or share a quick text summary with the office — all without a network connection.
Core Features: Trade Math, Done Right
Calculators That Show Their Work
Every CalcRig calculator does three things at once: it gives you the answer, it shows the formula, and it cites the
governing code. Run a voltage drop calculation and you see the result, the Vd = 2 × K × I × L / CM derivation, and a
badge linking to NEC 310.16. Run a BTU load and you see the ACCA Manual J reference. Run a pipe sizing calculation
and you get the IPC E103.3 badge.
This is the difference between a generic calculator app and one built for the trade. You're not just getting a number — you're getting a number you can defend to an inspector, a GC, or a customer.
Four Trades, One App
CalcRig ships calculators for the four trades I see most:
- Construction: concrete volume, board feet, stud count, drywall sheets, roofing squares, paint coverage
- HVAC: BTU load (Manual J–style), duct sizing, refrigerant charge, air changes per hour
- Electrical: wire gauge recommendation, voltage drop, conduit fill, load calculation
- Plumbing: pipe sizing, flow rate, drainage slope, water heater sizing, fixture-unit lookups
Each trade has its own color accent in the UI (orange for construction, cyan for HVAC, blue for electrical, emerald for plumbing), so you know what mode you're in at a glance. Imperial and metric are both supported with a one-tap unit toggle.
Offline-First Project Grouping
Every calculation gets saved to local SQLite history, scoped to the project you're working on. Switch between projects from the calculator screen, and only the relevant history shows up. When connectivity returns, a sync engine pushes the local queue to the backend with exponential backoff and a server-wins conflict resolution policy.
The result: you can run calculations all day in a basement with no signal, and everything ends up on the cloud the moment your phone sees Wi-Fi.
Material Cost Estimates
Tap any result and CalcRig adds an estimate of the material cost — concrete cubic yards at regional pricing, copper wire by the foot, refrigerant by the pound, drywall by the sheet. The cost helpers are based on a curated dataset that updates with the app and can be tuned per region. It's not a quoting tool; it's a sanity check before you commit to a Home Depot run.
Export to PDF or Text in One Tap
Every calculation can be exported as a branded PDF or shared as plain text via the native share sheet. The PDF includes the inputs, the formula, the code reference, and the cost estimate — formatted to print clean on a single page. Email it to the office, drop it into a project folder, or text it to the customer.
Built for One-Handed Use
CalcRig is designed around how you actually work in the field. Big touch targets. High-contrast result cards. Apple HIG–style typography that holds up in sunlight. Haptic feedback on every input. The UI was built and tuned on the New Architecture (bridgeless mode, Fabric, Reanimated 4 on the UI thread) so animations stay at 60fps even on older Android phones.
The Tech Stack: Modern, Boring, Reliable
Building a tool tradespeople trust requires a stack that doesn't surprise me at 2 AM.
Mobile App — Expo SDK 55 + React Native 0.83
CalcRig is built on the latest Expo SDK with React Native 0.83. The whole app runs on the New Architecture: bridgeless mode, Fabric renderer, TurboModules, and Hermes. The startup time is dramatically faster than a typical RN app, and animations stay buttery on the UI thread thanks to react-native-reanimated 4 and react-native-worklets.
Routing is handled by Expo Router with NativeTabs — each trade is its own tab with a stack navigator inside. State is
Jotai for UI and TanStack Query for server state, with API hooks generated from the backend's OpenAPI spec via
Orval. The schema-to-hooks pipeline means a backend change rebuilds the typed client automatically.
Styling is NativeWind v5 + Tailwind v4 with custom CSS-wrapped primitives in src/tw/index.tsx. Trade colors,
typography, and spacing tokens all live in global.css and flow through the entire app.
Local Storage — op-sqlite + Drizzle + MMKV
Calculation history lives in op-sqlite with Drizzle ORM for type-safe queries and migrations. User preferences (unit system, default trade, onboarding state) sit in MMKV for instant synchronous access. A one-time migration moves legacy MMKV history into SQLite on first launch of newer versions, so nobody loses their data.
Backend — Hono + Drizzle + Postgres
The API is Hono with OpenAPI 3.0 + Zod, generating an interactive Scalar UI at /reference and a JSON spec at
/doc. Every route is fully typed end-to-end — schema in Zod, handler typed with AppRouteHandler, tests via Hono's
testClient.
Auth is Better-Auth with the email/password, anonymous-session, and Expo plugins. Anonymous users get a real session on first launch (so their offline calculations sync the moment they create an account), and account linking moves their local history under the new account without a single calculation lost.
The database is self-hosted Postgres with Drizzle migrations, snake_case columns, and a backup pipeline running to Backblaze B2. Logging is Pino with request IDs and structured fields.
Marketing Site — Astro 6
The site you're reading this on is Astro 6 with a config-driven setup, blog content collections, JSON-LD for posts,
and an llms.txt for AI crawlers. Deploys go to Vercel for the marketing pages, with a Dockerfile fallback for self-hosting
the same build. Sitemap generation, RSS, and per-page SEO metadata are all wired through a vendored Astro integration.
Crash Reporting + Analytics
Sentry for crashes (with proper source maps for Hermes), Firebase Analytics for product metrics, and RevenueCat for the paid tier. The analytics layer sits behind an abstraction so swapping providers later is a one-day job, not a rewrite.
The LLM Wiki — Domain Knowledge That Compounds
One thing CalcRig has that most apps don't: a structured, LLM-maintained knowledge base of trade domain knowledge. The
wiki/ directory contains pages on building codes, engineering formulas, material properties, and field practices —
written and maintained by Claude Code as I add new calculators or ingest new code references.
When a new trade reference comes in (a new IRC chapter, an ACCA Manual J update, a regional code amendment), the LLM synthesizes it into the wiki, updates the index, and flags any calculators that should be revised. The result is a calculator app whose accuracy compounds over time instead of drifting.
This is genuinely the model I think every domain-specific tool should adopt in 2026. The wiki is searchable by the LLM that's writing the next calculator, which means each new feature ships with deeper code awareness than the last.
What's Coming
CalcRig is in active development. The roadmap:
More Calculators
The next batch covers solar (string sizing, inverter ratios), refrigeration (cooling load with humidity), framing (header sizing per IRC R602), and gas piping (pressure drop per NFPA 54). Every new calculator ships with a wiki page explaining the formula and citing the code.
Project Photos and Notes
Attach photos and freeform notes to a project, alongside the calculation history. The PDF export will include the photos inline so the customer or inspector gets the full picture in one document.
Inspector Mode
A read-only project view with a one-tap "share with inspector" link, scoped to a single project, expiring after 30 days. For situations where you want to give an inspector everything they need without granting them an account.
Multi-Tenant Office Accounts
Office and admin views for shops with multiple field techs. Office sees every project, every tech's calculations, every PDF generated, all in one dashboard. Field techs keep working exactly the way they do today.
AI-Assisted Cost Estimates
Snap a photo of a job site or upload a sketch, and the app produces a calculation breakdown — concrete volumes from a foundation drawing, wire runs from a rough electrical plan, BTU loads from a floorplan. The model has the wiki as a grounding source, so the suggestions stay code-aware.
Who CalcRig Is For
- Independent contractors who run their own jobs and want one app instead of five
- Field techs in HVAC, electrical, and plumbing trades who need fast, code-aware calculations on-site
- Estimators who want a quick sanity check before quoting a job
- Apprentices learning the codes, who get formula transparency and reference badges with every result
- Inspectors (informally) who can verify a contractor's math against the same code references in seconds
The Journey Ahead
CalcRig is being built in public, with new calculators and code references shipping every week. The combination of offline-first SQLite history, cloud sync, and an LLM-maintained domain wiki is the part I'm most excited about — it's the first project I've built where the calculator accuracy improves over time without me touching the code.
If you're a tradesperson, an estimator, or anyone who runs trade math more than once a week, try CalcRig and tell me what calculator I should build next.
CalcRig is shipping new calculators weekly. Visit calcrig.notchip.com for the latest release and roadmap.