JRV

Portfolio / CASE STUDY

Reference system with a public guide

Blueprint.

A spec-driven reference app where teams sketch an architecture on a shared canvas, ask a local model to extend it, and generate a Markdown spec.

MY ROLE

Independent full-stack architecture, spec writing and verification

Why it exists

A full-stack app with accounts, sharing, realtime editing and long-running AI work has many places to leak access or lose data. I wanted a small reference build that shows how to plan it in writing first and check each piece as I go.

What I built

I wrote six context files covering the overview, architecture, code standards, AI rules, UI and a progress tracker. Then I built the app in 12 specified units, each with its own spec and verification step. Every paid service has a local replacement behind one module, so the whole system runs on one machine.

Engineering decisions

01

Replace paid services with local adapters

Better Auth, a Yjs room server, a pg-boss worker, a disk blob store and Ollama stand in for hosted vendors. Each sits behind one module in lib/, so swapping a vendor touches that module and not the feature code.

02

Mint room tokens only after a membership check

The app issues a short-lived token that names one room, and only after confirming the user owns or collaborates on the project. The room server refuses anything else, and it closes a socket when a collaborator is removed.

03

Treat model output as untrusted

The model returns components, tiers and links against a zod schema. My code cleans labels, drops duplicate and dangling edges, and computes the layout, so the model never sets coordinates.

Capabilities in practice

  • Spec-driven planning
  • Access control across services
  • Realtime collaboration
  • Background AI jobs

Status & scope

A local reference build, not a hosted product. It needs Docker and Ollama to run. A separate review pass found six realtime and job issues, and I fixed all six, four with end-to-end regression checks. Rate limiting is still in memory, and edits in the last two seconds before the final client leaves can be lost. Both are recorded as open in the progress tracker.

KEEP EXPLORING

Solo Software Factory