Skip to content

spencerjsmall/prisma-supabase-starter

Repository files navigation

Nuxt + Prisma + Supabase Starter

Setup

  1. Initialize Supabase project:
supabase init
  1. Add local db connection strings to .env

  2. Install dependencies (Node version 20.x):

npm install
  1. Setup Snaplet Snapshot:
npx @snaplet/snapshot setup
  1. Add project to Vercel for production use.

Development Server

Start the development server on http://localhost:3000:

npm run dev

This will start the local supabase db and run the Nuxt app.

Useful actions

Build local db using snapshot of production db:

npm run db:build

Remove all cached snapshots and rebuild local db:

npm run db:reset

Generate a migration script and migrate the local db based on schema.prisma changes:

npm run db:apply

CI/CD

Before merging your local db changes:

  • Use npm run build as the build command wherever you're deploying (e.g. Vercel)
  • Set production environment variables for database connection strings

When this app is built for production, Prisma Migrate will apply new migrations to the production database automatically.

About

A minimal starter template for productionizing a Prisma + Supabase stack

Topics

Resources

Stars

Watchers

Forks