Repository navigation
Expand file tree
/
Copy path.env.example
More file actions
185 lines (162 loc) · 8.05 KB
/
Copy path.env.example
File metadata and controls
185 lines (162 loc) · 8.05 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# =============================================================================
# Environment layout
# =============================================================================
#
# • `.env.local` — loaded by Next.js / Payload / Better Auth when you run `pnpm dev`.
# Put DATABASE_URL, REDIS_URL, SMTP, S3, SVIX_*, Stripe, etc. here.
#
# • `.env` (optional, repo root) — NOT loaded by Next automatically. Docker Compose
# reads it when you run `docker compose …` for variable substitution (e.g.
# POSTGRES_PORT, REDIS_PORT, DATABASE_URL_BUILD for image builds, SVIX_JWT_SECRET,
# MINIO_ROOT_*, JACKSON_*). Keep secrets out of git.
#
# The Next.js app runs on the host by default (`pnpm dev`), or in Docker with
# `pnpm docker:app` (see README). Compose runs Postgres, Redis, Svix, MailHog, MinIO,
# and optionally Jackson.
#
# =============================================================================
# 1) Docker Compose dev stack → point `.env.local` at these services
# =============================================================================
# Start: `docker compose -f docker-compose.dev.yml up -d`
#
# Service Host ports (published) Typical env in `.env.local`
# ----------- --------------------------- ------------------------------------
# postgres ${POSTGRES_PORT:-5432}→5432 DATABASE_URL must match published port
# redis ${REDIS_PORT:-6379}→6379 REDIS_URL must match published port (see REDIS_PORT)
# svix 8071 SVIX_SERVER_URL + SVIX_* (below)
# mailhog ${MAILHOG_SMTP_PORT:-1025} SMTP, ${MAILHOG_UI_PORT:-8025} UI SMTP_* + MailHog UI URL (below)
# minio 9000 API, 9001 console S3_* (below)
# jackson 5225 (`--profile jackson`) JACKSON_* (optional)
#
# Production-like Next in Docker (`pnpm docker:app`): put optional port overrides in root `.env`.
# If `POSTGRES_PORT` is not 5432, also set `DATABASE_URL_BUILD` so `next build` can reach Postgres:
# DATABASE_URL_BUILD=postgresql://postgres:postgres@host.docker.internal:5434/blank_saas
# --- PostgreSQL (Docker: service `postgres`) ---
# If host 5432 is taken, add POSTGRES_PORT=5434 to root `.env` for Compose and use that port here.
DATABASE_URL="postgres://postgres:postgres@127.0.0.1:5432/blank_saas"
# --- Redis (Docker: service `redis`) — optional; omit REDIS_URL to skip self-hosted Redis limits ---
# If host 6379 is taken, add REDIS_PORT=6380 to root `.env` for Compose and use that port here.
REDIS_URL="redis://127.0.0.1:6379"
# API_RATE_LIMIT_PER_MINUTE="100"
# --- Transactional email — MailHog (Docker: service `mailhog`) ---
# If 1025/8025 are taken, set MAILHOG_SMTP_PORT / MAILHOG_UI_PORT in root `.env` and match SMTP_PORT here.
SMTP_HOST="127.0.0.1"
SMTP_PORT="1025"
SMTP_SECURE="false"
SMTP_FROM="Blank SaaS <no-reply@localhost>"
# Public marketing contact form posts to CONTACT_INBOX when SMTP is configured (see `/contact`).
# CONTACT_INBOX="you@example.com"
# Omit SMTP_USER / SMTP_PASSWORD for MailHog.
#
# Optional — real SMTP (Gmail, etc.) instead of MailHog:
# SMTP_HOST="smtp.gmail.com"
# SMTP_PORT="587"
# SMTP_SECURE="false"
# SMTP_USER=""
# SMTP_PASSWORD=""
# SMTP_FROM="Your Name <you@example.com>"
# --- Object storage — MinIO (Docker: service `minio`; console http://127.0.0.1:9001) ---
# Create the bucket in MinIO UI if uploads fail with NoSuchBucket.
# Compose defaults: user/pass minioadmin (override via MINIO_ROOT_* in root `.env` for Compose).
S3_BUCKET="blank-saas"
S3_REGION="us-east-1"
S3_ENDPOINT="http://127.0.0.1:9000"
S3_ACCESS_KEY_ID="minioadmin"
S3_SECRET_ACCESS_KEY="minioadmin"
# --- Svix webhooks (Docker: service `svix`) ---
SVIX_SERVER_URL="http://127.0.0.1:8071"
# Server API token — generate via Svix CLI / container (`svix-server jwt generate`); required for org webhook UI.
# SVIX_AUTH_TOKEN=""
# Must match the Svix container JWT secret (compose default); override in root `.env` for Compose if you change it.
SVIX_JWT_SECRET="dev-svix-jwt-secret-change-me"
# Signing secret for operational webhook `POST /api/webhooks/svix`
# SVIX_WEBHOOK_SECRET=""
# =============================================================================
# 2) Core app secrets (host `.env.local` — not Docker services)
# =============================================================================
PAYLOAD_SECRET="generate-a-long-random-string"
BETTER_AUTH_SECRET="generate-a-long-random-string"
BETTER_AUTH_URL="http://localhost:3000"
NEXT_PUBLIC_APP_URL="http://localhost:3000"
# NEXT_PUBLIC_BETTER_AUTH_URL="http://localhost:3000"
# Optional — homepage “git clone” / GitHub link (defaults to https://github.com/ezanglo/blank-saas if unset).
# NEXT_PUBLIC_GITHUB_REPO_URL="https://github.com/your-org/your-fork"
# =============================================================================
# 3) Docker Compose substitution only (root `.env`, optional)
# =============================================================================
# Compose expands `${VAR}` from the shell environment or a `.env` file beside the compose file.
# Duplicate critical overrides here if you do not export them before `docker compose up`:
#
# SVIX_JWT_SECRET="dev-svix-jwt-secret-change-me"
# MINIO_ROOT_USER="minioadmin"
# MINIO_ROOT_PASSWORD="minioadmin"
# NEXT_PUBLIC_APP_URL="http://localhost:3000"
# BETTER_AUTH_SECRET="same-as-env-local-if-using-jackson-profile"
# JACKSON_API_KEY=""
# JACKSON_PRODUCT="starter"
# JACKSON_PUBLIC_HOST_URL="http://localhost:5225"
# SAML_AUDIENCE="http://localhost:5225"
# =============================================================================
# 4) Optional — SAML / Jackson (`docker compose … --profile jackson`)
# =============================================================================
# Better Auth SAML does not require Jackson. Only if you run the sidecar:
# JACKSON_URL="http://localhost:5225"
# JACKSON_API_KEY=""
# JACKSON_PRODUCT="starter"
# JACKSON_PUBLIC_HOST_URL="http://localhost:5225"
# SAML_AUDIENCE="http://localhost:5225"
# SAML_SP_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----..."
# =============================================================================
# 5) Optional — OAuth, billing, analytics, flags, permissions (mostly cloud)
# =============================================================================
# --- Google OAuth ---
# GOOGLE_CLIENT_ID=""
# GOOGLE_CLIENT_SECRET=""
# --- GitHub OAuth ---
# GITHUB_CLIENT_ID=""
# GITHUB_CLIENT_SECRET=""
# --- Payload admin gate (wire in payload.config if used) ---
# ADMIN_EMAIL=""
# --- Rate limiting — Upstash (alternative to REDIS_URL) ---
# UPSTASH_REDIS_REST_URL=""
# UPSTASH_REDIS_REST_TOKEN=""
# --- Feature flags (flags SDK) ---
# FLAGS_SECRET=""
# --- Stripe ---
# STRIPE_SECRET_KEY="sk_test_..."
# STRIPE_WEBHOOK_SECRET="whsec_..."
# NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY="pk_test_..."
# STRIPE_PRICE_PRO_MONTHLY="price_..."
# STRIPE_PRICE_PRO_YEARLY="price_..."
# STRIPE_PRICE_ENTERPRISE_MONTHLY="price_..."
# Local: stripe listen --forward-to localhost:3000/api/webhooks/stripe
# --- PostHog (typically Cloud; self-hosted hobby stack is not in compose.dev) ---
# NEXT_PUBLIC_POSTHOG_KEY=""
# NEXT_PUBLIC_POSTHOG_HOST="https://app.posthog.com"
# POSTHOG_PERSONAL_API_KEY=""
# --- Granular permissions ---
# NEXT_PUBLIC_FEATURE_GRANULAR_PERMISSIONS="true"
# --- Cloudflare R2 (instead of MinIO / S3) ---
# R2_BUCKET=""
# R2_ACCOUNT_ID=""
# R2_ACCESS_KEY_ID=""
# R2_SECRET_ACCESS_KEY=""
# AWS_REGION="auto"
# =============================================================================
# Production security headers & CSP (optional)
# =============================================================================
# SECURITY_ENABLE_HSTS="true"
# SECURITY_CSP_REPORT_ONLY="true"
# SECURITY_CSP_ENFORCE="true"
# =============================================================================
# Sentry — omit DSNs to leave SDK uninitialized (@sentry/nextjs)
# =============================================================================
# SENTRY_DSN=""
# NEXT_PUBLIC_SENTRY_DSN=""
# SENTRY_ENVIRONMENT=""
# SENTRY_RELEASE=""
# SENTRY_ENABLED="true"
# SENTRY_TRACES_SAMPLE_RATE="0.1"
# SENTRY_AUTH_TOKEN=""
# SENTRY_UPLOAD_SOURCEMAPS="true"
# SENTRY_TUNNEL_ROUTE="auto"