Documentation
User & admin guide
Back to Calendar
Admin guide

Installation

Environment variables, deploying to Vercel, running database migrations, and getting past the bootstrap login.

herbe.calendar deploys as a Next.js app on Vercel backed by a PostgreSQL database (Supabase recommended). Four environment variables are required before the first boot.

Environment variables

VariableRequiredDescriptionHow to get it
DATABASE_URLYesPostgreSQL connection stringSupabase dashboard → Project Settings → Database → Connection string
NEXTAUTH_SECRETYesRandom string for session signingopenssl rand -base64 32
SUPER_ADMIN_EMAILSYesComma-separated list of super-admin emailsYour email(s), e.g. admin@company.com
CONFIG_ENCRYPTION_KEYYes64-character hex string — encrypts credentials at restopenssl rand -hex 32

All other configuration (Azure AD, ERP connections, Google Workspace, SMTP) is done through the admin UI after first login. No other env vars are required at deploy time.

Deploy to Vercel

git clone <repo-url>
cd herbe-calendar
npm install
npx vercel

Add the four environment variables to your Vercel project under Project → Settings → Environment Variables (or via vercel env add).

Run database migrations

Pull the environment locally, then run the migration files in order:

npx vercel env pull .env.local
source .env.local
for f in db/migrations/*.sql; do psql "$DATABASE_URL" -f "$f"; done

Migrations create all required tables on a clean database. Running them again on an existing database is safe — each migration is idempotent.

First login — the bootstrap problem

On a brand-new install there is no Azure or SMTP connection yet, so the app can't send the magic-link email. Two ways around this:

Option A (recommended) — temporarily set Azure env vars directly for the initial login, then configure Azure through the admin UI and remove the env vars:

npx vercel env add AZURE_TENANT_ID production
npx vercel env add AZURE_CLIENT_ID production
npx vercel env add AZURE_CLIENT_SECRET production
npx vercel env add AZURE_SENDER_EMAIL production

After first login, go to Admin → Config → Azure AD, enter the same values, save and test, then remove the env vars.

Option B — manually insert a session record into the database. Contact support for the exact SQL if you need this path.

After first login

  1. Configure at least one email transport (Azure AD or SMTP) so future logins work via magic link.
  2. Configure at least one calendar source (Azure AD or Google Workspace) so events appear.
  3. Add Standard ERP connections for ERP activity sync.
  4. Invite members at Admin → Members.

See Azure AD, Google Workspace, SMTP, and ERP connections for each step.