CandidLens

Docs · Operate

Configuration

Every setting, grouped by what it turns on.

Each package that needs secrets has a .env.example documenting its variables: the root one for Docker Compose, plus packages/db, apps/api and apps/web. Settings used to be named HIRELENS_*; those names still work, and the CANDIDLENS_* name wins when both are set. Empty values count as unset.

On Vercel, changed variables reach only new deployments, so redeploy after editing them. Variables that start with NEXT_PUBLIC_ are built into the web app, so they also need a rebuild.

Core

VariablePurpose
DATABASE_URLPostgres connection, e.g. postgres://postgres:postgres@localhost:5433/hirelens
BETTER_AUTH_SECRETSigns sessions. At least 32 random characters (openssl rand -base64 32); production refuses to start without one
BETTER_AUTH_URLThe app's public address; sign-in callbacks and email links are built from it
TRUSTED_ORIGINSCORS_ORIGINSComma-separated origins allowed to start sign-in or call the API
NEXT_PUBLIC_SITE_URLCanonical address for the sitemap, robots and link previews
NEXT_PUBLIC_API_URLLeave empty when the API runs inside the web app (Vercel); set it for a separate API service
PORTAPI port when it runs on its own (default 4000)

Sign-in

VariablePurpose
GOOGLE_CLIENT_IDGOOGLE_CLIENT_SECRETGoogle sign-in. Redirect URL: <origin>/api/auth/callback/google
GITHUB_CLIENT_IDGITHUB_CLIENT_SECRETGitHub sign-in. Redirect URL: <origin>/api/auth/callback/github
NEXT_PUBLIC_GOOGLE_OAUTH_ENABLEDNEXT_PUBLIC_GITHUB_OAUTH_ENABLEDShow the matching button. Set to true only when the server keys above exist

Email

Email powers password reset, email confirmation and changing an email. See Accounts & sign-in.

VariablePurpose
CANDIDLENS_SMTP_USERCANDIDLENS_SMTP_PASSWORDSMTP sign-in. The defaults fit a Gmail account with 2-Step Verification and an app password; use a dedicated account, not a personal one
CANDIDLENS_SMTP_HOSTCANDIDLENS_SMTP_PORTAnother provider. Port 465 starts with TLS; any other port must upgrade to TLS before the password is sent
CANDIDLENS_MAIL_FROMThe sender, e.g. "CandidLens" <you@example.com>
NEXT_PUBLIC_EMAIL_ENABLEDOnly with a separate API service: whether the web app offers the email features. On Vercel it is worked out from the SMTP settings

Without the SMTP settings, a development server prints each email (with its link) to its log, and a production server hides the email features. Gmail sends about 500 emails a day; mail from a new Gmail account may land in spam at first.

Models

VariablePurpose
CANDIDLENS_LLM_PROVIDERCANDIDLENS_LLM_MODELTurns on scoring: google, anthropic, groq, openrouter, mistral, cerebras or ollama
CANDIDLENS_LLM_API_KEYCANDIDLENS_LLM_BASE_URLThe provider's key, and its address for Ollama or a compatible gateway
CANDIDLENS_LLM_FALLBACKSFailover chain, e.g. groq,openrouter, tried only when the primary is overloaded or rate-limited. Each fallback needs CANDIDLENS_LLM_<ID>_MODEL (plus _API_KEY, _BASE_URL); a fallback never borrows the primary's model id
CANDIDLENS_LLM_DEADLINE_MSOverall retry and failover budget (default 120000 ms, at most 600000) so a request can't outlive a serverless limit
CANDIDLENS_EMBEDDING_API_KEYA Google AI key for search by meaning; resume text goes to Google's embedding model, gemini-embedding-2. Without it, the model key is used when the provider is google, then CANDIDLENS_LLM_GOOGLE_API_KEY. Another provider's key is never sent to Google; with no Google key, search matches keywords

Without a model, the model-backed features (scoring, rubric drafting and Ask) are off and the rest of the app works; the public demo falls back to a deterministic heuristic.

Observability

All optional, and off until set. Nothing phones home by default.

VariablePurpose
SENTRY_DSNError tracking
LANGFUSE_PUBLIC_KEYLANGFUSE_SECRET_KEYLANGFUSE_BASE_URLModel tracing
NEXT_PUBLIC_POSTHOG_KEYNEXT_PUBLIC_POSTHOG_HOSTProduct analytics: explicit events only, autocapture off

Checking a deployment

GET /api/health answers quickly without touching the database. GET /api/health?db=1 also compares the applied migrations with the code, and answers 503 with "migrationsPending": true and a message naming the command to run when the schema is behind.