Overview
JOIP Web Application requires various environment variables for database connections, API integrations, authentication, and feature configuration. This page provides a comprehensive reference for all supported variables.On Replit, configure all environment variables in the Secrets tab (Tools → Secrets). Never commit secrets to version control.
Required Variables
These variables are essential for the application to function:Database Configuration
string
required
PostgreSQL connection string in standard format.Format: Neon Example:
postgresql://username:password@host:port/databaseExample:Session Security
string
required
Secret key for signing session cookies. Must be cryptographically secure.Recommended: 32+ random charactersExample:Generate secure secret:
Supabase Storage
string
required
Your Supabase project URL.Format: Find this in your Supabase project settings under “API”.
https://[project-id].supabase.coExample:string
required
Supabase anonymous (public) API key for client-side operations.Example:Find this in Supabase project settings under “API” → “Project API keys”.
string
required
Supabase service role key for server-side storage operations.Example:
Reddit API Integration
string
required
Reddit application client ID for content fetching.Example:Obtain from: https://www.reddit.com/prefs/apps
string
required
Reddit application client secret.Example:
Create a “script” type application on Reddit for server-side API access.
Replit OIDC Authentication
Required for production deployment on Replit:string
Comma-separated list of domains where your Repl is accessible.Example (single domain):Example (multiple domains):Behavior:
- Application prioritizes
app.joip.ioif present - Falls back to first domain in list
- Used for OAuth callback URL generation
- Enables Replit OIDC authentication when set
string
Your Replit project ID (automatically populated by Replit).Example:Required for Replit OIDC authentication in production.
string
Replit OIDC issuer URL (standard value).Value:
This value is consistent across all Replit deployments.
AI Providers
Caption Generation
At least one AI provider is required for caption generation:string
OpenRouter API key for AI caption generation (primary provider).Example:Models used:
- Manual Editor:
google/gemini-2.5-pro(contextual captions) - Fallback:
google/gemini-2.5-flash-lite - Smart Captions:
gemini-2.5-flash-lite
string
OpenAI API key (alternative to OpenRouter).Example:Falls back to this provider if OpenRouter fails.
AI Undress (Image Editing)
string
xAI API key (primary provider for AI Undress feature).Example:Model used:
grok-imagine-image-pro (via /v1/images/edits)string
Freepik API key (fallback provider for AI Undress).Example:Model used: Seedream 4.5 Edit
enum
default:"xai"
Primary AI Undress provider selection.Options: Defaults to
xai | freepikExample:xai if not specified.string
default:"grok-imagine-image-pro"
Optional xAI model override for AI Undress.Example:
string
Replicate API token (dormant/legacy backend for AI Undress).Example:
This credential is currently not used in active AI Undress flows.
Optional Features
Imgchest Import
string
Imgchest API key for importing existing JOIP galleries.Example:Required for “Import JOIP from Imgchest” feature.
Payment Providers
PayGate (Credit Cards)
string
PayGate merchant wallet address for credit card payments.Example:
string
PayGate callback URL for payment notifications.Example (local dev with ngrok):Production: Auto-detected from
REPLIT_DOMAINSTelegram Stars
string
string
Secret for verifying Telegram webhook signatures.Example:
string
default:"OfficialJoipBot"
Telegram bot username (without @).Example:
string
Telegram channel ID for membership features.Example:
Thirdweb (Crypto Checkout)
string
Thirdweb client ID for crypto checkout.Example:
string
Secret for verifying Thirdweb webhook signatures.Example:
string
EVM wallet address for receiving Thirdweb payments.Format: Must be valid EVM address (0x…)Example:
Payblis
string
Payblis merchant key.Example:
string
Payblis secret key for API authentication.Example:
boolean
default:"auto"
Enable Payblis sandbox mode.Values: Defaults to
true | falseExample:true in development, false in production.Application Settings
enum
default:"development"
Node.js environment mode.Options: Behavior:
development | productionExample:development: Enables detailed error messages, Vite HMRproduction: Optimized builds, minimal logging
number
default:"5000"
Server listening port.Example:
Always use port 5000 on Replit. Changing this may break deployment.
number
Optional override for internal localhost callbacks/proxy calls.Example:Defaults to
PORT when omitted.string
default:"./uploads"
Local directory for file uploads (legacy).Example:
All uploads now use Supabase Storage. This setting is mostly unused.
string
Explicit host URL override.Example:Auto-detected from
REPLIT_DOMAINS in production.Database Connection Tuning
Optional settings for optimizing PostgreSQL connection pooling:number
default:"20"
Maximum number of database connections in pool.Example:
number
default:"2"
Minimum number of database connections in pool.Example:
number
default:"10000"
Idle timeout in milliseconds before closing connection.Example:
number
default:"10"
Connection timeout in seconds.Example:
number
default:"3600"
Maximum connection lifetime in seconds.Example:
number
default:"30000"
Statement timeout in milliseconds.Example:
number
default:"20000"
Query timeout in milliseconds.Example:
Logging Configuration
enum
default:"info"
Application logging level.Options: Levels:
error | warn | info | debugExample:error: Only critical errorswarn: Errors and warningsinfo: Normal operation info (recommended for production)debug: Detailed debugging information
Environment Validation
The application validates all environment variables on startup (server/environmentConfig.ts:89):
- Errors: Application may fail to start or have limited functionality
- Warnings: Application starts but some features are disabled
Configuration Examples
Security Best Practices
Secret Generation
Generate cryptographically secure secrets:Environment Files
Never track environment files in Git:Troubleshooting
Missing Required Variables
Symptom: Application fails to start with validation errors Solution:- Check startup logs for specific missing variables
- Add all required variables to Replit Secrets
- Restart the application
Invalid Variable Format
Symptom: “Invalid format” warnings on startup Solution:- Verify variable format matches documentation
- Check for extra spaces or quotes
- Validate URLs include protocol (
https://)
Features Not Working
Symptom: Specific features disabled or failing Solution:- Check for related warnings in startup logs
- Verify optional variables are set correctly
- Test connectivity to external services
Next Steps
Deploy on Replit
Complete Replit deployment guide
Database Setup
Configure PostgreSQL and Neon
Storage Configuration
Setup Supabase Storage