@factory/web — AI Software Factory web app
Next.js 14 (App Router) + React 18 + TypeScript + Tailwind + shadcn-style UI tokens. Pages, block editor (Tiptap 2), sidebar tree, command palette, realtime (WebSocket) and database views.
Run
cp .env.example .env.local # adjust ports if needed
pnpm install # from the repo root
pnpm --filter @factory/web dev # http://localhost:3000
API on :4000, realtime on :4001 (see .env.example).
Structure
src/app/(auth)/ login, register, reset-password (centered card layout)
src/app/(app)/ workspace shell; [workspace]/page/[id] routes
src/components/ layout (shell/sidebar/tree/topbar/palette), editor, ui
src/hooks/ use-auth, use-workspace, use-pages, use-blocks, use-realtime
src/lib/ api client, realtime client, auth-store, query-client, types
src/stores/ zustand: editor, ui, block-patch (realtime overlay)
Env
See .env.example: NEXT_PUBLIC_API_URL, NEXT_PUBLIC_WS_URL,
NEXT_PUBLIC_APP_URL. Session = httpOnly factory_session cookie set by
the API; the access token stays in memory (lib/auth-store.ts).