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
| Variable | Required | Description | How to get it |
|---|---|---|---|
DATABASE_URL | Yes | PostgreSQL connection string | Supabase dashboard → Project Settings → Database → Connection string |
NEXTAUTH_SECRET | Yes | Random string for session signing | openssl rand -base64 32 |
SUPER_ADMIN_EMAILS | Yes | Comma-separated list of super-admin emails | Your email(s), e.g. admin@company.com |
CONFIG_ENCRYPTION_KEY | Yes | 64-character hex string — encrypts credentials at rest | openssl 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
- Configure at least one email transport (Azure AD or SMTP) so future logins work via magic link.
- Configure at least one calendar source (Azure AD or Google Workspace) so events appear.
- Add Standard ERP connections for ERP activity sync.
- Invite members at Admin → Members.
See Azure AD, Google Workspace, SMTP, and ERP connections for each step.