Configure your local environment variables, ports, and AWS settings
.env.local FileCreate a .env.local file in the root of the monorepo with the following configuration:
# Database Configuration
DATABASE_URL="postgres://postgres:password@localhost:5432/zooly2_local?sslmode=disable"
# AWS Configuration
AWS_ACCESS_KEY_ID=your-aws-access-key-id
AWS_SECRET_ACCESS_KEY=your-aws-secret-access-key
DYNAMODB_TABLE_IDENTITIES=zooly-auth-identities
AWS_REGION=us-east-1
# Cognito Configuration
COGNITO_USER_POOL_ID=your-cognito-user-pool-id
COGNITO_CLIENT_ID=your-cognito-client-id
COGNITO_REGION=us-east-1
COGNITO_DOMAIN=zooly-auth
# Cookie Configuration
# Use "localhost" for local development, ".zooly.ai" for production
COOKIE_DOMAIN=localhost
# Google OAuth (for Cognito integration)
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
# Next.js client-accessible environment variables
NEXT_PUBLIC_AUTH_URL=http://localhost:3003
NEXT_PUBLIC_APP_URL=http://localhost:3004
# CORS Configuration
ALLOWED_DOMAINS_CORS="http://localhost:3005,http://localhost:3004"
Security Note: Never commit .env.local to version control. It contains sensitive credentials and is already included in .gitignore.
Each app has its own environment file for app-specific configuration:
apps/zooly-auth/.env.local)The auth app uses .env.local and typically contains the same configuration as the root .env.local file:
# Database Configuration
DATABASE_URL="postgres://postgres:password@localhost:5432/zooly2_local?sslmode=disable"
# AWS Configuration
AWS_ACCESS_KEY_ID=your-aws-access-key-id
AWS_SECRET_ACCESS_KEY=your-aws-secret-access-key
DYNAMODB_TABLE_IDENTITIES=zooly-auth-identities
AWS_REGION=us-east-1
# Cognito Configuration
COGNITO_USER_POOL_ID=your-cognito-user-pool-id
COGNITO_CLIENT_ID=your-cognito-client-id
COGNITO_REGION=us-east-1
COGNITO_DOMAIN=zooly-auth
# Cookie Configuration
COOKIE_DOMAIN=localhost
# Google OAuth (for Cognito integration)
GOOGLE_CLIENT_ID=your-google-client-id
GOOGLE_CLIENT_SECRET=your-google-client-secret
# Next.js client-accessible environment variables
NEXT_PUBLIC_AUTH_URL=http://localhost:3003
NEXT_PUBLIC_APP_URL=http://localhost:3004
# CORS Configuration
ALLOWED_DOMAINS_CORS="http://localhost:3005,http://localhost:3004"
apps/zooly-ops/.env.local)The ops app (Vite-based) uses .env for client-side environment variables:
VITE_AUTH_URL=http://localhost:3003
VITE_APP_URL=http://localhost:3004
apps/zooly-docs/.env.local)The docs app uses .env for Next.js public environment variables:
NEXT_PUBLIC_DOCS_URL=http://localhost:3006
NEXT_PUBLIC_APP_URL=http://localhost:3004
The following ports are recommended for local development:
| Application | Domain | Local Port | Command |
|---|---|---|---|
| Auth App | auth.zooly.ai | 3003 | npm run dev (in apps/zooly-auth) |
| Main App | app.zooly.ai | 3004 | npm run dev (in apps/zooly-app) |
| Ops App | ops.zooly.ai | 3005 | npm run dev (in apps/zooly-ops) |
| Docs App | docs.zooly.ai | 3006 | npm run dev (in apps/zooly-docs) |
Custom Ports: You can use any available ports for local development. If you change the ports, make sure to update the corresponding URLs in your .env.local file:
NEXT_PUBLIC_AUTH_URL - Update if auth app port changesNEXT_PUBLIC_APP_URL - Update if main app port changesALLOWED_DOMAINS_CORS - Update if any app ports changeSee Database Setup for details.