sveltekit-drizzle Svelte Themes

Sveltekit Drizzle

Experimenting with SvelteKit, Drizzle ORM, Lucia, Superforms, and more

New Tech Stack

  • SvelteKit
  • Drizzle ORM
    • Zod integration
  • Lucia
    • Drizzle integration
  • Superforms
    • Client and server-side validation
    • SvelteKit actions, works without javascript
    • Zod integration
  • Zod
  • Postgres (Neon)
  • Redis (Upstash)
  • Storage (Cloudflare R2)

Setup SvelteKit / Vercel

Run server

  • vercel env pull .env.development.local
  • npm run dev

Drizzle

Update model

  • Update schema.ts
  • npm run migrate
  • npm run migrate:apply or run generated SQL scripts (lists in console, or view drizzle directory)

Lucia

Superforms

Environment Variables

Current variables defined using Vercel dashboard (setting up Vercel Postgres or Vercel Neon integration)

console.log({
    // Vercel
    POSTGRES_URL: env.POSTGRES_URL,
    POSTGRES_HOST: env.POSTGRES_HOST,
    POSTGRES_USER: env.POSTGRES_USER,
    POSTGRES_PASSWORD: env.POSTGRES_PASSWORD,
    POSTGRES_DATABASE: env.POSTGRES_DATABASE,

    // Neon
    DATABASE_URL: env.DATABASE_URL,
    PGHOST: env.PGHOST,
    PGUSER: env.PGUSER,
    PGPASSWORD: env.PGPASSWORD,
    PGDATABASE: env.PGDATABASE
});

Hosting

Top categories

Loading Svelte Themes