Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Configuration

This guide covers all environment variables and configuration options for the AREA application.

Environment Variables

The application is configured through environment variables. Create a .env file in the server/ directory with the following variables:


Database Configuration

DATABASE_URL

Description: PostgreSQL database connection string

Required: No

Default: postgresql://area_user:area_password@localhost:5432/area_db

Format: postgresql://[user]:[password]@[host]:[port]/[database]

Example:

DATABASE_URL=postgresql://myuser:mypassword@localhost:5432/area_db

Authentication & Security

JWT_SECRET_KEY

Description: Secret key for signing JWT tokens. Also used for Flask session management.

Required: Yes

Default: None

Security Note: Use a strong, random string. Never commit this to version control.

Example:

JWT_SECRET_KEY=your-super-secret-key-here-change-this-in-production

Generate a secure key:

openssl rand -hex 32

CORS Configuration

CORS_ORIGINS

Description: Comma-separated list of allowed origins for CORS requests

Required: No

Default: * (allows all origins)

Example:

# Allow all origins (development only)
CORS_ORIGINS=*

# Allow specific origins (production)
CORS_ORIGINS=http://localhost:3000,https://myapp.com

Google OAuth2 Configuration

These credentials are required for Google OAuth login and Gmail integration.

GOOGLE_CLIENT_ID

Description: OAuth 2.0 Client ID from Google Cloud Console

Required: Yes (for OAuth features)

Default: None

Example:

GOOGLE_CLIENT_ID=123456789-abcdefghijklmnop.apps.googleusercontent.com

GOOGLE_CLIENT_SECRET

Description: OAuth 2.0 Client Secret from Google Cloud Console

Required: Yes (for OAuth features)

Default: None

Example:

GOOGLE_CLIENT_SECRET=GOCSPX-abcdefghijklmnopqrstuvwxyz

Setting up Google OAuth:

  1. Go to Google Cloud Console
  2. Create a new project or select an existing one
  3. Enable the following APIs:
    • Google+ API (for OAuth login)
    • Gmail API (for email monitoring)
  4. Go to “Credentials” → “Create Credentials” → “OAuth 2.0 Client ID”
  5. Configure the OAuth consent screen
  6. Add authorized redirect URIs:
    • http://localhost:8080/api/auth/google/callback (for login)
    • http://localhost:8080/api/connections/gmail/callback (for Gmail)
  7. Copy the Client ID and Client Secret to your .env file

SMTP Email Configuration

Configure SMTP settings to enable the application to send emails (for the send_email reaction).

SMTP_HOST

Description: SMTP server hostname

Required: No

Default: smtp.gmail.com

Example:

SMTP_HOST=smtp.gmail.com

SMTP_PORT

Description: SMTP server port

Required: No

Default: 587

Common ports:

  • 587 - TLS (recommended)
  • 465 - SSL
  • 25 - Unencrypted (not recommended)

Example:

SMTP_PORT=587

SMTP_USERNAME

Description: SMTP authentication username (usually your email address)

Required: Yes (for email sending)

Default: None

Example:

SMTP_USERNAME=your-email@gmail.com

SMTP_PASSWORD

Description: SMTP authentication password

Required: Yes (for email sending)

Default: None

Security Note: For Gmail, use an App Password instead of your regular password.

Example:

SMTP_PASSWORD=your-app-password-here

SMTP_FROM_EMAIL

Description: Email address to use in the “From” field

Required: No

Default: Same as SMTP_USERNAME

Example:

SMTP_FROM_EMAIL=noreply@myapp.com

SMTP_USE_TLS

Description: Whether to use TLS encryption

Required: No

Default: true

Values: true or false

Example:

SMTP_USE_TLS=true

Gmail SMTP Setup:

  1. Enable 2-Factor Authentication on your Google account
  2. Go to App Passwords
  3. Generate a new app password for “Mail”
  4. Use this app password as SMTP_PASSWORD

Scheduler Configuration

The scheduler automatically checks and executes workflows at regular intervals.

SCHEDULER_ENABLED

Description: Enable or disable the background scheduler

Required: No

Default: true

Values: true or false

Example:

SCHEDULER_ENABLED=true

SCHEDULER_CHECK_INTERVAL_MINUTES

Description: How often (in minutes) the scheduler checks for workflows to execute

Required: No

Default: 1

Recommended: 1 for testing, 5 or more for production

Example:

SCHEDULER_CHECK_INTERVAL_MINUTES=1

SCHEDULER_TIMEZONE

Description: Timezone for the scheduler (affects time-based triggers)

Required: No

Default: Europe/Paris

Format: IANA timezone

Example:

# Paris time
SCHEDULER_TIMEZONE=Europe/Paris

# New York time
SCHEDULER_TIMEZONE=America/New_York

Flask Configuration

FLASK_APP

Description: Entry point for Flask application

Required: No (for development)

Default: app.py

Example:

FLASK_APP=app.py

FLASK_ENV

Description: Flask environment mode

Required: No

Default: development

Values:

  • development - Debug mode enabled, auto-reload on code changes
  • production - Debug mode disabled, optimized for performance

Example:

FLASK_ENV=development

Complete Example .env File

Here’s a complete example with all variables:

# Database Configuration
POSTGRES_DB=area_db
POSTGRES_USER=area_user
POSTGRES_PASSWORD=change_me

# Application Configuration
DATABASE_URL=postgresql://area_user:change_me@database:5432/area_db

# JWT Configuration (generate with: openssl rand -hex 32)
JWT_SECRET_KEY=change_me

# Flask Configuration
FLASK_APP=app.py
FLASK_ENV=development

# CORS Configuration
CORS_ORIGINS=*

# Google OAuth2 Configuration (get from Google Cloud Console)
GOOGLE_CLIENT_ID=your-client-id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your-client-secret

# Meta OAuth2 Configuration (get from Facebook Developer Console)
FACEBOOK_CLIENT_ID=your-facebook-app-id
FACEBOOK_CLIENT_SECRET=your-facebook-app-secret

# GitHub OAuth2 Configuration (get from GitHub Developer Settings)
GITHUB_CLIENT_ID=your-github-client-id
GITHUB_CLIENT_SECRET=your-github-client-secret

# Spotify OAuth2 Configuration (get from Spotify Developer Dashboard)
SPOTIFY_CLIENT_ID=your-spotify-client-id
SPOTIFY_CLIENT_SECRET=your-spotify-client-secret

# SMTP Email Configuration
SMTP_HOST=smtp-mail.outlook.com
SMTP_PORT=587
SMTP_USERNAME=your-email@outlook.com
SMTP_PASSWORD=generated-app-password # w/ google you can generate one after 2fa
SMTP_FROM_EMAIL=your-email@outlook.com
SMTP_USE_TLS=true

# Scheduler Configuration
SCHEDULER_ENABLED=true
SCHEDULER_CHECK_INTERVAL_MINUTES=1
SCHEDULER_TIMEZONE=Europe/Paris

Docker Environment

When using Docker Compose, environment variables are automatically loaded from the .env file in the project root. Make sure to create this file before running:

docker-compose up --build