A modern, full-stack SvelteKit boilerplate with Drizzle ORM, PostgreSQL, TailwindCSS, authentication and more ready to go.
- Open an issue on GitHub if you found a bug
- Submit a PR if you have a fix or a feature you want to add
- Start a discussion for general questions or feedback
- Ask for help in the discussions section
- 🚀 SvelteKit 2.0+ - Latest version
- 🔄 Svelte 5.0 - With runes
- 🎨 TailwindCSS 4.0 - Utility-first styling
- Lucide icons
- Shadcn-svelte components coming later (based on Bits-UI)
- 🎨 Bits-UI - Headless UI components
- 🗃️ Drizzle ORM - Type-safe database queries and Drizzle-kit for migrations
- 🐘 PostgreSQL - Database
- 🔒 Better-auth - Authentication system, check their docs for plugins:
- Email/password authentication
- Social/oauth login
- Rate limiting
- Handle payments andsubscriptions with Stripe or Polar
- Organizations/teams
- 📦 Bun - Fast JavaScript runtime and package manager
- 🧩 TypeScript - For type safety throughout the codebase
- 🧹 Prettier - Code formatting with Tailwind plugin
- 🧪 Vite - Build tool
- Bun (recommended) or Node.js 22+
- PostgreSQL database
- Clone this repository
git clone https://github.com/thomasmolorg/sveltekit-boilerplate.git
cd sveltekit-mvp-boilerplate
- Install dependencies
bun install
- Set up your environment variables
cp .env.example .env
Edit the .env
file with your database credentials and other configuration.
- Run database migrations
bun run db:migrate
- Start the development server
bun run dev
- Generate migrations:
bun run db:generate
- Run migrations:
bun run db:migrate
- Open Drizzle Studio:
bun run db:studio
├── drizzle/ # Database migrations
├── src/
│ ├── lib/ # Shared utilities and components
│ │ ├── server/ # Server-only code
│ │ │ └── db/ # Database schema and connection
│ ├── routes/ # SvelteKit routes
│ │ ├── app/ # Protected application routes
│ │ └── (auth)/ # Authentication routes
│ ├── hooks.server.ts # SvelteKit hooks for auth and more
├── static/ # Static assets
├── drizzle.config.ts # Drizzle ORM configuration
└── svelte.config.js # SvelteKit configuration
This boilerplate includes a pre-configured authentication system using better-auth. It provides:
- User registration and login
- Session management
- Protected routes
This boilerplate can be deployed to any platform that supports SvelteKit applications:
- Vercel
- Netlify
- Cloudflare Pages
- Railway
- Fly.io
- Self-hosted with Node.js or Bun on e.g. AWS, Azure, etc.
Contributions are welcome! Please open an issue or submit a pull request.