Skip to main content

Configuration Guide

This guide covers all available configuration options for Chirp, from basic settings to advanced customization.

Environment Variables

Chirp uses environment variables for configuration. Create a .env file in the server/ directory based on .env.example, or edit docker-compose file for Docker install.

Core Settings

# Application Environment
NODE_ENV=development # development|production
PORT=3001 # Server port
BASE_URL=http://localhost:3001 # Base URL for the application

Database Configuration

PostgreSQL

# PostgreSQL Database
DB_HOST=localhost # Database host
DB_PORT=5432 # Database port
DB_USER=chirp_user # Database username
DB_PASSWORD=secure_password # Database password
DB_NAME=chirp_prod # Database name
DB_SSL=false # Enable SSL connection
DB_POOL_MIN=2 # Minimum connection pool size
DB_POOL_MAX=10 # Maximum connection pool size

Security Settings

# JWT Configuration
JWT_SECRET=your_super_secure_jwt_secret_minimum_64_characters_long
JWT_EXPIRES_IN=7d # Token expiration time

# Admin API
ADMIN_KEY=your_secure_admin_key_here

# Password Security
BCRYPT_ROUNDS=12 # Password hashing rounds (10-14)

Redis Configuration (Optional)

# Redis Cache
REDIS_HOST=localhost # Redis host
REDIS_PORT=6379 # Redis port
REDIS_PASSWORD=redis_password # Redis password
REDIS_DB=0 # Redis database number
REDIS_PREFIX=chirp: # Redis key prefix

Email Configuration

# Email Settings
EMAIL_HOST=smtp.gmail.com # SMTP server host
EMAIL_PORT=587 # SMTP server port
EMAIL_SECURE=false # Use SSL/TLS
EMAIL_USER=your-email@gmail.com # SMTP username
EMAIL_PASSWORD=app_password # SMTP password
EMAIL_FROM=Chirp <noreply@your-domain.com> # From address
EMAIL_QUEUE=true # Enable email queue

Email Providers

Gmail:

EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_SECURE=false

Outlook/Office 365:

EMAIL_HOST=smtp-mail.outlook.com
EMAIL_PORT=587
EMAIL_SECURE=false

SendGrid:

EMAIL_HOST=smtp.sendgrid.net
EMAIL_PORT=587
EMAIL_SECURE=false

Mailgun:

EMAIL_HOST=smtp.mailgun.org
EMAIL_PORT=587
EMAIL_SECURE=false

File Upload Settings (To Be Implemented)

# Upload Configuration
MAX_FILE_SIZE=104857600 # Max file size (100MB)
ALLOWED_FILE_TYPES=jpg,jpeg,png,gif,webp,pdf,doc,docx,txt,mp3,mp4,zip

External API Configuration

# Tenor API (GIF search)
TENOR_API_KEY=your_tenor_api_key_here

Feature Flags (To Be Implemented)

# Feature Toggles
ENABLE_REGISTRATION=true # Allow user registration
ENABLE_EMAIL_VERIFICATION=true # Require email verification

Need help? Check our troubleshooting guide.