sveltekit-production-starter Svelte Themes

Sveltekit Production Starter

Production-ready SvelteKit 5 + Tailwind v4 starter with E2E testing, coverage, and Sentry monitoring

Svelte Raw Template

A production-ready SvelteKit starter template built with shift-left quality practices. Catch bugs early, ship with confidence.

Philosophy

This template embraces the shift-left methodologyβ€”integrating quality gates at every stage of development rather than catching issues in production. Every commit is linted, every push is tested, and every merge is validated through CI/CD.

Fail fast, fix early.

Project Structure

β”œβ”€β”€ πŸ“ .claude
β”‚   β”œβ”€β”€ πŸ“ rules
β”‚   β”‚   β”œβ”€β”€ πŸ“ coding-conventions.md
β”‚   β”‚   β”œβ”€β”€ πŸ“ svelte-standards.md
β”‚   β”‚   └── πŸ“ typescript-standards.md
β”‚   β”œβ”€β”€ πŸ“ skills
β”‚   β”‚   └── πŸ“ plan-feature
β”‚   β”‚       └── πŸ“ SKILL.md
β”‚   └── βš™οΈ settings.json
β”œβ”€β”€ πŸ“ .github
β”‚   └── πŸ“ workflows
β”‚       └── βš™οΈ main.yml
β”œβ”€β”€ πŸ“ .husky
β”‚   β”œβ”€β”€ πŸ“„ pre-commit
β”‚   └── πŸ“„ pre-push
β”œβ”€β”€ πŸ“ e2e
β”œβ”€β”€ πŸ“ src
β”‚   β”œβ”€β”€ πŸ“ lib
β”‚   β”‚   β”œβ”€β”€ πŸ“ alerts
β”‚   β”‚   β”‚   └── πŸ“„ toast.ts
β”‚   β”‚   β”œβ”€β”€ πŸ“ components
β”‚   β”‚   β”‚   └── πŸ“ ui
β”‚   β”‚   β”‚       β”œβ”€β”€ πŸ“ button
β”‚   β”‚   β”‚       β”œβ”€β”€ πŸ“ card
β”‚   β”‚   β”‚       β”œβ”€β”€ πŸ“ form-field
β”‚   β”‚   β”‚       β”œβ”€β”€ πŸ“ input
β”‚   β”‚   β”‚       β”œβ”€β”€ πŸ“ label
β”‚   β”‚   β”‚       └── πŸ“ pagination
β”‚   β”‚   β”œβ”€β”€ πŸ“ data
β”‚   β”‚   β”œβ”€β”€ πŸ“ server
β”‚   β”‚   β”‚   └── πŸ“„ auth.ts
β”‚   β”‚   β”œβ”€β”€ πŸ“„ axios.ts
β”‚   β”‚   β”œβ”€β”€ πŸ“„ env.ts
β”‚   β”‚   └── πŸ“„ utils.ts
β”‚   β”œβ”€β”€ πŸ“ routes
β”‚   β”‚   β”œβ”€β”€ πŸ“ pokemons
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ components
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ PokemonCard.svelte
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ PokemonEmptyState.svelte
β”‚   β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ PokemonGrid.svelte
β”‚   β”‚   β”‚   β”‚   └── πŸ“„ PokemonSearchBar.svelte
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“ types
β”‚   β”‚   β”‚   β”‚   └── πŸ“„ pokemon.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ +page.server.ts
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ +page.svelte
β”‚   β”‚   β”‚   └── πŸ“„ pokemonsPage.svelte.ts
β”‚   β”‚   β”œβ”€β”€ πŸ“ protected
β”‚   β”‚   β”‚   β”œβ”€β”€ πŸ“„ +page.server.ts
β”‚   β”‚   β”‚   └── πŸ“„ +page.svelte
β”‚   β”‚   β”œβ”€β”€ πŸ“„ +layout.js
β”‚   β”‚   β”œβ”€β”€ πŸ“„ +layout.svelte
β”‚   β”‚   └── πŸ“„ +page.svelte
β”‚   β”œβ”€β”€ 🎨 app.css
β”‚   β”œβ”€β”€ πŸ“„ app.d.ts
β”‚   β”œβ”€β”€ 🌐 app.html
β”‚   β”œβ”€β”€ πŸ“„ hooks.client.ts
β”‚   └── πŸ“„ hooks.server.ts
β”œβ”€β”€ πŸ“ static
β”‚   └── πŸ–ΌοΈ favicon.svg
β”œβ”€β”€ βš™οΈ .editorconfig
β”œβ”€β”€ βš™οΈ .env.dist
β”œβ”€β”€ βš™οΈ .gitignore
β”œβ”€β”€ βš™οΈ .npmrc
β”œβ”€β”€ βš™οΈ .prettierignore
β”œβ”€β”€ βš™οΈ .prettierrc
β”œβ”€β”€ πŸ“ CLAUDE.md
β”œβ”€β”€ πŸ“ README.md
β”œβ”€β”€ βš™οΈ components.json
β”œβ”€β”€ πŸ“„ eslint.config.js
β”œβ”€β”€ βš™οΈ package.json
β”œβ”€β”€ πŸ“„ playwright.config.ts
β”œβ”€β”€ πŸ“„ playwright.monocart-reporter.ts
β”œβ”€β”€ βš™οΈ pnpm-lock.yaml
β”œβ”€β”€ πŸ“„ svelte.config.js
β”œβ”€β”€ βš™οΈ tsconfig.json
└── πŸ“„ vite.config.ts

