Setup. From clone to first run.

A short path from a fresh checkout to a working local Plooi instance.

Prerequisites

  • Node.js 18+
  • A Gemini, OpenAI, or Anthropic API key (for local development)
  • A Supabase project
  • A Stripe account (for billing flows)
  • The Supabase CLI (for edge functions and secrets)

Quickstart

Install dependencies

npm install

Configure the environment

cp .env.local.example .env.local

Required frontend variables:

VITE_GEMINI_API_KEY=your_gemini_key
VITE_SUPABASE_URL=https://your-project.supabase.co
VITE_SUPABASE_ANON_KEY=your_anon_key
VITE_STRIPE_PUBLISHABLE_KEY=pk_test_xxxxx
VITE_STRIPE_PRICE_PLUS_MONTHLY=price_xxxxx
VITE_STRIPE_PRICE_PRO_MONTHLY=price_xxxxx
VITE_STRIPE_PRICE_CREDIT_PACK=price_xxxxx

Initialize Supabase

  • Run the schema in database/supabase-schema.sql from the Supabase SQL editor.
  • RLS is on by default — all access goes through policies.

Set Supabase secrets

supabase secrets set STRIPE_SECRET_KEY=sk_test_xxxxx
supabase secrets set STRIPE_WEBHOOK_SECRET=whsec_xxxxx
supabase secrets set SUPABASE_SERVICE_ROLE_KEY=your_service_role_key
supabase secrets set API_KEY_ENCRYPTION_SECRET="your-long-random-secret"

Deploy edge functions

supabase functions deploy ai-proxy
supabase functions deploy create-checkout-session
supabase functions deploy create-portal-session
supabase functions deploy stripe-webhook

Start the app

npm run dev
⚠️

Server-side secrets do not belong in .env.local. Anything with admin privileges lives in Supabase Secrets — a separate store from the database, never shipped to the browser.

Optional

  • Email (Resend): set the Resend API key as a Supabase secret, enable sending in the relevant edge functions.
  • Analytics: VITE_POSTHOG_KEY + VITE_POSTHOG_HOST (EU instance recommended).
  • Monitoring: add the Sentry DSN in Vercel or Netlify.