svelte-fastify-starter Svelte Themes

Svelte Fastify Starter

svelte-fastify-starter

Monorepo scaffold: SvelteKit + Fastify + PostgreSQL + Drizzle ORM.

Stack

  • Frontend: SvelteKit 2, Svelte 5, Tailwind CSS 4, TypeScript
  • Backend: Fastify 5, TypeScript, Drizzle ORM
  • Database: PostgreSQL
  • Tooling: Biome (lint/format), npm workspaces
  • Deploy: Cloudflare Pages (client), Railway/Render (server)

Structure

/
├── shared/    # Types, schemas and constants shared between client and server
├── client/    # SvelteKit frontend
└── server/    # Fastify backend

Getting started

# 1. Copy .env.example to .env and fill in your values
cp .env.example .env

# 2. Start the database
docker compose up -d

# 3. Install dependencies
npm install

# 4. Generate and run DB migrations (after defining your schemas in shared/)
npm run db:generate --workspace=server
npm run db:migrate --workspace=server

# 5. Start development
npm run dev          # SvelteKit (port 5173)
npm run dev:server   # Fastify (port 3000)

Included out of the box

  • Auth module: register, login, logout, me, Google OAuth, email verification, password reset
  • Fastify plugins: CORS, cookies, rate limit, Swagger docs, Resend email, R2 file upload
  • Shared Drizzle schemas: users, sessions, email_verification_tokens, password_reset_tokens
  • SvelteKit auth store + API client

Top categories

Loading Svelte Themes