This document lists all environment variables used by the Process Engineering Suite applications.
These variables apply to the entire suite or multiple applications.
DEPLOY_TARGET: deployment lane selector used to keep platform behavior isolated- Values:
local,vercel,aws - Default:
local - Set
DEPLOY_TARGET=vercelon Vercel projects - Set
DEPLOY_TARGET=awson AWS deployments
- Values:
POSTGRES_PASSWORD: PostgreSQL database password (required for production)POSTGRES_USER: PostgreSQL database user (default: postgres)POSTGRES_DB: PostgreSQL database name (default: engsuite)DATABASE_URL: Full PostgreSQL connection string (optional, auto-built if not provided)- Format:
postgresql+asyncpg://user:password@host:port/database
- Format:
NEXT_PUBLIC_API_URL: Backend API base URL (default: http://localhost:8000)- Used by all frontend applications
API_PROXY_TARGET: server-side rewrite target for PSV/api/*routes- Default:
NEXT_PUBLIC_API_URLif set, otherwisehttp://localhost:8000
- Default:
DOCS_URL: docs app origin used by web rewritesNETWORK_EDITOR_URL: network-editor app origin used by web rewritesPSV_URL: PSV app origin used by web rewritesDESIGN_AGENTS_URL: design-agents app origin used by web rewrites
NEXT_PUBLIC_USE_LOCAL_STORAGE: Enable demo mode with localStorage authentication- Values:
true(demo mode) orfalse(API mode) - Default:
false - In demo mode, no backend required
- Values:
USE_MOCK_DATA: Force mock data usage even when database is available- Values:
trueorfalse - Default:
false
- Values:
SECRET_KEY: Secret key for JWT tokens and security- Required for production authentication
NEXT_PUBLIC_API_URL: Backend API base URL (default:http://localhost:8000)- Required to connect the Save/Load feature to the central PostgreSQL database
- App runs on port 3004; CORS for this port is registered in the FastAPI backend
NEXT_PUBLIC_API_URL: Backend API base URL (default:http://localhost:8000)- Used for both hydraulic calculations and the new cloud Save/Load feature
DEFAULT_THEME: Default theme for the application- Values:
lightordark - Default:
light
- Values:
VITE_API_URL: Backend API base URL for this Vite application (default:http://localhost:8000)- Note: Uses Vite's
import.meta.env.VITE_API_URLconvention, notNEXT_PUBLIC_API_URL - Used for both the LLM agent pipeline and the new cloud session Save/Load feature
- Note: Uses Vite's
Coming Soon - No environment variables defined yet.
# Basic development setup
bun run dev
# With custom API URL
NEXT_PUBLIC_API_URL=http://localhost:8000 bun run dev# Environment file
cat > .env << EOF
DEPLOY_TARGET=aws
POSTGRES_PASSWORD=secure-password
POSTGRES_USER=postgres
POSTGRES_DB=engsuite
DATABASE_URL=postgresql+asyncpg://postgres:secure-password@postgres:5432/engsuite
NEXT_PUBLIC_API_URL=https://api.your-domain.com
API_PROXY_TARGET=https://api.your-domain.com
DOCS_URL=https://docs.your-domain.com
NETWORK_EDITOR_URL=https://network-editor.your-domain.com
PSV_URL=https://psv.your-domain.com
DESIGN_AGENTS_URL=https://design-agents.your-domain.com
EOF
# Run with docker-compose
docker-compose -f infra/docker-compose.yml --env-file .env up -d# API environment
DATABASE_URL=postgresql+asyncpg://user:pass@host:5432/db
SECRET_KEY=your-secret-key
USE_MOCK_DATA=false
# Frontend environment
NEXT_PUBLIC_API_URL=https://your-api-domain
API_PROXY_TARGET=https://your-api-domain
NEXT_PUBLIC_USE_LOCAL_STORAGE=falseSet these in each Vercel project:
DEPLOY_TARGET=vercel
NEXT_PUBLIC_API_URL=https://api.your-domain.comFor apps/web, also set:
DOCS_URL=https://your-docs-app.vercel.app
NETWORK_EDITOR_URL=https://your-network-editor-app.vercel.app
PSV_URL=https://your-psv-app.vercel.app
DESIGN_AGENTS_URL=https://your-design-agents-app.vercel.app- Never commit
.envfiles to version control - Use strong passwords for database credentials
- Rotate
SECRET_KEYregularly in production - Use HTTPS for
NEXT_PUBLIC_API_URLin production - Consider using Docker secrets or external secret management
Verify environment configuration:
# Check API health
curl http://localhost:8000/health
# Check database connection (API logs)
curl http://localhost:8000/admin/data-source
# Test frontend connectivity
curl http://localhost:3003/api/health # PSV
curl http://localhost:3002/api/health # Network EditorValidate both deployment lanes before merge:
bun run check:deploy:matrix- API connection errors: Check
NEXT_PUBLIC_API_URLformat and accessibility - Database connection failed: Verify
DATABASE_URLsyntax and database availability - Authentication issues: Ensure
SECRET_KEYis set for API - Demo mode not working: Confirm
NEXT_PUBLIC_USE_LOCAL_STORAGE=true
- Explicit
DATABASE_URLoverrides individual Postgres variables - Application-specific variables override defaults
API_PROXY_TARGEToverridesNEXT_PUBLIC_API_URLfor PSV server-side rewrites- Docker environment overrides system environment
DEPLOYMENT_GUIDE.md- Main deployment instructions (see infra/docker-compose.yml)TROUBLESHOOTING.md- Issue resolution guides