Full-Stack Solo SaaS Toolkit
Everything a solo developer needs to ship a paid SaaS in record time: Better-Auth authentication (including Passkeys/WebAuthn and TOTP 2FA), switchable Drizzle ORM (Neon PostgreSQL or Turso LibSQL), Polar.sh payments & subscriptions, Resend transactional emails, and drop-in Svelte 5 runes components.
Live Component Playground
Interact with real Svelte 5 SaaS components rendered below.
Welcome back
Sign in to access your dashboard and workspace.
1. Database Configuration (Neon vs. Turso)
Choose between serverless PostgreSQL (Neon) or edge LibSQL/SQLite (Turso) by setting DATABASE_DRIVER in your .env:
1# .env2# For Neon PostgreSQL:3DATABASE_DRIVER="neon"4DATABASE_URL="postgresql://user:password@ep-cool-db.us-east-2.aws.neon.tech/neondb?sslmode=require"56# OR For Turso SQLite:7# DATABASE_DRIVER="turso"8# DATABASE_URL="libsql://your-db-org.turso.io"9# DATABASE_AUTH_TOKEN="your-turso-token"2. Authentication in 1 Hook (`src/hooks.server.ts`)
Attach Better-Auth session validation and protected dashboard route guards with createYaxaAuthHook:
1// src/hooks.server.ts2import { sequence } from '@sveltejs/kit/hooks';3import { createYaxaHook, createYaxaAuth, createYaxaAuthHook } from 'yaxa-svelte/server';4import { siteConfig } from './site.config';56const yaxaHook = createYaxaHook(siteConfig);7const auth = createYaxaAuth({8 passkey: { enabled: true },9 twoFactor: { enabled: true, issuer: 'My SaaS' }10});1112const authHook = createYaxaAuthHook({13 auth,14 protectedPaths: ['/dashboard', '/settings', '/billing'],15 loginPath: '/login'16});1718export const handle = sequence(yaxaHook, authHook);3. Polar.sh Payments & Webhooks
Create instant checkout endpoints and handle webhooks with automatic Drizzle database synchronization:
1// src/routes/api/webhooks/polar/+server.ts2import { createPolarWebhookHandler } from 'yaxa-svelte/polar';34export const POST = createPolarWebhookHandler({5 onSubscriptionCreated: async (event) => {6 console.log('New paid subscription created!', event.data.id);7 }8});4. Subpath Module Architecture (Zero-Bundle Tax)
Yaxa isolates full-stack dependencies via dedicated subpath exports, ensuring pure client and static documentation projects don't download or bundle unused backend libraries:
1// 1. Core UI Components & Headless Actions (Zero Backend Overhead)2import { Button, Modal, UserMenu, useToast, useColorMode, springTilt } from 'yaxa-svelte';34// 2. Full-Stack Client Auth (Passkeys, 2FA, & Polymorphic AuthCards)5import { useAuth, AuthCard, PasskeyUI, TwoFactorModal } from 'yaxa-svelte/auth';67// 3. SvelteKit Server Hooks, Auth Factory, Pagination & SEO Handlers8import { createYaxaHook, createYaxaAuth, createYaxaAuthHook, parseDataTableQuery } from 'yaxa-svelte/server';910// 4. Drizzle ORM Database Schema & Client11import { getDb, schemaPg, schemaSqlite } from 'yaxa-svelte/db';1213// 5. Polar.sh Billing & Webhooks14import { createPolarCheckout, createPolarWebhookHandler } from 'yaxa-svelte/polar';1516// 6. S3 / Cloudflare R2 Presigned Uploads17import { createPresignedUploadUrl } from 'yaxa-svelte/storage';