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-ormand@libsql/client; schema lives insrc/lib/server/db/schema.ts; migrations viadrizzle-kitscripts (db:generate,db:push,db:migrate,db:studio). - Tailwind CSS 4 + shadcn-svelte — Tailwind v4 with
tailwind-variantsandbits-ui; asrc/lib/components/ui/directory holds reusable UI primitives, and a dedicated/componentsroute acts as an organized UI playground. - Vite PWA (Workbox) —
vite-plugin-pwaandworkbox-windowwith asrc/pwa.tshelper for service worker registration; includes anPWAInstallPrompt.sveltecomponent. - Vercel adapter on Node 20 —
@sveltejs/adapter-vercelconfigured withnodejs20.xruntime, so the template deploys directly to Vercel serverless functions. - Testing with Vitest —
vitestand@testing-library/svelteare set up;bun run test:runexecutes 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, runbun run db:push, and the template handles the rest — including a dedicated sign-in page at/authand redirect logic for authenticated vs. signed-out users. - Build a protected dashboard: The
/dashboardroute is guarded in+page.server.tsand redirects unauthenticated visitors to/; the navbar andauth-utils.tsexpose 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/componentsplayground 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.








