This guide covers all configuration options for your self-hosted Bilanc deployment, including environment variables, database setup, and tenant configuration.
Initial Setup
Create your environment file :
Edit .env with your configuration values as described below.
Configure your tenant in tenant_config.yaml.
Environment Variables
Database Configuration
Bilanc requires a PostgreSQL database. Configure the connection details:
Variable Description Default Example POSTGRES_HOSTHostname or IP of the PostgreSQL server dbdb.example.comPOSTGRES_PORTPort number 54325432POSTGRES_DATABASEDatabase name bilancbilanc_prodPOSTGRES_USERNAMEDatabase user bilancbilanc_userPOSTGRES_PASSWORDDatabase password - secure_passwordRAW_DATA_SCHEMASchema for raw data storage bilancbilanc
# Database Configuration
POSTGRES_HOST = your_postgres_host
POSTGRES_PORT = 5432
POSTGRES_DATABASE = bilanc_db
POSTGRES_USERNAME = your_username
POSTGRES_PASSWORD = your_secure_password
RAW_DATA_SCHEMA = bilanc
AI Provider Configuration
Bilanc uses AI for generating insights. Choose one provider and configure its API key:
Variable Description Example AI_PROVIDERAI backend: openai, anthropic, or google-ai openaiAI_MODELSpecific model to use gpt-4oOPENAI_API_KEYAPI key for OpenAI (if AI_PROVIDER=openai) sk-...ANTHROPIC_API_KEYAPI key for Anthropic (if AI_PROVIDER=anthropic) sk-ant-...GOOGLE_API_KEYAPI key for Google AI (if AI_PROVIDER=google-ai) AIza...
Only set the API key corresponding to your chosen AI_PROVIDER.
# AI Configuration
AI_PROVIDER = openai
AI_MODEL = gpt-4o
OPENAI_API_KEY = sk-...
Integration Tokens
Configure tokens for the data sources you want to connect:
Variable Description Example GITHUB_ACCESS_TOKENGitHub Personal Access Token with repo and read:org scopes ghp_...GITHUB_REPOSITORYSpace-separated list of repositories (owner/name format) org/repo-1 org/repo-2LINEAR_ACCESS_TOKENLinear API token lin_api_...CURSOR_API_KEYCursor API key cursor_...
# Integration Tokens
GITHUB_ACCESS_TOKEN = ghp_abcdef1234567890
GITHUB_REPOSITORY = bilanc/frontend bilanc/backend bilanc/api
LINEAR_ACCESS_TOKEN = lin_api_xxxxx
CURSOR_API_KEY = cursor_xxxxx
See Integrations for detailed setup instructions for each integration.
Application Settings
Configure the frontend and application behavior:
Variable Description Example FRONTEND_URLPublic URL of your Bilanc dashboard https://dashboard.yourdomain.comNEXT_PUBLIC_API_URLAPI URL for the frontend http://host.docker.internal:8000NEXT_PUBLIC_AUTH_URLAuthentication provider URL https://auth.yourdomain.comNEXT_PUBLIC_AUTH_API_KEYAuthentication API key your_auth_api_keyENVIRONMENTEnvironment name dev or production
# Application Settings
FRONTEND_URL = https://dashboard.yourdomain.com
NEXT_PUBLIC_API_URL = http://host.docker.internal:8000
NEXT_PUBLIC_AUTH_URL = https://auth.yourdomain.com
NEXT_PUBLIC_AUTH_API_KEY = your_auth_api_key
ENVIRONMENT = production
Email Configuration
Bilanc uses Resend for sending emails:
Variable Description Example RESEND_API_KEYAPI key for Resend re_...DEFAULT_SENDER_EMAILFrom address for system emails notifications@yourdomain.com
# Email Configuration
RESEND_API_KEY = re_1234567890abcdef
DEFAULT_SENDER_EMAIL = notifications@yourdomain.com
Internal Settings
These are typically left at their default values:
Variable Description Default DBT_PREFIXPrefix for dbt models martsCELERY_BROKER_URLRedis URL for Celery redis://broker:6379/0
# Internal Settings
DBT_PREFIX = marts
CELERY_BROKER_URL = redis://broker:6379/0
Complete .env Example
# ─── Database Configuration ───────────────────────────────────────────────
POSTGRES_HOST = db
POSTGRES_PORT = 5432
POSTGRES_DATABASE = bilanc
POSTGRES_USERNAME = bilanc
POSTGRES_PASSWORD = secure_password
RAW_DATA_SCHEMA = bilanc
# ─── AI Configuration ─────────────────────────────────────────────────────
AI_PROVIDER = openai
AI_MODEL = gpt-4o
OPENAI_API_KEY = sk-...
# ─── Integration Tokens ───────────────────────────────────────────────────
GITHUB_ACCESS_TOKEN = ghp_abcdef1234567890
GITHUB_REPOSITORY = bilanc/frontend bilanc/backend
LINEAR_ACCESS_TOKEN = lin_api_xxxxx
CURSOR_API_KEY = cursor_xxxxx
# ─── Application Settings ─────────────────────────────────────────────────
FRONTEND_URL = https://dashboard.yourdomain.com
NEXT_PUBLIC_API_URL = http://host.docker.internal:8000
NEXT_PUBLIC_AUTH_URL = https://auth.yourdomain.com
NEXT_PUBLIC_AUTH_API_KEY = your_auth_api_key
ENVIRONMENT = production
# ─── Email Configuration ──────────────────────────────────────────────────
RESEND_API_KEY = re_1234567890abcdef
DEFAULT_SENDER_EMAIL = notifications@yourdomain.com
# ─── Internal Settings ────────────────────────────────────────────────────
DBT_PREFIX = marts
CELERY_BROKER_URL = redis://broker:6379/0
Target Configuration
The target_config.yaml file configures database connections for data transformation:
postgres :
postgres_db :
username : !ENV ${POSTGRES_USERNAME}
password : !ENV ${POSTGRES_PASSWORD}
hostname : !ENV ${POSTGRES_HOST}
db_name : !ENV ${POSTGRES_DATABASE}
schema : !ENV ${RAW_DATA_SCHEMA}
port : !ENV ${POSTGRES_PORT}
This configuration uses environment variables from your .env file for consistency.
Tenant Configuration
The tenant_config.yaml file defines your organization and data source connections (called “taps”).
Basic Structure
tenants :
- name : Your Organization Name
domain : yourdomain.com
is_auto_onboarding_enabled : true
taps :
# Data source configurations go here
Field Description nameYour organization’s display name domainYour organization’s email domain (used for auto-onboarding) is_auto_onboarding_enabledAutomatically onboard users with matching email domain tapsList of data source integrations
Tap Configuration
Each tap represents a data source integration:
taps :
- name : github
type : tap-github
config :
start_date : 2025-01-01
repository : !ENV ${GITHUB_REPOSITORY}
- name : linear
type : tap-linear
config :
start_date : 2025-01-01
- name : cursor
type : tap-cursor
config :
start_date : 2025-01-01
Field Description nameIdentifier for this tap instance typeTap type: tap-github, tap-linear, or tap-cursor config.start_dateDate to start collecting data from (YYYY-MM-DD) config.repository(GitHub only) Repository list from environment variable
Complete Tenant Configuration Example
tenants :
- name : Acme Corporation
domain : acme.com
is_auto_onboarding_enabled : true
taps :
- name : github
type : tap-github
config :
start_date : 2025-01-01
repository : !ENV ${GITHUB_REPOSITORY}
- name : linear
type : tap-linear
config :
start_date : 2025-01-01
- name : cursor
type : tap-cursor
config :
start_date : 2025-01-01
The start_date determines how far back Bilanc will fetch historical data. Setting an earlier date will result in more data but longer initial sync times.
Next Steps
Integrations Detailed setup for each integration
Commands Run and manage your Bilanc instance