Pool Pros, Lead Engineer
pool-pros.comLead engineer on the internal operations platform for a pool construction and service company: five production apps in one monorepo, sharing a single backend, one sign-in origin, and one permission model — and the first-party AI platform that now runs on top of it.
- Built a five-app monorepo — an owner operations cockpit, a mobile-first field-crew onboarding and training app, a subcontractor forms portal, an OAuth-protected tool host, and a Cloudflare Worker — on a shared backend of 243 tables.
- Consolidated five separately deployed Next.js apps into a single shell behind one SSO origin and retired a sixth, cutting six deployments down to one.
- Migrated the data layer twice — Prisma to Supabase, then Supabase to Convex — and replaced the identity provider (Clerk to Better Auth) across a dozen staged, individually reversible phases against a live production system.
- Designed an OKTA-style permission system enforced at the backend perimeter rather than trusted to the UI, with a tripwire test that fails the build when a new endpoint ships ungated.
- Wrote eight first-party integration packages against field-service management, construction project-management, GPS time-tracking, CRM, accounting and telephony APIs, driving 15 scheduled sync and rollup jobs.
- 2,700+ commits and 495 test files in the monorepo's first six months.
- Multi-agent system. A chat-native assistant the whole company talks to from inside their existing team messenger, an executive agent for the owner, and department-level agents that can delegate laterally to each other.
- RAG knowledge base that auto-ingests from the company's team chat and cloud document storage — documents, spreadsheets, slide decks and screenshots — and grounds agent answers in it.
- Two MCP servers. An OAuth-protected tool host, plus a “code-mode” server on Cloudflare Workers that collapses two vendor APIs into `search` and `execute` in place of 126 typed tools. `execute` runs model-written JavaScript in a sandboxed Dynamic Worker with no environment and no outbound network, so generated code calls the vendor APIs over RPC and never sees a key.
- AI résumé screening — scores inbound applications and posts a summary into the hiring channel; drafts rejection emails on stage change.
- Voice brain-dump pipeline — recording → transcription → structured task extraction.
- Nightly push of GPS-verified time cards from the field time-tracking system into project management.
- Full LLM observability — token counts, cost, latency, and per-generation prompt/response capture with PII redaction. Every model call routes through the Vercel AI Gateway against a central model registry, so models are swappable per surface without touching call sites.
- AI lead classification and routing. Every inbound lead — web quote form, referral form, inbound phone call — runs through one durable workflow that decides pipeline, deal value, who gets notified and which systems it is written into. A dedicated classifier returns typed, calibrated judgments; the generative model only describes a settled verdict, so a prompt injection hidden in a form field cannot flip the routing.
- Escalate-only, and it fails open. The classifier may promote a lead from service to sales but never demote it, and no classification means the original checkbox routing, unchanged. Verified live before ship: a mis-ticked pool build re-routed from a $75 service card to a $50,000 sales opportunity.
- Cut summarisation latency 75% (3.5s → 0.9s) by moving the describe step onto a smaller zero-retention model once it no longer had to make decisions.
Also built three marketing sites for the same client's sub-brands, 2025 to 2026, Next.js on Vercel.