Docs · Get started
Self-hosting
One command starts the full stack: web, API and Postgres, with migrations applied on boot. Run the model on Ollama and leave the API keys empty, and resumes never leave your network.
The 60-second version
git clone https://github.com/abhay-yemekar/candidlens.git && cd candidlens
cp .env.example .env # set BETTER_AUTH_SECRET (openssl rand -base64 32)
docker compose up --build -dYou need Docker Compose 2.24 or newer, because docker-compose.yml loads .env with required: false.
To check that it works:
- Open
localhost:3000, create an account, then create an organization. - Open
localhost:4000/api/health. The API answers"ok": trueand shows whether a model is configured.
Only Postgres has a healthcheck, so it is the only service docker compose ps reports as healthy. Postgres listens on localhost:5433. The images build from apps/api/Dockerfile and apps/web/Dockerfile.
What's in the stack
| Container | Image | Notes |
|---|---|---|
| hirelens-postgres | pgvector/pgvector:pg16 | Vector extension baked in; data in the hirelens_pgdata volume |
| hirelens-api | built from source | Hono server; applies migrations on boot |
| hirelens-web | built from source | Next.js standalone output |
Environment variables
| Variable | Required | Purpose |
|---|---|---|
BETTER_AUTH_SECRET | yes | Signs sessions. Generate it with openssl rand -base64 32; Compose won't start without it. |
BETTER_AUTH_URL | no | Better Auth's base address. Compose and .env.example both use http://localhost:4000. |
DATABASE_URL | no | Postgres connection. Compose sets it for the API container; outside Compose the API defaults to postgres://postgres:postgres@localhost:5433/hirelens. |
CORS_ORIGINS | no | Allowed web origins (default covers :3000) |
CANDIDLENS_LLM_PROVIDER / _MODEL / _API_KEY | no | Enables real scoring; without them derive/score return 503 llm_not_configured |
CANDIDLENS_LLM_FALLBACKS (+ per-provider CANDIDLENS_LLM_<ID>_MODEL, _API_KEY, _BASE_URL) | no | Failover chain for overloaded moments. Every fallback needs its own _MODEL (a provider never inherits another provider's model id — validation fails at boot otherwise), e.g. openai/gpt-oss-120b for Groq. |
CANDIDLENS_LLM_DEADLINE_MS | no | Overall retry/failover deadline in ms (default 120000). Keeps the retry ladder inside serverless function limits. |
CANDIDLENS_SMTP_USER / _PASSWORD (+ _HOST, _PORT, CANDIDLENS_MAIL_FROM) | no | Email for password reset and address confirmation; the defaults fit a Gmail app password. Also set NEXT_PUBLIC_EMAIL_ENABLED=true so the web image offers “Forgot password?”. |
SENTRY_DSN, LANGFUSE_*, NEXT_PUBLIC_POSTHOG_KEY | no | Observability; off until set |
Configuration lists every setting. The model providers are google, anthropic, groq, openrouter, mistral, cerebras and ollama. Empty values count as unset.
The API container reads every setting in the root .env; Compose fixes only DATABASE_URL, NODE_ENV and PORT. The web image takes the NEXT_PUBLIC_* settings when it is built, so rebuild it after changing them: docker compose up --build -d web.
Settings used to be named HIRELENS_*. Those names still work; when both are set, the CANDIDLENS_* name wins.
Local LLM mode (resumes never leave)
Install Ollama, pull a model, and point the API at it:
CANDIDLENS_LLM_PROVIDER=ollama
CANDIDLENS_LLM_MODEL=llama3.1
CANDIDLENS_LLM_BASE_URL=http://host.docker.internal:11434/v1Leave CANDIDLENS_LLM_API_KEY and CANDIDLENS_EMBEDDING_API_KEY empty. Parsing, rubric drafting, scoring and evidence extraction then run inside your network, and search matches keywords instead of meaning.
The API calls out only for what you turn on:
- Your model provider. With Ollama, that is your own machine.
- Google's embedding API, for search by meaning, when an embedding key is set (see Configuration). It receives resume text.
- Your SMTP server, when you set up email.
- The resume link in each ATS webhook call, when you connect an ATS.
- Sentry and Langfuse, when you set their keys. PostHog runs in the browser and needs
NEXT_PUBLIC_POSTHOG_KEY.
With Ollama, no keys, email unset and no ATS connected, the API makes no outside calls and resumes never leave your network.
Backups
The entire state of an instance is one Postgres database:
docker exec hirelens-postgres pg_dump -U postgres hirelens > backup.sql
# restore:
cat backup.sql | docker exec -i hirelens-postgres psql -U postgres hirelensUpgrades
git pull
docker compose up --build -dMigrations run automatically on API boot. Down-time is one container restart. To wipe everything for a clean test: docker compose down -v — ⚠️ this deletes the data volume.