A modern web application template combining SvelteKit, Cloudflare D1 Database, and TailwindCSS for rapid development of performant, full-stack applications.
- 🚀 SvelteKit - Full-stack application framework
- 💾 Cloudflare D1 - SQLite-compatible database on the edge
- 🎨 TailwindCSS - Utility-first CSS framework
- ✅ Type-safe database operations
- 📱 Responsive design out of the box
- 🧪 Testing setup with Vitest
- 📚 JSDoc documentation
- Node.js (version 16 or higher)
- Cloudflare account
- Wrangler CLI installed globally (
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.tomlwith 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 codebase
Create a .env file in the root directory:
DATABASE_URL=your_d1_database_urlPlease 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.