A modern, type-safe, full-stack starter template for building real-time web applications with incredible developer experience.
$state
, $derived
, $effect
)Install Bun:
curl -fsSL https://bun.sh/install | bash
# Clone this template
git clone https://github.com/yourusername/svelte-convex-starter my-app
cd my-app
# Install dependencies
bun install
# Start development server
bun run dev
Visit http://localhost:5173 to see your app! š
If you want to use the real-time database:
# Install Convex
bun add convex convex-svelte
# Initialize Convex (creates convex/ directory)
bunx convex dev --once --configure=new
# Start Convex dev server (in a separate terminal)
bunx convex dev
If you need authentication:
# Install Better Auth
bun add better-auth
# Follow the setup guide in .cursor/rules/001_quick_reference.mdc
āāā src/
ā āāā routes/ # SvelteKit routes (pages & API endpoints)
ā āāā lib/ # Shared components and utilities
ā āāā app.html # HTML template
āāā convex/ # Convex backend (schemas, queries, mutations)
āāā static/ # Static assets
āāā .cursor/
ā āāā rules/ # Comprehensive documentation for AI assistants
ā āāā 001_quick_reference.mdc
ā āāā 002_integration_example.mdc
ā āāā 003_detailed_reference.mdc
āāā svelte.config.js # SvelteKit configuration
# Development
bun run dev # Start dev server
bun run dev -- --open # Start dev server and open browser
# Building
bun run build # Build for production
bun run preview # Preview production build
# Code Quality
bun run check # Type-check your code
bun run format # Format code with Prettier
bun run lint # Lint code
# Convex (if using)
bunx convex dev # Start Convex dev server
bunx convex deploy # Deploy Convex to production
This starter comes with comprehensive documentation optimized for AI assistants (Cursor, GitHub Copilot, etc.):
<script>
// Reactive state
let count = $state(0);
// Computed values
let doubled = $derived(count * 2);
// Side effects
$effect(() => {
console.log('Count:', count);
});
</script>
<script>
import { useQuery, useMutation } from 'convex-svelte';
import { api } from '../convex/_generated/api';
const posts = useQuery(api.posts.list, {});
const createPost = useMutation(api.posts.create);
</script>
{#if $posts === undefined}
<p>Loading...</p>
{:else}
<ul>
{#each $posts as post}
<li>{post.title}</li>
{/each}
</ul>
{/if}
$state
, $derived
, $effect
), not Svelte 4 syntaxsvelte.config.js
This is a personal starter template, but feel free to fork it and adapt it to your needs!
MIT
Built with ā¤ļø using SvelteKit, Convex, and Bun