Saraan Asim
Saraan Asim
Stage
0→1
Product
AI site intelligence for architects
Dates
May 2026 to now
My part
Built the architecture and the site data pipeline, then handed it to the team
Stack
NestJS 11, Next.js 16, Drizzle, PostgreSQL, Redis, LangChain, Three.js, Stripe
Live
terravive.ai

Terravive

AI site intelligence for architects and landscape professionals. It pulls public site data, summarises regulations, flags risks and next actions, and exports back into CAD.

Terravive's home page, a city park with the headline about designing places with ecological intelligence.
Fig. 1. Terravive's public home page.

0→1

The product

Terravive is AI site intelligence for architects and landscape professionals. It speeds up site analysis, simplifies the research into regulations, and produces architect-ready output that goes back into CAD. For a site, it pulls in public data, summarises the regulations that apply, and surfaces risks and next actions. The target is a first result in five minutes.

What I built

I built the architecture and the monorepo, then the site data pipeline that pulls in public data about a site. Then I handed the product to the team that runs it now.

The monorepo holds a NestJS 11 API, a Next.js 16 web app, and shared packages for the database schema, the OpenAPI types and the UI components. The API is split into domain layers. It has JWT and OAuth sign-in with role-based access, an audit trail of writes and login attempts, standard problem-detail error responses, and structured logs with personal data redacted.

How it works

The web app runs on Next.js with Three.js in the browser and calls the NestJS API. The API stores data in PostgreSQL through Drizzle and hands the heavy analysis to Redis-backed queues, with caches in front, so results stream in as each step finishes. The AI layer uses LangChain to summarise regulations and surface risks from the public site data. Results export back into CAD, and Stripe handles billing.

4 decisions

Decisions

  1. Drizzle for typed SQL

    Drizzle keeps the queries typed and close to the database. The types come straight from the table definitions, so changing the schema changes the types with no separate generate step. Migrations are plain SQL files that get reviewed like any other code. The trade-off is less convenient relational queries, so relations are kept in one place.

  2. Heavy work in queues

    The target is a first result in five minutes. To reach it, the heavy work moved into Redis-backed queues and caches, and results show up as they arrive. A request never waits on the slowest step.

  3. An OpenAPI contract between API and web app

    The web app's types are generated from the API's OpenAPI spec. A change to an endpoint shows up as a type error in the front end before it ships. The API also serves interactive docs from the same spec.

  4. A handoff the team could run with

    The team received a working architecture and data pipeline, architecture docs, and the typed OpenAPI contract. Rules for the codebase's architecture are kept in the repo, where AI coding tools load them automatically, so new code follows the same structure.

Feature level

From the project record

Architecture

Web appNext.js 16 · Three.jsAPINestJS 11 · OpenAPIAI analysisLangChainPostgreSQLDrizzleRedisqueues · cachesPublic site dataregulationsCAD exportresults outStripebillingWeb appNext.js 16 · Three.jsAPINestJS 11 · OpenAPIAI analysisLangChainPostgreSQLDrizzleRedisqueues · cachesPublic site dataregulationsCAD exportresults outStripebilling
Fig. 2. One typed API behind the web app. The AI layer reads public site data and regulations and writes results that go back into CAD.

Result

Outcome

Terravive is live at terravive.ai. The team that took it over builds on the architecture, the data pipeline and the typed contract from the handoff.

Looking back

What I’d change

I would settle the data model earlier, before the handoff. A team that inherits an architecture also inherits its data model, and changes to the core records get harder once several people are building on them. It is a pattern across my 0→1 builds, and it came up on SiftSight and Deeplawn too.