A highly opinionated, production-ready starter template for SvelteKit applications, focusing on Developer Experience (DX), code quality, and modern tooling.
Starting a new project often involves a repetitive "setup phase" — configuring linting, setting up authentication, wiring up a database, and ensuring type safety. This template aims to eliminate that friction.
The philosophy behind this starter is "Strict Default, Modern Stack". We believe that enforcing consistent code styles, commit conventions, and strict type checking from day one leads to more maintainable and scalable software. We've chosen a stack that combines the reliability of established tools (PostgreSQL) with the performance and developer joy of modern frameworks (Svelte 5, Tailwind 4, Bun). It's designed to let you hit the ground running with features you actually need, without the bloat you don't.
This template comes pre-configured with a robust suite of tools:
- SvelteKit: The meta-framework for Svelte, providing a blazing fast app experience.
- Svelte 5: The latest version of Svelte with Runes for a simpler, more powerful reactivity model.
- Tailwind CSS v4: Utility-first CSS framework for rapid UI development.
- Bun: A fast all-in-one JavaScript runtime and package manager.
- Drizzle ORM: A lightweight, type-safe TypeScript ORM.
- PostgreSQL: The world's most advanced open-source relational database (running in Docker).
- Clerk: Complete user management and authentication logic (via
svelte-clerk).
- Shadcn UI: A collection of re-usable components built with Radix UI and Tailwind CSS.
- Lucide Icons: Beautiful & consistent icons.
- Dark Mode: Built-in support with
mode-watcher.
- Lefthook: Fast and powerful Git hooks manager.
- Commitlint: Enforces conventional commit messages.
- ESLint & Prettier: Configured for strict linting and consistent formatting (including import sorting).
- Docker Compose: Pre-configured
compose.yamlfor spinning up a local PostgreSQL instance. - Dev Container: It also provides a fully functional and pre-configured devcontainer, which is the recommended way to develop.
- VSCode Settings: Recommended extensions and workspace settings for a unified team experience.
Before you start, you need to ensure you have the necessary tools installed and services configured.
You need Docker installed to run the local database and the Dev Container.
- Windows/Linux: Install Docker Desktop or Docker Engine.
- macOS: We strongly recommend using OrbStack instead of Docker Desktop for better performance and battery life.
You need to set up a project in Clerk for authentication.
- Sign up/Login: Go to Clerk.com and sign in.
- Create Application: Click on "Create Application" in the dashboard.
- Configure Sign-in: Choose your preferred sign-in methods (e.g., Email, Google, GitHub).
- Get API Keys: Once created, go to the API Keys section in the sidebar. You will need the
Publishable keyandSecret key.
Click the "Use this template" button at the top of the GitHub repository to create a new repository based on this template.
You can develop either using a pre-configured Dev Container (recommended) or manually on your local machine.
This approach provides a fully configured environment with all dependencies and tools ready to go.
-
Open in Dev Container: Open the repository in GitHub Codespaces or VS Code with the "Dev Containers" extension.
-
Environment Setup: Create a
.envfile in the root.# .env # Note: 'db' is the hostname of the database service within the container network DATABASE_URL="postgres://root:mysecretpassword@db:5432/local" # Clerk Authentication Keys PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_... CLERK_SECRET_KEY=sk_test_...
-
Push Database Schema:
bun db:push
-
Start Developing:
bun dev
-
Clone and Install:
git clone https://github.com/your-username/your-new-repo.git cd your-new-repo bun install -
Environment Setup: Create a
.envfile in the root.# .env DATABASE_URL="postgres://root:mysecretpassword@localhost:5432/local" # Clerk Authentication Keys PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_... CLERK_SECRET_KEY=sk_test_...
-
Start the Database:
bun stack:start
-
Push Database Schema:
bun db:push
-
Start Developing:
bun dev
Your app should now be running at http://localhost:5173.
For a detailed explanation of all available scripts (development, testing, database management, etc.), please refer to the Tools Documentation.
build with ❤️ in ruhrgebiet