chealt starter
Local-first monorepo using Yarn workspaces, Astro + Vite + Web Components, and Cloudflare Workers with Turso sync.
Stack
- Yarn workspaces (monorepo)
- Astro static site output
- Vanilla Web Components + CSS
- Cloudflare Worker API for sync
- IndexedDB-first client data model
- Turso/libSQL persistence in worker
- oxlint + oxfmt for linting/formatting
Quick start
- Install deps
yarn install
- Run web and worker in parallel
yarn dev
- Build all
yarn build
Packages
packages/web: Astro static frontendpackages/worker: Cloudflare Worker sync API
Environment
Copy examples and fill in values:
packages/worker/.dev.vars.example->packages/worker/.dev.varspackages/web/.env.example->packages/web/.env
Worker vars:
TURSO_DATABASE_URLTURSO_AUTH_TOKENSYNC_API_KEY
Web vars:
PUBLIC_SYNC_API_URL(defaulthttp://127.0.0.1:8787)PUBLIC_SYNC_API_KEY
Local-first flow
- Web app writes records to IndexedDB immediately.
- Records are marked
dirty. - Background sync sends only dirty records to Worker.
- Worker upserts records into Turso and returns acked ids.
- Client marks those records clean.