-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.env.prod.example
More file actions
133 lines (113 loc) · 5.07 KB
/
.env.prod.example
File metadata and controls
133 lines (113 loc) · 5.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# TaskFlow Production Environment (Managed Services)
# Copy to .env.prod and fill in your values
# Usage: ./scripts/deploy-prod.sh
# =============================================================================
# NEON POSTGRESQL (Required)
# =============================================================================
# Create 4 databases in Neon Console: https://console.neon.tech/
#
# Steps:
# 1. Create a Neon project
# 2. Create 4 databases: sso_db, taskflow_db, chatkit_db, notification_db
# 3. Copy the connection strings below
#
# Architecture:
# - sso_db: Auth (users, sessions) - consumed by SSO Platform
# - taskflow_db: Core business (tasks, projects, workers) - consumed by API, MCP
# - chatkit_db: Chat (threads, messages) - consumed by API ChatKit routes
# - notification_db: Notifications - consumed by Notification Service
# SSO Database (Better Auth)
NEON_SSO_DATABASE_URL=postgresql://neondb_owner:xxx@ep-xxx.us-east-1.aws.neon.tech/sso_db?sslmode=require
# API Database (Tasks, Projects, Workers, Audit)
NEON_API_DATABASE_URL=postgresql://neondb_owner:xxx@ep-xxx.us-east-1.aws.neon.tech/taskflow_db?sslmode=require
# ChatKit Database (Chat threads, messages)
NEON_CHATKIT_DATABASE_URL=postgresql://neondb_owner:xxx@ep-xxx.us-east-1.aws.neon.tech/chatkit_db?sslmode=require
# Notification Database (Notification Service)
NEON_NOTIFICATION_DATABASE_URL=postgresql://neondb_owner:xxx@ep-xxx.us-east-1.aws.neon.tech/notification_db?sslmode=require
# =============================================================================
# UPSTASH REDIS (Required)
# =============================================================================
# Create ONE Redis database: https://console.upstash.com/
# You'll use it for both Dapr pub/sub AND SSO rate limiting
#
# From Upstash Console, copy these values:
# --- For Dapr Pub/Sub (standard Redis protocol) ---
# Found under "Connect" > "Redis" tab
UPSTASH_REDIS_HOST=your-redis-xxx.upstash.io:6379
UPSTASH_REDIS_PASSWORD=your-upstash-password
# --- For SSO Rate Limiting (Upstash REST API) ---
# Found under "Connect" > "REST API" tab
REDIS_URL=https://your-redis-xxx.upstash.io
REDIS_TOKEN=AXxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# =============================================================================
# APPLICATION SECRETS (Required)
# =============================================================================
# Better Auth secret for JWT signing (SSO uses this to sign JWTs)
# Generate with: openssl rand -hex 32
BETTER_AUTH_SECRET=your-32-char-secret-here
# =============================================================================
# OPENAI (Required for AI features)
# =============================================================================
# OpenAI API key (for ChatKit AI responses)
# Get from: https://platform.openai.com/api-keys
OPENAI_API_KEY=sk-proj-xxx
# ChatKit domain key (for frontend authentication)
# Use default for local dev, generate unique for production
NEXT_PUBLIC_CHATKIT_DOMAIN_KEY=domain_pk_local_dev
# =============================================================================
# SMTP EMAIL (Optional - for email verification)
# =============================================================================
# Required if you want email verification in SSO
# Works with Gmail, SendGrid, Mailgun, etc.
# Gmail SMTP (use App Password, not regular password)
# SMTP_HOST=smtp.gmail.com
# SMTP_PORT=587
# SMTP_USER=your-email@gmail.com
# SMTP_PASS=your-app-password
# SMTP_SECURE=false
# EMAIL_FROM=no-reply@yourdomain.com
# SendGrid SMTP
# SMTP_HOST=smtp.sendgrid.net
# SMTP_PORT=587
# SMTP_USER=apikey
# SMTP_PASS=your-sendgrid-api-key
# SMTP_SECURE=false
# EMAIL_FROM=no-reply@yourdomain.com
# Leave empty to disable email features
SMTP_PASS=
# =============================================================================
# PRODUCTION URLS (Optional - for custom domains)
# =============================================================================
# Uncomment and set these if deploying to a real domain
# BETTER_AUTH_URL=https://sso.yourdomain.com
# ALLOWED_ORIGINS=https://yourdomain.com,https://sso.yourdomain.com
# CORS_ORIGINS=https://yourdomain.com,https://sso.yourdomain.com
# NEXT_PUBLIC_API_URL=https://api.yourdomain.com
# NEXT_PUBLIC_SSO_URL=https://sso.yourdomain.com
# =============================================================================
# QUICK START
# =============================================================================
#
# 1. Copy this file:
# cp .env.prod.example .env.prod
#
# 2. Create Neon databases:
# - Go to https://console.neon.tech/
# - Create project, then 4 databases (sso_db, taskflow_db, chatkit_db, notification_db)
# - Copy connection strings
#
# 3. Create Upstash Redis:
# - Go to https://console.upstash.com/
# - Create Redis database
# - Copy host and password
#
# 4. Generate secrets:
# openssl rand -hex 32 # Run twice for BETTER_AUTH_SECRET and JWT_SECRET
#
# 5. Get OpenAI key:
# - Go to https://platform.openai.com/api-keys
#
# 6. Deploy:
# ./scripts/deploy-prod.sh --port-forward
#
# =============================================================================