Skip to main content

Environment Variables

The backend manages all environment variables through config.py, supporting both default values and custom configurations.

Development Environment​

The development environment uses default values in config.py (localhost + sparknoteai123), requiring no additional configuration to connect to Docker infrastructure.

Production Environment​

Configured via docker/.env.production, injected into containers by docker-compose.

Environment Variable List​

VariableDescriptionRequired (Production)Default
POSTGRES_USERDatabase usernameNopostgres
POSTGRES_PASSWORDDatabase passwordYes-
POSTGRES_DBDatabase nameNosparknoteai
REDIS_PASSWORDRedis passwordYes-
NEO4J_PASSWORDNeo4j passwordYes-
SECRET_KEYJWT secret keyYes-
ENCRYPTION_KEYEncryption keyYes-
CORS_ORIGINSAllowed frontend originsYes-
ADMIN_USERNAMEAdmin usernameNoadmin
ADMIN_PASSWORDAdmin passwordYes-

Generating Keys​

# JWT secret key
openssl rand -hex 32

# Encryption key
openssl rand -base64 32

Configuration Template​

Copy docker/.env.example to docker/.env.production and edit:

cp docker/.env.example docker/.env.production