Skip to content
Daniel Acosta

Case study · Private internal tool

Lovely HQ

Built for Lovely, where I’m CTO & Co-Founder

The private operating system my founding team uses to run Lovely: tasks, decisions, releases, docs and analytics in one place, on the web and on our iPhones.

Lovely HQ's overview: what needs you, what's blocked, who's on what and what's due, with task titles and teammates' names blurred.
The overview. Internal task titles and teammates’ names are blurred throughout.

The problem

Lovely is an iOS app, and running it means keeping track of a lot more than code: who’s on what, what we decided and why, what’s actually in the build we sent to Apple, and where the docs are.

The obvious answer was Notion. But our tasks live in an Obsidian vault, and I didn’t want a second place that could disagree with it. So I built HQ around the vault instead. Obsidian stays the source of truth for tasks, and everything else the team needs sits on top of it.

What it does for the team

Tasks stay in Obsidian

Every task note in our vault shows up in HQ as a table, kanban board, calendar, timeline, my tasks and projects. Edits flow both ways within seconds, so nobody has to care which side they used.

Conflicts are detected per field with a three-way comparison. If the same field changes in Obsidian and HQ at once, nothing gets overwritten and the person chooses. Deletes move notes to the vault’s .trash, so they can be restored.

Lovely Council: Claude advises, humans decide

Council is how we make decisions. Someone proposes one and we vote Yes, No or Unsure under configurable rules: majority, unanimity, quorum, required voters. Unresolved votes open a live threaded debate with mentions.

Closing the debate freezes an immutable snapshot, enforced by a database trigger. Claude reviews that snapshot, including attached PDFs read in full, and returns a structured recommendation validated against a schema: positions, evidence assessment, risks, recommended decision, confidence and the strongest dissent.

Then we cast the final vote. Rejecting the recommendation never adopts the opposite. Decisions are archived, written into the vault as notes, and can spawn implementation tasks that sync to Obsidian.

It has a monthly AI budget, rate limits, retries and a refusal fallback. If the API fails, there’s a path to decide without AI.

A closed Lovely Council proposal showing the Vote, Debate, Claude review, Final vote and Decided stages, with the first and final votes. Proposal text and teammates' names are blurred.
A decided proposal, with each stage it went through and both rounds of votes.

Releases that don’t overclaim

An App Store build has three separate states in HQ: binary, Apple review and release. Scope items stay “unverified” until someone confirms they’re in the submitted build.

The Apple compliance checklist tracks owner, status, evidence, verification steps and history. It’s always labelled “verified internally”, never “approved”, because only Apple gets to say that.

Lovely HQ's Product & Releases page: separate binary, Apple review and release states, a build scope list marked verified or unverified with item names blurred, and a compliance checklist labelled verified internally.
Nothing counts as shipped until someone confirms it’s in the binary.

Docs and weekly briefs

The wiki has collections, search, version history and restore, optimistic-concurrency editing and admin-only pages. It publishes to and imports from Obsidian under an explicit no-silent-overwrite policy.

Weekly briefs start from permanent operational snapshots. HQ compares them week over week and drafts an editable 8-section Markdown brief.

Analytics with no guessing

Throughput, workload, release health and Council stats are computed only from real data. Product metrics we haven’t wired up say “not connected” rather than showing an estimate.

Lovely HQ's analytics: throughput, team workload, release health and Council stats, with product metrics marked not connected.
The empty section at the bottom is on purpose.

Built for how we actually work

HQ installs to the iPhone Home Screen with a native-feeling tab bar, safe-area handling, no input zoom and touch drag on the board.

Around that: online presence, email notifications (instant or daily digest, with retries and a delivery log), invite-only magic-link sign-in, admin, member and viewer roles, an audit log, and real-time updates over Server-Sent Events.

Lovely HQ as an iPhone Home Screen app, showing Product & Releases above a native-feeling tab bar.
The Home Screen app.

Under the hood

  • Next.js 16
  • React 19
  • TypeScript
  • TanStack Query
  • PostgreSQL
  • Drizzle ORM
  • LISTEN/NOTIFY
  • Zod
  • Anthropic SDK
  • MCP SDK
  • Python
  • Nodemailer
  • Playwright
  • Vitest
  • Vercel
  • AWS Lightsail
  • Caddy
  • systemd

The vault is never exposed

A custom MCP server wraps the vault’s own Python CLI. A local sync agent runs on my Mac as a launchd service and talks to the hosted app. The agent always initiates the connection, so the vault is never exposed to the internet.

HQ edits queue as idempotent operations, with op IDs and a ledger, and are applied through that same CLI. The vault’s rules for IDs, duplicates and completion hold no matter where an edit started.

A split deploy for iPhone Safari

The website runs on Vercel and proxies its API to a backend on an AWS Lightsail server (Ubuntu, Postgres, Caddy for automatic HTTPS, systemd), so sign-in cookies stay first-party on iPhone Safari. The sync agent connects to the backend directly. Server setup and updates are scripted.

It’s an npm workspaces monorepo: a shared protocol package, the vault MCP server, the sync agent and the web app. Real-time runs on Postgres LISTEN/NOTIFY. Council uses streaming structured outputs and native PDF input.

Tests that run the real thing

End-to-end tests drive a real server, database, sync agent and MCP server against a copy of the vault, with a local stand-in for the Claude API. That’s 41 sync checks, 28 for a 14-step Council scenario and 23 across releases, wiki, briefs and analytics, plus split-deploy and presence checks and unit tests. Playwright runs visual checks in Chromium and WebKit.

They caught real bugs before users did. One was a scheduler whose Postgres advisory lock was released on a different pooled connection, so it ran once and never again. Another was vault files being listed twice.

Security

  • CSRF origin checks, hashed session and agent tokens, invite-only accounts
  • Untrusted vault and debate content goes to Claude as data, with prompt-injection guidance
  • Sandboxed downloads, and secrets kept server-side

HQ is private and so is its code, so there’s no live link or repo to share.

← Back to the museum