Back to templates

Template details

aMaDrOfSvelte

A production-oriented SvelteKit starter with Svelte 5, Drizzle ORM, Turso SQLite, Better Auth GitHub OAuth, Tailwind CSS 4, and shadcn-svelte UI.

About this template

aMaDrOfSvelte

aMaDrOfSvelte is a production-oriented SvelteKit starter template that ships with a real auth/data/UI baseline: Better Auth with GitHub OAuth, Drizzle ORM on Turso/libSQL, Tailwind CSS 4, and shadcn-svelte components.

What is aMaDrOfSvelte?

A full-stack SvelteKit (Svelte 5) starter template that removes setup churn by providing a pre-integrated stack: Better Auth for GitHub OAuth, Drizzle ORM against Turso/libSQL, Tailwind CSS 4 with shadcn-svelte UI primitives, and Vite PWA support. It runs on Node 20 via the Vercel adapter and includes Bun-first scripts for check, lint, test, and build. The repo is maintained as a small, decisive template for developers launching production SvelteKit apps.

Key Features

  • SvelteKit 2 + Svelte 5 runes — Uses the modern runes reactivity system; the starter targets the latest framework versions with TypeScript throughout.
  • Better Auth with GitHub OAuth — Pre-configured auth client and server setup (src/lib/auth-client.ts, src/lib/server/auth.ts); hooks.server.ts hydrates the session into event.locals, and dashboard route protection redirects unauthenticated users.
  • Drizzle ORM + Turso/libSQL — Typed database access with drizzle-orm and @libsql/client; schema lives in src/lib/server/db/schema.ts; migrations via drizzle-kit scripts (db:generate, db:push, db:migrate, db:studio).
  • Tailwind CSS 4 + shadcn-svelte — Tailwind v4 with tailwind-variants and bits-ui; a src/lib/components/ui/ directory holds reusable UI primitives, and a dedicated /components route acts as an organized UI playground.
  • Vite PWA (Workbox) — vite-plugin-pwa and workbox-window with a src/pwa.ts helper for service worker registration; includes an PWAInstallPrompt.svelte component.
  • Vercel adapter on Node 20 — @sveltejs/adapter-vercel configured with nodejs20.x runtime, so the template deploys directly to Vercel serverless functions.
  • Testing with Vitest — vitest and @testing-library/svelte are set up; bun run test:run executes the test suite once.
  • Bun-first scripts — Package scripts for dev, build, preview, check, lint, format, test, and DB operations all run through Bun.

Who is it for?

  • Full-stack SvelteKit developers who want a working auth + database + UI stack without wiring Better Auth, Drizzle, and Tailwind together manually.
  • Startup founders prototyping a SaaS or dashboard that need GitHub OAuth login, a protected dashboard route, and a Turso SQLite database from day one, with a clear path to production on Vercel.
  • Developers new to Svelte 5 runes looking for a reference implementation of runes combined with server-side session handling, route protection, and PWA registration.

What can you do with aMaDrOfSvelte?

  • Set up authentication in minutes: Create a GitHub OAuth app, paste the client ID and secret plus a Turso database URL into .env, run bun run db:push, and the template handles the rest — including a dedicated sign-in page at /auth and redirect logic for authenticated vs. signed-out users.
  • Build a protected dashboard: The /dashboard route is guarded in +page.server.ts and redirects unauthenticated visitors to /; the navbar and auth-utils.ts expose login/logout actions.
  • Add PWA capabilities: Use the included PWA install prompt component and service worker helpers to make the SvelteKit app installable.
  • Extend the UI: The src/lib/components/ui/ directory and /components playground let you copy, modify, and compose shadcn-svelte-style primitives with Tailwind CSS 4.

How does aMaDrOfSvelte work?

Clone the repo, install dependencies with bun install, copy .env.example to .env, and fill in the required variables: DATABASE_URL, DATABASE_AUTH_TOKEN, BETTER_AUTH_SECRET, BETTER_AUTH_URL, GITHUB_CLIENT_ID, and GITHUB_CLIENT_SECRET. Then run bun run db:push to create the schema, bun run dev to start the development server, and bun run check, bun run lint, bun run test:run, and bun run build as a pre-commit validation pipeline.

FAQ

Is aMaDrOfSvelte free?

Yes, the template repository is public on GitHub; you only pay for the services you integrate with, such as Turso, Vercel, or GitHub.

What environment variables does aMaDrOfSvelte require?

The .env.example file lists six required variables: DATABASE_URL, DATABASE_AUTH_TOKEN, BETTER_AUTH_SECRET, BETTER_AUTH_URL, GITHUB_CLIENT_ID, and GITHUB_CLIENT_SECRET. Set them before running bun run db:push or bun run dev.

How do I set up GitHub OAuth with this template?

Create a GitHub OAuth app with homepage URL http://localhost:5173 and callback URL http://localhost:5173/api/auth/callback/github. Paste the generated client ID and secret into the .env file under GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET.

Which database does aMaDrOfSvelte use?

It uses SQLite via Turso/libSQL, accessed through Drizzle ORM. The @libsql/client package connects to a libSQL URL, and drizzle-kit provides db:generate, db:push, db:migrate, and db:studio scripts.

Does the template include PWA support?

Yes, it includes vite-plugin-pwa and workbox-window with a src/pwa.ts helper, plus a PWAInstallPrompt.svelte component for install prompts.

What is the validation workflow before committing?

Run bun run check (Svelte and TypeScript checks), bun run lint (Prettier), bun run test:run (Vitest), and bun run build (production build) as a pre-commit validation sequence.

screenshot of aMaDrOfSvelte on template0.com