Self-Hosting Guide
Environment Variables
OvenLovin requires the following environment variables to function. Set these in your hosting platform or .env.local file for local development.
| Variable | Required | Description | Where to Get |
|---|---|---|---|
DATABASE_URL | Yes | PostgreSQL connection string | Neon Console or your database provider |
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY | Yes | Clerk publishable key for authentication | Clerk Dashboard → API Keys |
CLERK_SECRET_KEY | Yes | Clerk secret key for server-side auth | Clerk Dashboard → API Keys |
BLOB_READ_WRITE_TOKEN | Yes | Vercel Blob storage token for recipe photos and OCR | Vercel Storage → Create Blob Store |
AI_GATEWAY_API_KEY | No | Optional API key for local or non-Vercel hosts. On Vercel, AI Gateway authenticates with OIDC (VERCEL_OIDC_TOKEN) | Vercel AI Gateway |
USDA_FDC_API_KEY | No | Reserved for FoodData Central nutrition (not read today). Not required to deploy | FoodData Central |
NEXT_PUBLIC_INSTANCE_NAME | No | Name shown on the landing page (defaults to Your OvenLovin) | Set this so the deployed site feels like yours |
OVENLOVIN_VERCEL_TEAM_SLUG | No | Vercel team/account slug for landing-page dashboard links. This is not the GitHub owner (tbarho vs ty-barho) | Vercel dashboard URL: vercel.com/<team-slug>/... |
OVENLOVIN_VERCEL_PROJECT_SLUG | No | Vercel project slug if it differs from the git repo name | Vercel project settings |
VERCEL_TOKEN / OVENLOVIN_VERCEL_TOKEN | No | Optional token to resolve team/project slugs from VERCEL_PROJECT_ID when the overrides are unset. Without slugs or a token, links fall back to https://vercel.com/dashboard | Vercel account tokens |
RK_MODEL_DEFAULT | No | Paste-import model (default: deepseek/deepseek-v4.1-flash) | N/A - set custom model |
RK_MODEL_VISION | No | Photo-import vision model (default: deepseek/deepseek-v4.1-flash) | N/A - set custom model |
RK_MODEL_EXTRACT | No | URL-import text model after JSON-LD/HTML miss. Falls back to RK_MODEL_DEFAULT, then DeepSeek. DeepSeek failures retry openai/gpt-6-luna | N/A - set custom model |
RECIPE_IMPORT_CACHE_FALLBACK | No | Set 0 to skip public copies (Google Translate, then Jina Reader). Default on. No API key | N/A |
Getting API Keys
Neon (Database)
- Sign up at console.neon.tech
- Create a new project
- Copy the connection string (starts with
postgresql://) - Set as
DATABASE_URL
Clerk (Authentication)
- Sign up at dashboard.clerk.com
- Create a new application
- Go to API Keys in the sidebar
- Copy:
- Publishable Key →
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY - Secret Key →
CLERK_SECRET_KEY
- Publishable Key →
Vercel Blob (Storage)
- Go to vercel.com/dashboard/stores
- Click Create Database → Blob
- Name your store (e.g.,
ovenlovin-uploads) - Copy the Read Write Token →
BLOB_READ_WRITE_TOKEN
Vercel AI Gateway
On a Vercel deployment, AI Gateway authenticates with OIDC automatically. You do not need AI_GATEWAY_API_KEY.
For local development or a non-Vercel host:
- Follow the Vercel AI Gateway setup guide
- Create a key, or run
vercel env pullto getVERCEL_OIDC_TOKEN - Set
AI_GATEWAY_API_KEYonly if you are not using OIDC
USDA FoodData Central
- Go to fdc.nal.usda.gov/api-key-signup.html
- Sign up for a free API key
- Set as
USDA_FDC_API_KEY
Deploy to Vercel
The fastest way to deploy OvenLovin is using Vercel's one-click deployment.
One-Click Deploy
The one-click deploy will:
- Fork the repository to your GitHub account
- Create a new Vercel project
- Provision Neon Postgres, Vercel Blob, and Clerk (auto-configures
DATABASE_URL, the blob token, and Clerk keys) - Prompt for optional
NEXT_PUBLIC_INSTANCE_NAME(USDA is optional; AI Gateway uses OIDC on Vercel) - Run database migrations during the build
- Deploy the Next.js application
If the Clerk store is not offered in the clone flow, set NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY and CLERK_SECRET_KEY in the Vercel project.
Manual Vercel Deploy
If you prefer to deploy manually:
Neon Database Setup
OvenLovin uses Neon as the recommended PostgreSQL provider for serverless deployments.
Create Database
- Sign up at console.neon.tech
- Click Create Project
- Choose:
- Name:
ovenlovin - Region: closest to your users
- PostgreSQL Version: 16 or later
- Name:
- Click Create Project
Get Connection String
After project creation:
- Go to Dashboard → Connection Details
- Copy the connection string:
- Add to your environment variables as
DATABASE_URL
Vercel Integration (Recommended)
For automatic configuration:
- In Vercel project settings, go to Integrations
- Add Neon integration
- Authorize and connect your Neon project
DATABASE_URLwill be automatically configured
Clerk Organizations Setup
OvenLovin uses Clerk Organizations to represent households. Each household is a Clerk Organization.
Enable Organizations
- Go to dashboard.clerk.com
- Select your application
- Go to Configure → Organizations
- Toggle Enable Organizations
- Configure:
- Organization Name: Required
- Roles: Keep default (admin, member)
- Permissions: Default settings work well
Organization Settings
Recommended settings:
- Maximum organizations per user: 5 (one person can be in multiple households)
- Allow members to leave: Yes
- Require admin approval for new members: No (family invitations)
- Delete organization when last admin leaves: Yes
Domain Restrictions
For families, you typically want:
- Domains: None (allow any email)
- Verified domains: Not required
Going to production with Clerk
Clerk development instances (pk_test_...) rely on a cross-site handshake that can loop forever in browsers that block third-party cookies (Safari tracking prevention, private tabs, in-app browsers). Use a production instance (pk_live_...) for real users. See Clerk's production deployment guide.
- Create the production instance in the Clerk Dashboard. It needs a custom domain you own - not
*.vercel.app. - Add every DNS record shown on the Clerk Domains page: the
clerk.,accounts.,clkmail.,clk._domainkey., andclk2._domainkey.CNAMEs. On Cloudflare, set them to DNS only (not proxied). - Configure social providers (for example Google) with your own OAuth credentials. Production does not use Clerk's shared dev credentials.
- In Vercel Production env vars, replace
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEYandCLERK_SECRET_KEYwith the production keys, then redeploy.
Paths settings do not copy over from development. OvenLovin sends sign-in and sign-up to its own /sign-in and /sign-up pages by default, so nothing to configure there. Override with NEXT_PUBLIC_CLERK_SIGN_IN_URL / NEXT_PUBLIC_CLERK_SIGN_UP_URL if needed.
Carry existing kitchens over
Users and sessions do not carry over from development - everyone signs up again and gets a new Clerk user id. OvenLovin keys user rows by Clerk user id (user.clerk_user_id), so remap each existing person before they first sign in on production. Otherwise a new, empty kitchen is created for them.
Create the production user first (Clerk Dashboard → Users) to get the new id.
Database Migrations
On Vercel, migrations run automatically at the end of the web app build (pnpm --filter @ovenlovin/db db:migrate:deploy). The script prefers a direct (non-pooled) Neon URL when one is available.
If the database already has tables - for example from an earlier drizzle-kit push - and Drizzle has no migration history, the deploy script baselines drizzle.__drizzle_migrations so the initial migration is not re-applied.
Local / manual
Migration Location
Migrations are in packages/db/drizzle/. History lives in the drizzle schema (drizzle.__drizzle_migrations), not in public. The initial migration 0000_yellow_shooting_star.sql creates household, person, recipe, meal-plan, and shopping-list tables.
Verify Deployment
After deployment and database setup:
Check Health
Should return:
Test Authentication
- Visit your deployed URL
- Click Sign In
- Create an account
- Should redirect to dashboard
Test Database
- Sign in
- Go to Settings → Household
- Create a household (Clerk Organization)
- Add a person with dietary rules
- Data should persist on refresh
Troubleshooting
Database Connection Errors
Error: ENOTFOUND or connection refused
- Verify
DATABASE_URLis correct - Check Neon project is not paused (free tier auto-pauses)
- Ensure IP allowlist includes Vercel IPs (if configured)
Clerk Authentication Errors
Error: Invalid publishable key
- Verify
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEYstarts withpk_ - Ensure key matches your Clerk environment (development vs production)
Error: Organizations not enabled
- Go to Clerk Dashboard → Organizations → Enable Organizations
- Redeploy after enabling
Blob Storage Errors
Error: Unauthorized or invalid token
- Verify
BLOB_READ_WRITE_TOKENis set correctly - Check token has read/write permissions
- Ensure Blob store is in the same Vercel team/project
Migration Errors
Error: relation already exists
- You may have run
drizzle-kit pushbefore migrations - Re-run
pnpm --filter @ovenlovin/db db:migrate:deploy- it baselinesdrizzle.__drizzle_migrationswhen thehouseholdtable already exists and no history is recorded
Error: Cannot connect to database
- Verify
DATABASE_URLenvironment variable - Run migrations from a location with database access
- For serverless: use Vercel's environment with
vercel env pull
Next Steps
- Connect Your Agent - Set up Grok Bot, ChatGPT, or Claude Desktop
- Import Recipes - Start adding recipes to your instance