# ADR-0002: Frontend stack — React 18 + TypeScript + Vite 5 + pnpm workspaces

**Status:** Accepted (Phase 2; inherited from SYNTHESIS Locked Decision #1)

## Context

The Console v2 design packages (`consultations/recoil/console-v2-architecture/
design-packages/recoil-console/` and the mobile companion) are authored as
React + plain JSX with hand-written CSS tokens. The engine substrate is
unchanged Python/FastAPI. The console must consume engine HTTP endpoints,
persist workspace state to a Studio-side server, and ship desktop + mobile
trees from one repo.

## Decision

Adopt React 18 + TypeScript 5 + Vite 5 for both desktop and mobile apps.
Use a pnpm workspace to host six packages: `@recoil/contracts`,
`@recoil/design-system`, `@recoil/fixtures`, `@recoil/http-adapter`,
`@recoil/desktop`, `@recoil/mobile`. No build-step monolith — each app is its
own Vite target. No state libraries beyond React's built-ins until a concrete
case justifies one.

## Consequences

Design-package fidelity is preserved: the existing JSX ports cleanly with
explicit prop types and unchanged JSX bodies. pnpm's symlinked workspace
keeps `@recoil/design-system` imports zero-rebuild between packages. Vite
HMR is sub-second. The cost: every package needs its own `tsconfig.json`
extending `tsconfig.base.json`, and every dev needs pnpm installed (no npm
fallback).
