Skip to Content
Genfeed Core (OSS)Configuration

Configuration

Environment variables and settings for Genfeed Core. Create a canonical root .env.local file in your project root:

cp .env.example .env.local bun run env:sync local

Never commit secrets. Add .env.local to your .gitignore. Never commit API keys, tokens, or credentials to version control.

The root env files are the source of truth. bun run env:sync local|staging|production generates the app and service .env* files used by local frontend and backend runtimes.

For EC2 deploys, prefer AWS Systems Manager Parameter Store over a persistent .env.production on disk. The deploy scripts can hydrate .env.staging or .env.production from SSM at deploy time, then render the service env files automatically.


Database

VariableRequiredDefaultDescription
DATABASE_URLYesPostgreSQL connection string (e.g. postgresql://genfeed:genfeed_local@localhost:5432/genfeed)
REDIS_URLYesRedis connection string for BullMQ job queues and caching (e.g. redis://localhost:6379)

Authentication

VariableRequiredDefaultDescription
JWT_SECRETYesSecret key for signing JWT tokens. Use a long random string.
CLERK_SECRET_KEYAuthClerk backend secret key for deployments using Clerk auth
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEYAuthClerk publishable key exposed to the Next.js frontend

AI Providers

Add keys for the providers you want to use. At least one is required for content generation.

VariableRequiredDescription
OPENAI_API_KEYNoOpenAI API key for GPT models and DALL-E image generation
ANTHROPIC_API_KEYNoAnthropic API key for Claude models
GOOGLE_API_KEYNoGoogle API key for Gemini models
REPLICATE_KEYNoReplicate API token for server-side image and video models (Flux, SDXL, Kling, etc.)
FAL_API_KEYNofal.ai API key for server-side image and video inference
ELEVENLABS_API_KEYNoElevenLabs API key for voice synthesis and text-to-speech

For the model registry and discovery contract, see Provider Registry.


Managed Cloud Execution

Self-hosted Core can use local/server provider keys or organization BYOK keys without a Genfeed Cloud account. Managed Cloud execution is separate: it requires an explicit Genfeed Cloud API key and only supported generation calls should cross that boundary.

VariableRequiredDescription
GENFEED_API_KEYManaged execution onlyGenfeed Cloud API key used by the self-hosted backend to call managed Cloud services. Do not expose this to browser code.
GENFEED_MANAGED_INFERENCE_URLNoOverride for the managed inference API base URL. Defaults to the Genfeed Cloud endpoint when omitted.

For the full runtime contract, see Execution Boundaries.


Storage

By default, generated assets are stored locally. For production, configure S3-compatible storage.

VariableRequiredDefaultDescription
AWS_ACCESS_KEY_IDNoAWS access key for S3 storage
AWS_SECRET_ACCESS_KEYNoAWS secret key for S3 storage
S3_BUCKETNoS3 bucket name for storing generated assets
S3_REGIONNous-east-1AWS region for your S3 bucket

Discord Notifications

Discord is optional in Core. Configure it only when the notifications service should publish to your own Discord server.

VariableRequiredDefaultDescription
DISCORD_BOT_TOKENYesBot token for the Discord application installed in your server
DISCORD_CLIENT_IDYesDiscord application client ID
DISCORD_GUILD_IDYesDiscord server ID where the bot manages notification webhooks
DISCORD_CHANNEL_ID_POSTSNoChannel ID for published post/article notifications
DISCORD_CHANNEL_ID_STUDIONoChannel ID for studio/ingredient notifications
DISCORD_CHANNEL_ID_USERSNoChannel ID for user/account notifications
DISCORD_CHANNEL_ID_MODELSNoChannel ID for model discovery notifications; falls back to the studio channel
DISCORD_BOT_AVATAR_URLNoOptional avatar URL for Discord webhook messages
DISCORD_WEBHOOK_NAME_PREFIXNoOptional prefix for bot-managed webhook names, such as a workspace name
DISCORD_WEBHOOK_REASONNoOptional audit-log reason used when the bot creates Discord webhooks

The integration does not require a Genfeed-managed Discord server. Channel IDs, webhook naming, avatar branding, and webhook audit reasons are self-hosted configuration.


Payments (Cloud only)

VariableRequiredDefaultDescription
STRIPE_SECRET_KEYCloud onlyStripe secret key for subscription billing
STRIPE_WEBHOOK_SECRETCloud onlyStripe webhook signing secret for payment event verification

URLs

VariableRequiredDefaultDescription
APP_URLNohttp://localhost:3000Frontend application URL
API_URLNohttp://localhost:3010Backend API URL
MARKETPLACE_API_URLNoMarketplace API endpoint (cloud only, for marketplace.genfeed.ai integration)

Application

VariableRequiredDefaultDescription
NODE_ENVNodevelopmentEnvironment mode (development, production, test)
PORTNo3010API server port

EC2 With AWS SSM Parameter Store

For staging and production on EC2, store secrets as individual parameters under a flat path:

/genfeed/staging/OPENAI_API_KEY /genfeed/staging/API_SENTRY_DSN /genfeed/production/OPENAI_API_KEY /genfeed/production/API_SENTRY_DSN

Recommended setup:

  • Attach an IAM role to the EC2 instance with ssm:GetParametersByPath, ssm:GetParameters, and kms:Decrypt if you use a customer-managed KMS key.
  • Keep the path prefix flat so the parameter leaf name matches the canonical env key.
  • Optionally set SSM_PARAMETER_PATH_PREFIX in GitHub Actions repo variables if you want a prefix other than /genfeed.

At deploy time, the EC2 host runs:

./docker/render-ssm-env.sh staging ./docker/render-ssm-env.sh production

That script fetches SSM values into the root env file for the target environment and then renders service env files used by Docker Compose.


Database Setup

PostgreSQL

# macOS brew install postgresql@17 brew services start postgresql@17 # Docker docker run -d -p 5432:5432 \ -e POSTGRES_DB=genfeed \ -e POSTGRES_USER=genfeed \ -e POSTGRES_PASSWORD=genfeed_local \ postgres:17-alpine

Redis

# macOS brew install redis brew services start redis # Docker docker run -d -p 6379:6379 redis:7

Next Steps