Ryva uses environment variables to configure both the frontend (Next.js) and backend (Go API). This guide documents all available configuration options.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/egeuysall/ryva-archive/llms.txt
Use this file to discover all available pages before exploring further.
Environment Files
Ryva uses three environment files:apps/api/.env
Backend (Go API) configuration
apps/web/.env
Frontend (Next.js) configuration
.env
Docker Compose configuration (production only)
Backend Configuration (apps/api/.env)
Configuration for the Go API server.Application Settings
Environment mode for the application.Values:
development, production, stagingExample:Port number for the API server.Default:
8080Example:Database Configuration
PostgreSQL connection string with connection pooling parameters.Format:
postgresql://[user]:[password]@[host]:[port]/[database]?[params]Example:For Supabase, use the connection pooling URL for better performance.
Supabase Configuration
Your Supabase project URL.Example:
Supabase anonymous (public) key for client-side access.Example:
Supabase service role key for admin operations (bypasses RLS).Example:
JWT Configuration
Secret key for signing JWT tokens. Must be at least 32 characters.Example:
Generate a secure secret:
Token expiration duration.Format: Go duration string (
1h, 24h, 168h)Example:CORS Configuration
Comma-separated list of allowed origins for CORS.Example:
Email Configuration (Resend)
Resend API key for sending transactional emails.Example:
Resend audience ID for contact management.Example:
Email address to send from.Example:
Display name for sent emails.Example:
Sentry Configuration
Sentry Data Source Name for error tracking.Example:
Environment name for Sentry error grouping.Values:
development, staging, productionExample:Stripe Configuration
Stripe secret key for payment processing.Example:
Stripe webhook signing secret for verifying webhook events.Example:
Stripe price ID for personal plan.Example:
Stripe price ID for team plan.Example:
Redirect URL after successful payment.Example:
Redirect URL after cancelled payment.Example:
Email Template Configuration
Base URL for email template rendering and links.Example:
Complete Backend Example
Frontend Configuration (apps/web/.env)
Configuration for the Next.js application.Supabase Configuration
Your Supabase project URL (publicly accessible).Example:
Supabase anonymous key (publicly accessible).Example:
API Configuration
Backend API URL.Example:
Site Configuration
Public URL of your site (for SEO, OpenGraph, sitemap).Example:
Environment Mode
Node.js environment mode.Values:
development, production, testExample:Next.js automatically sets this based on the command (
next dev vs next build).Sentry Configuration
Sentry DSN for frontend error tracking (publicly accessible).Example:
Sentry auth token for uploading source maps (build time only).Example:
hCaptcha Configuration
hCaptcha site key for form protection (publicly accessible).Example:
CMS Configuration (Sanity)
Sanity project ID for headless CMS.Example:
Sanity dataset name.Example:
Stripe Configuration
Stripe publishable key (publicly accessible).Example:
Complete Frontend Example
Docker Compose Configuration (.env)
Used only for production Docker deployments.GitHub username or organization for GHCR images.Example:
Docker image tag for backend.Example:
Docker image tag for Caddy reverse proxy.Example:
Complete Docker Example
.env
Security Best Practices
Separate environments
Use different values for development, staging, and production:
- Different database instances
- Different API keys
- Different secrets
- Test Stripe keys in dev, live keys in production
Rotate secrets regularly
- Rotate
JWT_SECRETperiodically - Rotate API keys after team member departures
- Update Stripe webhook secrets after changes
Environment Variable Prefix Guide
Variables with
NEXT_PUBLIC_ prefix are exposed to the browser. Never use this prefix for secrets!| Prefix | Visibility | Usage |
|---|---|---|
NEXT_PUBLIC_ | Public (browser) | Client-side accessible values (API URLs, public keys) |
| None | Server-only | Backend secrets, private keys, database URLs |
- API URLs
- Supabase URL and anon key
- Stripe publishable key
- Sentry DSN
- Site URL
- Database URLs
- Service role keys
- Secret keys
- API secrets
- Private tokens
Troubleshooting
Environment variables not loading
Environment variables not loading
- Verify
.envfile exists in correct location - Restart development server after changes
- Check for syntax errors (no spaces around
=) - Ensure no trailing spaces or quotes
NEXT_PUBLIC_ variables not accessible
NEXT_PUBLIC_ variables not accessible
Variables with
NEXT_PUBLIC_ prefix are embedded at build time:- Restart Next.js dev server
- For production, rebuild:
- Verify variable name starts with
NEXT_PUBLIC_
Database connection fails
Database connection fails
Check your
DATABASE_URL:- Verify credentials are correct
- Ensure SSL mode is set (
?sslmode=require) - Test connection:
- For Supabase, use connection pooling URL
CORS errors in development
CORS errors in development
Ensure
ALLOWED_ORIGINS includes your frontend URL:Next Steps
Development Setup
Set up your local development environment
Deployment Guide
Configure environment for production deployment
Database Migrations
Learn about DATABASE_URL and migrations