PN
Full StackIn developmentCase Study

Haven

Renter-first house-hunting assistant — in development.

The platform does the repetitive work; the renter makes the important decisions.

Next.jsTypeScriptPostgreSQLPrismapg-bossAuth.jsZodClaude APISentryDockerVitest

Problem

Renters searching for a new home repeatedly search multiple platforms, compare fragmented information, re-submit the same personal details, manage conversations with different estate agents and coordinate viewings by hand. Existing property platforms help with discovering listings, but not with managing the renter's end-to-end house-hunting workflow.

Approach

Built as a modular monolith: one Next.js app (web + API) and one background worker sharing the same domain modules and a single PostgreSQL database. The guiding rule is that no consequential action is ever automatic — every email or confirmation is proposed, re-validated and only executed after the renter approves it.

Architecture

Twelve domain modules (users, renter profile, house hunt, property, property analysis, AI, enquiry, Gmail, viewing, calendar, approvals, audit) behind strict module boundaries, with cross-cutting infrastructure — config, database, telemetry, queue and rate limiting — in a shared platform layer.

1

Web & API

Next.js App Router with thin route handlers that delegate to domain modules; Auth.js Google sign-in using login scopes only.

2

Domain modules

Each module exposes a single public interface; other modules never import its internals.

3

Approval spine

Consequential actions are stored as pending actions, re-validated at execution time and run only after the renter approves.

4

Background worker

pg-boss job queue stored inside PostgreSQL (no Redis) for AI, import and Gmail/Calendar work.

5

Data

PostgreSQL with Prisma migrations; every user-owned query is scoped by user in the repository layer.

6

Observability

Structured logging with correlation IDs, Sentry, and an append-only audit log of what was proposed, decided and done.

Key Engineering Decisions

Human approval for every consequential action

No auto-send, ever: enquiries and viewing confirmations go through an approval spine that re-validates each action before it runs.

Postgres-backed job queue

pg-boss keeps background jobs in the same PostgreSQL database, avoiding a separate Redis dependency while supporting long-running AI and integration work.

AI output treated as untrusted

Listings and emails are handled as data, never authority. AI output is schema-validated with Zod, and a deterministic eval suite pins the AI boundary without calling the live API.

Decisions recorded as ADRs

Architecture decisions — modular monolith, PostgreSQL, approval spine, rate limiting, OAuth token encryption and more — are documented as architecture decision records.

Security Considerations

Per-user data scoping with automated tests proving cross-user (IDOR) access fails; Google sign-in with login scopes only, with Gmail and Calendar access requested separately; Postgres-backed per-user rate limiting on AI, import, send and OAuth routes; and structural redaction so secrets and OAuth parameters cannot reach logs or Sentry.

Testing Strategy

Unit, integration and AI-boundary eval suites run in CI alongside type-checking, linting and a production build. Integration tests run against a real PostgreSQL test database and include a golden-path test of the full renter journey.

Outcome

The MVP loop — sign-up, renter profile, house hunt, property, match, enquiry, Gmail send, agent-reply understanding, viewing confirmation and Calendar event — works end to end. Haven is now being prepared for a small private beta; Azure hosting, notifications and wider beta operations are still in progress.

Interested in working together?

Let's discuss your next project.

System Audioclick to enable
OFF