# SvelteKit + server routes
URL: https://wwadd.dev/stacks/sveltekit-server-routes
Last verified: 2026-09-30

A Svelte-first application workflow for public pages and authenticated features: server loads and form actions keep sensitive work beside the UI.

## When to use it
- Public pages need server rendering or prerendering
- The team prefers Svelte and a small application framework
- Authentication and data access can be implemented in server routes

## How the pieces fit
Svelte components own interactive UI. SvelteKit loads route data and handles form actions on the server; private credentials and authorization stay there. Choose an adapter for the deployment target, then add a database and session implementation suited to the product. Validate input and permissions for every action, and test cookies, redirects, and cache boundaries in the deployed runtime.

## The tech and its role
- SvelteKit: Routing, server loads, form actions, and deployment adapters
- TypeScript: Types across route data and UI boundaries

## Real-world examples
- Svelte RealWorld: The official example demonstrates CRUD, authentication, routing, and pagination. A learning application, not evidence of a particular database or hosting provider. (source: https://github.com/sveltejs/realworld)
- Svelte tutorial site: The archived learn.svelte.dev repository contains a SvelteKit teaching application. Historical architecture reference; use current framework documentation for new projects. (source: https://github.com/sveltejs/learn.svelte.dev)

## Skip if
Skip if the team requires React, or the product needs organization SSO or collaborative editing without first designing those systems.

## Testing and shipping
- [Test the behavior users depend on](https://wwadd.dev/moves/testing-shipping/test-user-behavior)
- [Check keyboard access and automated accessibility](https://wwadd.dev/moves/testing-shipping/keyboard-accessibility-check)
- [Investigate flaky browser tests](https://wwadd.dev/moves/testing-shipping/diagnose-flaky-tests)
- [Verify the production build before release](https://wwadd.dev/moves/testing-shipping/verify-built-release)
- [Keep secrets out of browser bundles](https://wwadd.dev/moves/testing-shipping/keep-secrets-server-side)
- [Make CI validate the same release inputs](https://wwadd.dev/moves/testing-shipping/ci-release-gates)
- [Capture errors with useful context](https://wwadd.dev/moves/testing-shipping/error-reporting-context)
- [Prepare rollback before publishing](https://wwadd.dev/moves/testing-shipping/plan-release-rollback)

