- Import the GitHub repo in Vercel (or use the Deploy button on the README).
- Create a Supabase project and copy the Postgres URIs (Configuration).
- In Vercel → Settings → Environment Variables, set at least:
DATABASE_URL— pooled URI for the appENCRYPTION_KEY—openssl rand -hex 32- Optionally
DIRECT_URL— direct URI (you will use it for migrate)
- Deploy.
Do not store provider API keys in Vercel env.
Vercel’s default build is prisma generate && next build. That does not create tables.
The first time you deploy (and whenever a release adds prisma/migrations/…), apply migrations yourself.
Easiest: from your laptop, with the direct connection string (not PgBouncer port 6543):
cd OpenCiteX
DATABASE_URL="postgresql://USER:PASSWORD@HOST:5432/postgres?schema=YOUR_SCHEMA" npx prisma migrate deployUse the same schema query param as production if you are not on public.
Why a direct URL: Prisma migrate needs a real Postgres session (locks). A transaction-mode pooler often fails or hangs.
You do not run this inside the Vercel dashboard. There is no “run npx” button. Either:
- Run the command locally against production Postgres (above), or
- Change the Vercel Build Command so every deploy migrates first:
DATABASE_URL="$DIRECT_URL" npx prisma migrate deploy && npx prisma generate && next buildSet DIRECT_URL in Vercel if you use that build command. If DIRECT_URL is missing, the build will fail.
- Open
https://your-deployment/setupand save the recovery code. - Sign in → API Keys → paste BYOK keys.
- Brands → add a brand → Dashboard → Run scan.
If the instance is on the public internet, put it behind your usual access control (Vercel Deployment Protection, a VPN, or similar). Encryption at rest is not a firewall.
On the server:
docker compose up -d
cp .env.example .env
# set ENCRYPTION_KEY and DATABASE_URL
npm ci
npx prisma migrate deploy
npm run build
npm startPoint a reverse proxy at the Node process. Keep .env off the public repo.
npx prisma db seed creates the MetaCitex sample brand only if no brand exists. Optional on production.
git pull
npm ci
npx prisma migrate deploy # when new migration folders landed
npm run build # or let Vercel rebuild