Skip to main content
Deltalytix requires several environment variables to be configured for proper operation. Copy .env.example to .env and configure the following variables:

Database Configuration

DATABASE_URL
string
required
PostgreSQL connection string with connection pooling enabled. Used by Prisma for database queries through PgBouncer.
DATABASE_URL="postgresql://username:password@host:port/database?pgbouncer=true&connection_limit=1"
Set connection_limit=1 when using PgBouncer to prevent connection pool exhaustion.
DIRECT_URL
string
required
Direct PostgreSQL connection string without pooling. Required for Prisma migrations and schema operations.
DIRECT_URL="postgresql://username:password@host:port/database"

Authentication

Supabase

NEXT_PUBLIC_SUPABASE_URL
string
required
Your Supabase project URL. Find this in your Supabase project settings under API.
NEXT_PUBLIC_SUPABASE_URL="https://your-project.supabase.co"
NEXT_PUBLIC_SUPABASE_ANON_KEY
string
required
Supabase anonymous/public API key. Safe to expose in client-side code.
NEXT_PUBLIC_SUPABASE_ANON_KEY="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

Discord OAuth

DISCORD_ID
string
required
Discord OAuth application client ID. Create an application at https://discord.com/developers/applications
DISCORD_ID="123456789012345678"
DISCORD_SECRET
string
required
Discord OAuth application client secret.
Keep this secret secure. Never commit to version control or expose in client-side code.
DISCORD_SECRET="your_discord_secret_here"
REDIRECT_URL
string
required
OAuth callback URL for Discord authentication. Must match the redirect URI configured in your Discord application.
REDIRECT_URL="http://localhost:3000/api/auth/callback"
For production, update to your production domain:
REDIRECT_URL="https://yourdomain.com/api/auth/callback"

Security

ENCRYPTION_KEY
string
required
Encryption key for sensitive data. Generate a secure random string (minimum 32 characters).
Use a cryptographically secure random string. Change this key will make existing encrypted data unreadable.
# Generate with: openssl rand -base64 32
ENCRYPTION_KEY="your_encryption_key_here"

Third-Party Services

OpenAI

OPENAI_API_KEY
string
required
OpenAI API key for AI-powered features (trade analysis, chat support, etc.).
OPENAI_API_KEY="sk-proj-..."

Stripe

NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY
string
required
Stripe publishable key. Safe to expose in client-side code.
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY="pk_test_..."
STRIPE_SECRET_KEY
string
required
Stripe secret key for server-side operations.
Keep this secret secure. Never expose in client-side code.
STRIPE_SECRET_KEY="sk_test_..."
STRIPE_WEBHOOK_SECRET
string
required
Stripe webhook signing secret for verifying webhook events. Obtain this when creating a webhook endpoint in your Stripe dashboard.
STRIPE_WEBHOOK_SECRET="whsec_..."
See Subscriptions Configuration for webhook setup instructions.

Email Service

RESEND_API_KEY
string
required
Resend API key for transactional emails (welcome emails, notifications, etc.).
RESEND_API_KEY="re_..."
SUPPORT_EMAIL
string
required
Email address displayed to users for support inquiries.
SUPPORT_EMAIL="[email protected]"
SUPPORT_TEAM_EMAIL
string
required
Internal email address where support requests are sent.
SUPPORT_TEAM_EMAIL="[email protected]"

GitHub

GITHUB_TOKEN
string
GitHub personal access token for repository access (used for feature voting and issue tracking).
GITHUB_TOKEN="ghp_..."

Public Configuration

NEXT_PUBLIC_DISCORD_INVITATION
string
Discord community invitation link displayed in the application.
NEXT_PUBLIC_DISCORD_INVITATION="https://discord.gg/your_invitation_link"
NEXT_PUBLIC_REPO_OWNER
string
GitHub repository owner/username for feature requests and bug reports.
NEXT_PUBLIC_REPO_OWNER="your_github_username"
NEXT_PUBLIC_REPO_NAME
string
GitHub repository name for feature requests and bug reports.
NEXT_PUBLIC_REPO_NAME="deltalytix"

Tutorial Videos

NEXT_PUBLIC_RITHMIC_PERFORMANCE_TUTORIAL_VIDEO
string
URL for Rithmic performance tutorial video.
NEXT_PUBLIC_RITHMIC_PERFORMANCE_TUTORIAL_VIDEO="https://youtube.com/..."
NEXT_PUBLIC_RITHMIC_ORDER_TUTORIAL_VIDEO
string
URL for Rithmic order tutorial video.
NEXT_PUBLIC_RITHMIC_ORDER_TUTORIAL_VIDEO="https://youtube.com/..."
NEXT_PUBLIC_NINJATRADER_PERFORMANCE_TUTORIAL_VIDEO
string
URL for NinjaTrader performance tutorial video.
NEXT_PUBLIC_NINJATRADER_PERFORMANCE_TUTORIAL_VIDEO="https://youtube.com/..."

Environment Setup

  1. Copy the example file:
    cp .env.example .env
    
  2. Configure required variables: Start with database, authentication, and security variables before running the application.
  3. Validate configuration:
    npm run dev
    
    The application will fail to start if required variables are missing.
Never commit .env files to version control. Add .env to your .gitignore file.

Next Steps

Build docs developers (and LLMs) love