AI-Assisted Development (.claude/)

This project includes a .claude/ configuration folder that enables engineering-grade AI assistance via Claude Code. It encodes the project's coding standards, architectural patterns, and workflows so the AI follows the same rules a senior engineer would.

What It Provides

  • Scoped rules β€” Coding conventions activate only on relevant file types (e.g., Svelte standards apply to *.svelte files, TypeScript standards to *.ts files), so the AI always follows the right patterns in the right context.
  • Custom skills β€” Reusable prompts for common workflows (e.g., plan-feature generates an engineering checklist before writing code).
  • Post-edit hooks β€” Automated ESLint runs after every file edit, catching issues immediately.
  • Project instructions (CLAUDE.md) β€” A top-level file that gives the AI full context on the architecture, libraries, and quality pipeline.

.claude/ Structure

.claude/
  rules/
    coding-conventions.md   # Brace style, no inline returns
    svelte-standards.md     # Svelte 5 Runes, SvelteKit patterns, SOLID
    typescript-standards.md # satisfies, type guards, strict rules
  skills/
    plan-feature/
      SKILL.md              # Engineering checklist workflow
  settings.json             # Post-edit hooks, tool permissions

How to Use

  1. Install Claude Code
  2. Open the project β€” Claude Code automatically reads CLAUDE.md and .claude/
  3. Ask it to build features, fix bugs, or refactor β€” it will follow the project's standards

Quality Gates

flowchart LR
    Code --> PreCommit["Pre-commit: lint-staged"]
    PreCommit --> PrePush["Pre-push: E2E tests + Coverage"]
    PrePush --> CI["CI Pipeline"]
    CI --> Sentry["Sentry Monitoring"]
    CI --> Deploy
Stage Trigger Actions
Pre-commit git commit Prettier + ESLint on staged files
Pre-push git push Full Playwright E2E test suite with coverage
CI/CD Push/PR to main Lint, type-check, test, build
Runtime Production Sentry error tracking & performance monitoring

Technologies

Core

  • SvelteKit
  • TypeScript
  • Vite

Styling

  • Tailwind CSS v4
  • Bits UI
  • Tailwind Merge & Variants

Quality

  • ESLint & Prettier
  • Playwright (E2E)
  • Monocart Reporter (V8 Code Coverage)
  • Husky (Git hooks)
  • lint-staged

Observability

  • Sentry (Error tracking & Performance monitoring)

Validation

  • Zod
  • Superforms

HTTP

  • Axios

Getting Started

Install dependencies:

pnpm install

Start the development server:

pnpm dev

Build for production:

pnpm build

Preview the production build:

pnpm preview

Commands

Command Description
pnpm dev Start development server
pnpm build Build for production
pnpm preview Preview production build
pnpm check Run type checks
pnpm lint Lint and check formatting
pnpm format Format code with Prettier
pnpm test Run E2E tests
pnpm test:show-report Open Monocart test report
pnpm coverage:show-report Open V8 coverage report

Code Coverage

E2E tests collect V8 code coverage using Playwright's built-in coverage API and Monocart Reporter.

Report Formats

  • V8 HTML Report: ./coverage/e2e/v8/index.html
  • LCOV: ./coverage/e2e/lcov/code-coverage.lcov.info
  • Cobertura XML: ./coverage/e2e/cobertura/code-coverage.cobertura.xml

Environment Variables

Create a .env file with the following variables:

VITE_API_BASE_URL=your-base-api
VITE_SENTRY_DSN=your-sentry-dsn
SENTRY_DSN=your-sentry-dsn
SENTRY_ORG=your-sentry-org
SENTRY_PROJECT=your-sentry-project
SENTRY_AUTH_TOKEN=your-sentry-auth-token

CI/CD Pipeline

GitHub Actions workflow triggers on push and pull requests to main:

  1. Install dependencies (pnpm)
  2. Run linter and formatter checks
  3. Run TypeScript type checks
  4. Install Playwright browsers
  5. Execute E2E test suite
  6. Build the application

Top categories

Loading Svelte Themes