
SunrAI — Solar Install Ops Platform
The shortest path from sold to paid: one pipeline tracking every milestone and every dollar from signed deal to PTO. I build it as its only engineer — 637 API routes, 602 migrations, 490 components, and 1,606 test files. AI proposals with Google Solar API roof analysis, storm intelligence, presentations, and an embedded assistant. Migrated off Supabase onto AlloyDB behind self-hosted PostgREST with Stack Auth, with a migration ledger that refuses to promote anything staging hasn't checksummed.
One Platform, One Engineer
A solar deal that's been signed is not a solar deal that's been paid. Between those two events sit permits, designs, inspections, crews, utility interconnection, and a dozen places the money quietly stalls. SunrAI is the single pipeline across all of it—leads, proposals, projects, crews, presentations, and storm response—multi-tenant and team-scoped. I am the entire engineering team on it, which is the only interesting thing about the numbers below.
637
API routes
602
migrations
490
components
1,606
test files
284
typed DB tables
150
app routes
The database migration nobody wants to do
The platform outgrew hosted Postgres. It now runs on AlloyDB, reached through a self-hosted PostgREST data API, with Stack Auth as the identity provider. The old project survives only as a dormant rollback copy serving file storage and legacy auth compatibility—kept deliberately, not by accident.
The part that made it safe was process, not cleverness: a migration ledger with CI apply replaced hand-applied migrations, production promotion requires exact staging checksums, a schema audit reconciles the ledger against the live database, and the Auth Proxy retired the IP-allowlist ritual entirely. Migrations that manage their own transactions are rejected at the gate.
Product surface
- AI proposals: Google Solar API roof analysis feeding system design, pricing, and financing options—minutes instead of hours
- Storm intelligence: a follow-up queue paginated and faceted in SQL rather than in memory, after the naive version fell over
- AI assistant: embedded in a movable dock with hardened, explicitly-scoped tools and canonical entity mentions
- Crews & projects: single-sourced assignable members with membership integrity enforced in the schema, plus optimistic UI
- Admin & ops: cross-company oversight, role-based access, feature flags with percentage rollouts, and per-provider AI cost tracking
AI economics
Every model call routes through a central registry, so retiring a model or moving embeddings to a provider where GCP credits apply is a registry change rather than a codebase sweep. Cost per company is tracked and visible, because “the AI bill” is a line item someone has to defend.
My role: CTO and sole engineer. Architecture, schema, every route, the test suite, the release process, and the product calls behind them.