A Copier template for SvelteKit projects deployed to Cloudflare Workers with D1 (SQLite), Drizzle ORM, Tailwind CSS 4, and mdsvex.
@tailwindcss/vite.svx files)CLAUDE.md) and permission config# Install copier if needed
pip install copier # or: pipx install copier / uvx copier
# Create a project from the template
copier copy gh:mindlace/sveltekit-cf-template my-project
# Set up
cd my-project
npm install
npm run dev
| Variable | Description | Default |
|---|---|---|
project_name |
Package name, D1 binding, wrangler name | (required) |
project_description |
Description for CLAUDE.md | "" |
d1_database_id |
Production D1 database UUID | "" |
d1_staging_database_id |
Staging D1 database UUID | "" |
custom_domain |
Custom domain (e.g. myapp.example.com) |
"" |
use_r2 |
Include R2 bucket binding | false |
use_queues |
Include Queue producer binding | false |
When the template is updated, pull changes into your project:
copier update
To push improvements from a project back to this template, use copyback:
pip install copyback
cd my-project
copyback status # See what differs
copyback push --interactive # Push selected changes back
copyback add src/lib/new.ts # Add new files to the template
my-project/
├── CLAUDE.md # Agent instructions
├── package.json # npm, shared deps/scripts
├── wrangler.jsonc # Cloudflare Workers config
├── svelte.config.js # SvelteKit + mdsvex
├── vite.config.ts # Vite + Vitest dual projects
├── tsconfig.json # TypeScript strict
├── drizzle.config.ts # Drizzle ORM (SQLite/D1)
├── eslint.config.js # ESLint 10
├── .prettierrc # 2-space, single quotes
├── playwright.config.ts # E2E tests
├── .github/workflows/ci.yaml # GitHub Actions
├── .husky/pre-commit # lint-staged
├── src/
│ ├── app.d.ts # App.Platform type
│ ├── app.html # HTML shell
│ ├── lib/
│ │ └── server/db/
│ │ ├── index.ts # getDb(platform) helper
│ │ ├── schema/schema.ts # Drizzle schema
│ │ └── d1-shim.ts # better-sqlite3 D1 mock for tests
│ ├── routes/
│ │ ├── +layout.svelte
│ │ └── +page.svelte
│ └── scripts/
│ ├── migrate.ts # D1 migration runner
│ └── prepare-migrations.ts # Drizzle -> D1 flattener
└── migrations/ # Database migrations
MIT