bb68d9d5d2803b78c2f826c9b3d7730d33e27e63
Complete the Writing Surface chunk: wire the web writing view to the
offline-first storage adapter, finish the editor package exports, and
apply Step 4 polish (SVG monogram logo, real project in the sidebar,
font settings → CSS variables).
Editor package
- Re-export EditorContent + Editor type from @pubscript/editor so the
web app never imports TipTap directly.
Web writing view (apps/web)
- project-store (zustand) over storageLocal: project, chapters, active
chapter, autosave via createAutosave, idle detection via
createIdleDetector.
- Client-side seed mirroring the server seed ("The Glass Harbor").
- WritingView component: editor + autosave label + word/scene count +
chapter nav; wire the /write route inside AppShell.
- Import editor.css in main.tsx.
Core storage contract
- Extend StorageAdapter with createBook/listBooks/listChapters;
implement in local + server adapters; update contract test mock.
Polish
- Sidebar: SVG monogram logo + live project title/word count instead
of the placeholder "The Silent Cartographer".
- Fonts: applyFontSettings() in the theme engine writes --ps-font-*
variables; .ps-content reads --ps-font-size/leading/measure; settings
store applies fontSize on boot and change.
Docs
- PLAN.md: CHUNK #3 → in progress.
- CHUNK#3_PROGRESS.md: steps 1–3 done, step 4 polish in progress.
Verified: full workspace typecheck clean, lint clean, core 24 / ui 5 /
editor 7 tests pass, web build clean. (server vitest hits EADDRINUSE on
8080 — pre-existing Docker WordPress port conflict, unrelated.)
PubScript
A self-hostable, multi-user writing studio for novelists — one codebase that runs as a web app and as a native desktop app, with a local-first AI co-writing engine built in.
See PLAN.md for the full vision, architecture, and data model. The CHUNK#n.md files are the executable work orders.
Quickstart
pnpm i && pnpm dev # run the app shell at http://localhost:5173
pnpm test # run every workspace's unit tests
pnpm typecheck # strict TypeScript across the monorepo
pnpm build # build web + server
Docker (self-host)
docker compose -f docker/compose.yaml up --build
# → http://localhost:8080 (health: curl localhost:8080/api/health)
One container serves the web app, runs the Fastify API, and stores SQLite on a volume.
Repository layout
| Path | What it is |
|---|---|
PLAN.md |
Single source of truth for what and why |
CHUNK#n.md |
Executable, step-by-step work orders |
apps/web/ |
React 19 + Vite app (runs in browser AND in Tauri) |
packages/core/ |
Domain types, ULIDs, time, token budget, StorageAdapter contract |
packages/ui/ |
Design tokens, theme engine (Ink / Parchment / Nocturne / Terminal), component kit |
server/ |
Fastify + SQLite: auth, multi-tenant, WS, admin, AI proxy |
docker/ |
Dockerfile + compose (one container serves app + API + data) |
docs/ |
ADRs, data model reference, AI role prompts, parity matrix |
Status
CHUNK #1 — Scaffold & Foundations is complete: monorepo, strict TypeScript, the app shell, the theming system, the packages/core contracts, a Fastify server skeleton, and a green CI pipeline.
Next: CHUNK #2 — Data Model, Storage & Auth.
Languages
TypeScript
94.2%
CSS
4.8%
C
0.4%
Shell
0.4%