Overview
BR-ACC is configured using environment variables defined in a.env file. Copy .env.example to .env and customize the values for your deployment.
Required Configuration
These settings must be configured before running BR-ACC:Neo4j Database
Password for the Neo4j database. Must be changed from default in production.
.env
Neo4j connection URI. Use
bolt://neo4j:7687 when running in Docker Compose..env
Neo4j database name.
.env
JWT Authentication
Secret key for signing JWT tokens. Must be at least 32 characters in production.Generate a secure key:
.env
CORS Origins
Allowed origins for CORS requests. Comma-separated list.
.env
API Configuration
Server Settings
Host address for the API server.
.env
Port for the API server.
.env
Application environment. Options:
dev, staging, prod..env
Logging level. Options:
debug, info, warning, error, critical..env
Authentication Settings
Optional invite code required for user registration. Leave empty to allow open registration.
.env
Set to
true in production to send session cookies only over HTTPS..env
The API uses cookie-based authentication with JWT tokens. The cookie name is
bracc_session and has a TTL of 24 hours (configurable via jwt_expire_minutes in config.py:20).Neo4j Memory Settings
These settings are critical for performance with large datasets. The defaults are suitable for development but must be increased for production.
Initial JVM heap size for Neo4j.
.env
Maximum JVM heap size for Neo4j.
.env
Page cache size for Neo4j. This is the most important performance setting.
.env
Feature Flags
Product Tier
Product tier. Options:
community, professional, enterprise..env
Pattern Detection
Enable pattern detection features.
.env
Pattern detection is a premium feature that identifies suspicious relationships in procurement data. See the Pattern Detection endpoint for details.
Public Access Mode
Enable public access without authentication.
.env
Allow public access to person entity pages.
.env
Allow public access to entity lookup.
.env
Allow public access to investigations.
.env
Pattern Detection Tuning
These settings control pattern detection algorithms. Only relevant whenPATTERNS_ENABLED=true.
Threshold value for contract splitting detection.
.env
Minimum number of split contracts to trigger detection.
.env
Threshold for shared resource detection (0.0-1.0).
.env
Minimum organizations for Single Resource Provider pattern.
.env
Minimum recurrence for Inexigibilidade pattern.
.env
Maximum evidence references per pattern.
.env
Frontend Configuration
API URL for the frontend. Used during development only.
.env
Enable public mode in the frontend.
.env
Enable pattern detection UI in the frontend.
.env
In production, the frontend uses Caddy as a reverse proxy with relative paths. The
VITE_API_URL is only used during development.Optional: External Integrations
Google Cloud (BigQuery)
Path to Google Cloud service account JSON file. Required for Base dos Dados / TSE BigQuery integration.
.env
ETL Source Tokens
API key for World Bank data sources.
.env
Token for EU sanctions list API.
.env
Configuration in Code
All environment variables are loaded via Pydantic settings inapi/src/bracc/config.py:7-56. The configuration class provides type validation and defaults:
config.py
Environment-Specific Configuration
Development
.env
Production
.env
Next Steps
Docker Setup
Set up Docker Compose
Production Deployment
Deploy to production
Security
Security best practices
Data Sources
Explore available data sources