Documentation Index
Fetch the complete documentation index at: https://mintlify.com/MatthewSabia1/Joip-Web-App-2/llms.txt
Use this file to discover all available pages before exploring further.
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
PostgreSQL connection string in standard format.Format: Neon Example:
postgresql://username:password@host:port/databaseExample:Session Security
Secret key for signing session cookies. Must be cryptographically secure.Recommended: 32+ random charactersExample:Generate secure secret:
Supabase Storage
Your Supabase project URL.Format: Find this in your Supabase project settings under “API”.
https://[project-id].supabase.coExample:Supabase anonymous (public) API key for client-side operations.Example:Find this in Supabase project settings under “API” → “Project API keys”.
Supabase service role key for server-side storage operations.Example:
Reddit API Integration
Reddit application client ID for content fetching.Example:Obtain from: https://www.reddit.com/prefs/apps
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: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
Your Replit project ID (automatically populated by Replit).Example:Required for Replit OIDC authentication in production.
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: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
OpenAI API key (alternative to OpenRouter).Example:Falls back to this provider if OpenRouter fails.
AI Undress (Image Editing)
xAI API key (primary provider for AI Undress feature).Example:Model used:
grok-imagine-image-pro (via /v1/images/edits)Freepik API key (fallback provider for AI Undress).Example:Model used: Seedream 4.5 Edit
Primary AI Undress provider selection.Options: Defaults to
xai | freepikExample:xai if not specified.Optional xAI model override for AI Undress.Example:
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
Imgchest API key for importing existing JOIP galleries.Example:Required for “Import JOIP from Imgchest” feature.
Payment Providers
PayGate (Credit Cards)
PayGate merchant wallet address for credit card payments.Example:
PayGate callback URL for payment notifications.Example (local dev with ngrok):Production: Auto-detected from
REPLIT_DOMAINSTelegram Stars
Secret for verifying Telegram webhook signatures.Example:
Telegram bot username (without @).Example:
Telegram channel ID for membership features.Example:
Thirdweb (Crypto Checkout)
Thirdweb client ID for crypto checkout.Example:
Secret for verifying Thirdweb webhook signatures.Example:
EVM wallet address for receiving Thirdweb payments.Format: Must be valid EVM address (0x…)Example:
Payblis
Payblis merchant key.Example:
Payblis secret key for API authentication.Example:
Enable Payblis sandbox mode.Values: Defaults to
true | falseExample:true in development, false in production.Application Settings
Node.js environment mode.Options: Behavior:
development | productionExample:development: Enables detailed error messages, Vite HMRproduction: Optimized builds, minimal logging
Server listening port.Example:
Always use port 5000 on Replit. Changing this may break deployment.
Optional override for internal localhost callbacks/proxy calls.Example:Defaults to
PORT when omitted.Local directory for file uploads (legacy).Example:
All uploads now use Supabase Storage. This setting is mostly unused.
Explicit host URL override.Example:Auto-detected from
REPLIT_DOMAINS in production.Database Connection Tuning
Optional settings for optimizing PostgreSQL connection pooling:Maximum number of database connections in pool.Example:
Minimum number of database connections in pool.Example:
Idle timeout in milliseconds before closing connection.Example:
Connection timeout in seconds.Example:
Maximum connection lifetime in seconds.Example:
Statement timeout in milliseconds.Example:
Query timeout in milliseconds.Example:
Logging Configuration
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