DocumentationAPI Reference
Getting started

Configuration

Detailed reference for environment variables, object storage, email gateways, and AI model parameters.

OutRiskAI relies on centralized configuration managed via .env files and environment settings. This guide covers all configurable services and parameters.

Never check production .env files into source control. Store secrets in secure vault systems or hosting environment variables.

Complete Environment Variable Reference

Core Application Variables

VariableTypeDefaultDescription
NEXT_PUBLIC_APP_NAMEString"OutRiskAI"Name rendered in web headers and emails
NEXT_PUBLIC_APP_URLURL"http://localhost:3000"Canonical public URL of the application
NODE_ENVString"development"Environment mode (development, production, test)

Database & Caching

VariableRequiredDescription
DATABASE_URLYesPostgreSQL connection string (postgresql://user:pass@host:5432/dbname)
REDIS_URLOptionalRedis connection string for background queue caching

AI Services (gemini-2.5-flash)

VariableRequiredDescription
GOOGLE_API_KEYYesGoogle Gemini API key for clause extraction and Risk AI Assistant
NEXT_API_KEYYesInternal secret key for inter-service background recovery jobs

Document Storage (S3 / DigitalOcean Spaces)

When users upload PDF agreements, original binary files are stored in S3-compatible object storage:

DO_SPACES_ACCESS_KEY="your-access-key"
DO_SPACES_SECRET_KEY="your-secret-key"
DO_SPACES_ENDPOINT="https://nyc3.digitaloceanspaces.com"
DO_SPACES_NAME="outriskai-contracts"

Email Notification Settings (SMTP / SendGrid)

SMTP_HOST="smtp.sendgrid.net"
SMTP_PORT=587
SMTP_USER="apikey"
SMTP_PASSWORD="your-sendgrid-api-key"
SMTP_FROM="OutRiskAI <noreply@yourdomain.com>"

Production Deployment Checklist

Before going live in production:

  1. Enforce HTTPS: Set NEXTAUTH_URL to an https:// domain.
  2. Run Database Migrations: Execute pnpm prisma migrate deploy.
  3. Configure Cron Jobs: Schedule background recovery cron jobs (/api/internal/public-api/jobs) every 5 minutes.
  4. Enable Rate Limits: Verify PostgreSQL rate limit tables are active.

Next Steps

On this page