Problem
Closer runs regenerative co-living communities ("villages") on a multi-service platform. Spinning up a new village meant manually wiring together databases, hosting, email, auth, and payments across several providers — slow, error-prone, and hard to tear back down cleanly.
Role
Contract Full-Stack Engineer
What Avi built
Built a greenfield Bun monorepo that provisions an entire village from one typed config: shared Zod validators and resource-naming, provider adapters for DigitalOcean, Vercel, Mailgun, Firebase, and Stripe Connect, durable provisioning state in Drizzle, and idempotent, resumable workflows modeled as a step DAG. Wrapped it in an Ink terminal UI (shipped as compiled binaries) and an Elysia control API, with end-to-end tests run against live providers.
Outcome
A new village — API, frontend, database, email subdomain, DNS, auth, and payments — can be provisioned, inspected, resumed, and fully torn down from a single command, with all three phases (api-build, site-build, destroy) running green against real cloud infrastructure.
The interesting constraint here was that provisioning touches six external providers, each of which can fail halfway through. The system had to treat a half-built village as a first-class state, not an error to clean up by hand.
Highlights
- One typed village config derives every resource name, domain, and provider call — no hand-wiring.
- Provisioning and teardown modeled as a step DAG over durable state, so any run can be resumed, redone, or inspected.
- Provider adapters for DigitalOcean App Platform, Vercel, MongoDB, Mailgun, Firebase Auth, and Stripe Connect.
- An Ink terminal UI distributed as compiled single-file binaries (macOS and Linux) via GitHub Releases, plus an Elysia HTTP control API.
- End-to-end tests run against live providers, with a “mock village” mode for spending-free runs.