A modern web application template combining SvelteKit, Cloudflare D1 Database, and TailwindCSS for rapid development of performant, full-stack applications.
npm install -g wrangler
)Create a new project using this template:
npx create-next-app my-app -e https://github.com/kcbrewron/sveltekit-d1-tailwindcss-template
cd my-app
Install dependencies:
npm install
Set up your D1 database:
wrangler d1 create my-db
Update the wrangler.toml
with your D1 database details.
Run the development server:
npm run dev
โโโ migrations/ # Database migration files
โโโ src/
โ โโโ lib/ # Shared components and utilities
โ โโโ routes/ # SvelteKit routes and pages
โ โโโ app.css # Global styles
โโโ static/ # Static assets
โโโ tests/ # Test files
To run migrations:
npm run migrate
Build the application:
npm run build
Deploy to Cloudflare Pages:
wrangler pages deploy .svelte-kit/cloudflare
npm run dev
- Start development servernpm run build
- Build for productionnpm run preview
- Preview production buildnpm run test
- Run testsnpm run check
- Type-check the codebasenpm run lint
- Lint the codebaseCreate a .env
file in the root directory:
DATABASE_URL=your_d1_database_url
Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.