Environment Setup
Y3NKO requires several environment variables to function. Create a .env.local file in the project root.
Required Variables
.env.local
# Database (Supabase PostgreSQL)
DATABASE_URL="postgresql://postgres.[project-ref]:[password]@aws-0-[region].pooler.supabase.com:6543/postgres?pgbouncer=true"
DIRECT_URL="postgresql://postgres.[project-ref]:[password]@aws-0-[region].pooler.supabase.com:5432/postgres"
# Supabase
NEXT_PUBLIC_SUPABASE_URL="https://[project-ref].supabase.co"
NEXT_PUBLIC_SUPABASE_ANON_KEY="eyJ..."
SUPABASE_SERVICE_ROLE_KEY="eyJ..."
# Application
NEXT_PUBLIC_APP_URL="http://localhost:3000"
# Paystack (Payments)
PAYSTACK_SECRET_KEY="sk_test_..."
PAYSTACK_PUBLIC_KEY="pk_test_..."
PAYSTACK_WEBHOOK_SECRET="whsec_..."
# Cloudinary (Images)
CLOUDINARY_CLOUD_NAME="your-cloud-name"
CLOUDINARY_API_KEY="123456789012345"
CLOUDINARY_API_SECRET="abcdefghij..."
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME="your-cloud-name"
NEXT_PUBLIC_CLOUDINARY_UPLOAD_PRESET="y3nko-uploads"
# Resend (Emails)
RESEND_API_KEY="re_..."Variable Reference
Database
| Variable | Description | Example |
|---|---|---|
DATABASE_URL | Pooled connection string (for Prisma) | postgresql://...?pgbouncer=true |
DIRECT_URL | Direct connection string (for migrations) | postgresql://... |
⚠️
For Supabase, always use the pooler connection (port 6543) for DATABASE_URL and the direct connection (port 5432) for DIRECT_URL.
Supabase
| Variable | Description | Where to Find |
|---|---|---|
NEXT_PUBLIC_SUPABASE_URL | Project URL | Settings > API |
NEXT_PUBLIC_SUPABASE_ANON_KEY | Public anon key | Settings > API |
SUPABASE_SERVICE_ROLE_KEY | Service role key (server only) | Settings > API |
Paystack
| Variable | Description |
|---|---|
PAYSTACK_SECRET_KEY | Server-side API key (starts with sk_) |
PAYSTACK_PUBLIC_KEY | Client-side key (starts with pk_) |
PAYSTACK_WEBHOOK_SECRET | For verifying webhook signatures |
Use test keys (prefixed with sk_test_ and pk_test_) for development. Switch to live keys for production.
Cloudinary
| Variable | Description |
|---|---|
CLOUDINARY_CLOUD_NAME | Your cloud name |
CLOUDINARY_API_KEY | API key for server-side uploads |
CLOUDINARY_API_SECRET | API secret (never expose to client) |
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME | Cloud name for client-side |
NEXT_PUBLIC_CLOUDINARY_UPLOAD_PRESET | Unsigned upload preset name |
Resend
| Variable | Description |
|---|---|
RESEND_API_KEY | API key for sending emails |
Google OAuth (Optional)
If using Google OAuth for authentication:
GOOGLE_CLIENT_ID="123456789-xxx.apps.googleusercontent.com"
GOOGLE_CLIENT_SECRET="GOCSPX-..."Configure redirect URIs in Google Cloud Console:
- Development:
http://localhost:3000/api/auth/callback/google - Production:
https://y3nko.travel/api/auth/callback/google
Production vs Development
| Environment | Key Differences |
|---|---|
| Development | Test API keys, localhost URLs, verbose logging |
| Production | Live API keys, production URLs, error tracking |
Never commit .env.local to version control. It’s already in .gitignore.
Verifying Configuration
Run the development server to verify all variables are set:
npm run devCheck the console for any warnings about missing environment variables.