Build spec & handoff · for Lovable rebuild

Unlock platform — what to build, and the rules to build it by.

The canonical written spec for rebuilding the Unlock intelligence platform in Lovable (React + Vite + TypeScript + Tailwind + shadcn/ui). This page is the record of the design system and architecture. The live working demo is access-controlled (not reachable from this public site); the Asset Register module is viewable at the dedicated link below. ← Back to the site

Contents

01

What this is

Unlock is a portfolio-intelligence platform for UK investors. It aggregates a household's entire portfolio into one Asset Register (the single source of truth) and runs an intelligence suite on top of it: tax/IHT, decumulation planning, portfolio safety lights, concentration, simulation, and an annual review.

The public site is a marketing landing; behind a "Try a demo" flow sits the working app on synthetic data. The whole app reads from the Asset Register — every other module is a lens over those holdings.

02

Tech stack

ConcernChoice
FrameworkReact 18 + TypeScript, built with Vite
Routingwouter (lightweight). App shell mounts a nested router with base /demo/app.
StylingTailwind + shadcn/ui, driven by CSS custom properties. Two parallel token systems: shadcn HSL tokens and an --unlock-* hex layer (see §5).
Chartsrecharts (PieChart, donut, area, etc.)
Iconslucide-react
StateReact context (PlannerContext holds assets/inputs; DemoContext holds persona)
03

Information architecture

Two surfaces: a public marketing site at /, and the gated app under /demo.

/                       Marketing landing ("See everything. Protect everything.")
                        nav: Platform · Pricing · EIS & SEIS · The Advice Gap · About · Try a demo · Log in

/demo                   Investor questionnaire (8 Qs) → computes a persona
/demo/app/*             The authenticated app shell (left nav + content)
  ├─ /asset-register            ◀ single source of truth (list + allocation)
  ├─ /tensions                  Financial Health
  ├─ /portfolio-intelligence    Hub
  │   ├─ /safety-lights         red/amber/green guardrails
  │   ├─ /concentration-risk
  │   ├─ /simulator             scenario weights → range of outcomes
  │   ├─ /liquidity-runway
  │   └─ /risk-check
  ├─ /tax-intelligence/iht · /timeline · /gifting · /beneficiaries · /hmrc
  ├─ /decumulation · /annual-review
  ├─ /property · /compare · /deals · /pitch-deck
  └─ /reports · /chat (AI assistant)

Deep links into the app accept ?persona=legacy_builder|preserver|growth_seeker to skip the questionnaire.

04

App shell & navigation

A fixed left sidebar (≈248px) + scrolling content. Content is centred, max-width: 960px.

05

Colour system

The authenticated app is dark by default. A light theme exists (applied via a demo-light class on <html>) and overrides the same variables. Brand green is constant across both. Use these exact values.

Dark theme (default / real app)

--unlock-bg: #1e1e1e — page background

--unlock-surface: #2b2b2b — cards / panels

--unlock-surface-raised: #333333 — raised surfaces

--unlock-border: #444444 — borders / dividers

--unlock-text: #ffffff — primary text

--unlock-muted: #b0b0b0 — secondary text

--unlock-disabled: #555555

Light theme (.demo-light)

--unlock-bg: #ffffff

--unlock-surface: #f5f6f8

--unlock-border: #e3e6ea

--unlock-text: ≈#212022 (hsl 270 3% 13%)

--unlock-muted: #5b6470

Brand & semantic (both themes)

--unlock-accent: #01BC77 — brand green (buttons, active, highlights)

--unlock-accent-hover: #008655

--unlock-danger: #ef4444

--unlock-warning: #f59e0b
06

Typography & spacing

TokenValue
Body font'Inter', 'Aeonik', sans-serif (--font-body)
Display font'Noto Serif', serif (--font-display, used sparingly for editorial headings)
Condensed'Barlow Condensed' (loaded; used for some marketing display)
Radius--radius: 0.5rem (cards/buttons ~6–8px)
H1 (page)24px / 700
Body14px base; 13px secondary; 11–12px captions
07

Component patterns

08

Charts

All charts use recharts. Pies/donuts share one palette so colours are consistent across Beneficiaries, Concentration and the Asset Register allocation view.

PIE_COLORS = ['#01BC77','#3b82f6','#f59e0b','#ef4444','#8b5cf6',
              '#ec4899','#14b8a6','#f97316','#6366f1','#84cc16']

Donut convention: innerRadius 50–70, outerRadius 80–100, paddingAngle 2, tooltip on a --unlock-surface card. See the dedicated Asset Register spec for the allocation donut.

09

Modules

15 web modules surfaced as the nav above. Priority order for a rebuild:

  1. Asset Register — foundation; everything reads from it. (see its own spec page)
  2. Portfolio Intelligence — Safety Lights (R/A/G), Concentration, Simulator, Liquidity, Risk Check.
  3. Tax Intelligence — IHT calculator, timeline, gifting, beneficiaries, HMRC position.
  4. Decumulation & Annual Review — planning.
  5. Markets & deals — Property index, Compare, Deals, Pitch Deck. Output — Reports, AI Assistant.
10

Demo data & personas

Three personas drive synthetic households: preserver, growth_seeker, legacy_builder. The canonical demo story is legacy_builder ("David & Sharon") — a post-business-sale household with a £2,950,000 portfolio, a concentrated single stock (Acme plc, 30.5%) and ~£4.3m projected IHT exposure. Persona is set by the questionnaire or a ?persona= URL param.

11

Illustrative-data rule (non-negotiable)

Every in-app screen carries a persistent banner: "ILLUSTRATIVE DATA — This demo uses synthetic portfolio data. No real figures are shown." Demo/vision surfaces must always be flagged as illustrative / "vision — not live". Keep this on any rebuild.
12

Lovable build checklist

  1. Scaffold React + Vite + TS + Tailwind + shadcn/ui. Add recharts + lucide-react + wouter.
  2. Define the two token layers in CSS (dark :root default; light via .demo-light). Use the exact hex in §5.
  3. Build the app shell: fixed left sidebar (grouped nav) + centred content (max 960px) + the illustrative banner.
  4. Build the Asset Register first (see its spec) — it's the data source for every other module.
  5. Layer in Portfolio Intelligence → Tax → Planning → Markets/Output, reusing the card / button / chart patterns.
  6. Wire personas + synthetic data; keep the illustrative banner on all app routes.