Environment variables and infrastructure setup for self-hosted deployments.
Cloud users: You don't need to configure any of this. Your infrastructure is managed for you.
Create a .env file in the root directory
# Server Configuration
PORT=8080
APP_ENV=production
# Database Configuration
DATABASE_URL=postgres://postgres:postgres@db:5432/chitthi?sslmode=disable
# Redis Configuration
REDIS_URL=redis://redis:6379
# Auth & Encryption
JWT_SECRET=your-secret-key
ENCRYPTION_KEY=your-32-byte-key
# Server-to-server auth (Next.js ↔ Go API)
CHITTHI_BFF_SECRET=generate-with-openssl-rand-hex-32
# NextAuth (Google OAuth)
GOOGLE_CLIENT_ID=your-client-id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your-client-secret
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=generate-with-openssl-rand-base64-32
# Email Provider Keys (Optional - environment-level fallback)
SENDGRID_API_KEY=your_sendgrid_api_key
BREEVO_API_KEY=your_breevo_api_key
MAILERSEND_API_KEY=your_mailersend_api_key
# Message Queue (Optional)
RABBITMQ_URL=amqp://guest:guest@localhost:5672/Stores users, providers, unified API keys, and daily metrics.
docker run -d \
--name chitthi-postgres \
-e POSTGRES_PASSWORD=postgres \
-e POSTGRES_DB=chitthi \
-p 5432:5432 \
postgres:15Used for caching and rate limiting.
docker run -d \
--name chitthi-redis \
-p 6379:6379 \
redis:7-alpineRun migrations to set up the required tables
Install the golang-migrate CLI. Run from the repository root.
migrate -path migrations \
-database "postgres://postgres:postgres@localhost:5432/chitthi?sslmode=disable" upmigrate -path migrations \
-database "postgres://postgres:postgres@localhost:5432/chitthi?sslmode=disable" down 1