Skip to main content

Configuration

Environment variables and configuration options for self-hosted ArchiCore.

Environment Variables

Required

VariableDescriptionExample
DATABASE_URLPostgreSQL connection stringpostgresql://user:pass@host:5432/db
JWT_SECRETSecret for JWT tokens (min 32 chars)your-very-secure-secret-key
JINA_API_KEYJina AI API key for embeddingsjina_xxxx

AI Providers

VariableDescription
ANTHROPIC_API_KEYAnthropic Claude API key
OPENAI_API_KEYOpenAI API key
DEEPSEEK_API_KEYDeepSeek API key
LLM_PROVIDERWhich LLM to use: anthropic, openai, deepseek
LLM_MODELModel name (e.g., claude-sonnet-4-20250514)

Services

VariableDefaultDescription
REDIS_URL-Redis connection URL
QDRANT_URLhttp://localhost:6333Qdrant vector DB URL
PORT3000HTTP server port
HOST0.0.0.0HTTP server host

GitHub Integration

VariableDescription
GITHUB_CLIENT_IDGitHub OAuth App client ID
GITHUB_CLIENT_SECRETGitHub OAuth App client secret
GITHUB_WEBHOOK_SECRETSecret for webhook verification

Security

VariableDefaultDescription
HELMET_ENABLEDfalseEnable Helmet security headers
CORS_RESTRICTfalseRestrict CORS to whitelist
CORS_ORIGINS*Comma-separated allowed origins
RATE_LIMIT_WINDOW60000Rate limit window (ms)
RATE_LIMIT_MAX100Max requests per window

Admin

VariableDescription
ADMIN_SECRETSecret key for admin API access
ADMIN_EMAILDefault admin email
ADMIN_PASSWORDDefault admin password

Example .env File

# Database
DATABASE_URL=postgresql://archicore:secure_password@localhost:5432/archicore

# Security
JWT_SECRET=your-very-secure-secret-key-at-least-32-characters-long
ADMIN_SECRET=admin-api-secret-key

# AI Services
JINA_API_KEY=jina_xxxxxxxxxxxxxxxxxxxx
ANTHROPIC_API_KEY=sk-ant-xxxxxxxxxxxxxxxxxxxxx
LLM_PROVIDER=anthropic
LLM_MODEL=claude-sonnet-4-20250514

# Optional Services
REDIS_URL=redis://localhost:6379
QDRANT_URL=http://localhost:6333

# GitHub (optional)
GITHUB_CLIENT_ID=Iv1.xxxxxxxxxxxx
GITHUB_CLIENT_SECRET=xxxxxxxxxxxxxxxxxxxx
GITHUB_WEBHOOK_SECRET=webhook-secret

# Server
PORT=3000
NODE_ENV=production

# Security (production)
HELMET_ENABLED=true
CORS_RESTRICT=true
CORS_ORIGINS=https://archicore.yourdomain.com

Configuration Files

Server Configuration

Create config/production.json:

{
"server": {
"port": 3000,
"host": "0.0.0.0",
"trustProxy": true
},
"limits": {
"maxFileSize": 104857600,
"maxProjectSize": 524288000,
"maxFilesPerProject": 10000
},
"indexing": {
"batchSize": 100,
"concurrency": 4,
"timeout": 300000
},
"cache": {
"ttl": 3600,
"maxSize": 1000
}
}

Tier Configuration

Customize tier limits:

{
"tiers": {
"free": {
"projects": 3,
"requestsPerDay": 100,
"maxFileSize": 1048576
},
"pro": {
"projects": 25,
"requestsPerDay": 10000,
"maxFileSize": 10485760
},
"enterprise": {
"projects": -1,
"requestsPerDay": -1,
"maxFileSize": 104857600
}
}
}

Logging

VariableDefaultDescription
LOG_LEVELinfoLog level: debug, info, warn, error
LOG_FORMATjsonLog format: json, pretty
LOG_FILE-Path to log file

Health Checks

ArchiCore exposes health endpoints:

# Basic health
curl http://localhost:3000/health

# Detailed health (with dependencies)
curl http://localhost:3000/health/detailed

Response:

{
"status": "ok",
"version": "0.1.0",
"uptime": 3600,
"dependencies": {
"database": "ok",
"redis": "ok",
"qdrant": "ok"
}
}