Tech Stack
Understand the native Worker runtime, bindings and differences from the Next.js templates.
Flare places the application, database, private files, jobs and AI on Cloudflare's native runtime. It does not wrap Next.js in a Worker and has no OpenNext adapter.
Request path
Browser React / React Query
→ TanStack Start server function or /api/* server route
→ application services
→ @musemvp/* domain packages
→ native D1 / R2 / Email / AI / Queues bindings| Layer | Implementation | Entry |
|---|---|---|
| Pages and SSR | React, TanStack Start / Router | apps/web/src/routes |
| Build | Vite, Cloudflare Vite plugin, Tailwind, MDX | apps/web/vite.config.ts |
| UI | shadcn/Base UI, Lucide, Tailwind tokens | apps/web/src/components/ui |
| Data | Drizzle SQLite schema, D1 queries/batches | packages/db |
| Authentication | Better Auth, SQLite adapter and plugins | packages/auth |
| Billing | Four gateway contracts, D1 inbox/outbox | packages/billing, modules/billing |
| Languages | Paraglide and bilingual overrides | packages/i18n |
| Tooling | TypeScript CLI, Vitest, Playwright | Root scripts, packages/cli |
Worker bindings
| Binding | Purpose | Local/remote distinction |
|---|---|---|
DB | Accounts, metadata, ledger, jobs, audit | Wrangler supplies local SQLite state |
R2_BUCKET | Private file contents | Local objects are not production data |
EMAIL | Cloudflare Email Sending | Development captures mail in D1 |
AI | Workers AI inference | No local model emulator |
JOBS | Webhook and summary work | Production has independent consumer and dead-letter queues |
src/server.ts handles fetch, queue and scheduled events. The current Wrangler cron runs recovery every five minutes; recovery is not a scan performed by every browser request.
Differences from the Next.js templates
- Components follow ordinary React/TanStack semantics, not Next.js Server Component or
use clientboundaries. beforeLoadprotects routes beforeloader. Server endpoints still authenticate independently.- Data is D1/SQLite, not PostgreSQL
DATABASE_URL; storage uses bindings rather than S3 access keys. - Flare owns routing, SSR, resource names and publication. Original MuseMVP commands such as
pnpm dev:cfandcf:deploydo not apply.
Before replacing infrastructure
Identify the owning layer first. Plans/quotas belong to packages/config, themes to app CSS/components, and resource names to target-resources.ts. A new database driver or deployment adapter changes architecture; it is not an environment-variable switch.
Use pnpm-lock.yaml as the version source. After upgrades, check types, Workers compatibility and compiled-Worker E2E, not only the development browser.
Continue with Project structure and Environment variables.