@terreno/mcp 56.0.0-beta.0 → 57.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +10 -11
- package/dist/bootstrap.js.map +1 -1
- package/dist/docs/templates/bootstrap/backend/types/models/userTypes.template.md +5 -4
- package/dist/docs/templates/tools/model.template.md +4 -2
- package/dist/docs/upgrades/0.31.0.md +60 -0
- package/dist/docs/upgrades/56.0.0-beta.2.md +59 -0
- package/dist/docs/upgrades/57.0.0-beta.1.md +41 -0
- package/dist/docs/versioned/next/README.md +1 -0
- package/dist/docs/versioned/next/explanation/README.md +7 -1
- package/dist/docs/versioned/next/explanation/deployment-architecture-gcp.md +65 -0
- package/dist/docs/versioned/next/explanation/deployment-baseline.md +78 -0
- package/dist/docs/versioned/next/explanation/positioning.md +164 -0
- package/dist/docs/versioned/next/explanation/repository-settings.md +44 -0
- package/dist/docs/versioned/next/explanation/roadmap-process.md +330 -0
- package/dist/docs/versioned/next/explanation/roadmap-seed-issues.md +887 -0
- package/dist/docs/versioned/next/how-to/README.md +8 -0
- package/dist/docs/versioned/next/how-to/build-for-web.md +69 -0
- package/dist/docs/versioned/next/how-to/deploy-backend-to-cloud-run.md +115 -0
- package/dist/docs/versioned/next/how-to/deploy-to-gcp.md +20 -228
- package/dist/docs/versioned/next/how-to/deploy-web-to-gcs-cdn.md +183 -0
- package/dist/docs/versioned/next/implementationPlans/PLAN_INDEX.md +31 -0
- package/dist/docs/versioned/next/implementationPlans/README.md +56 -30
- package/dist/docs/versioned/next/implementationPlans/agentic-sdlc-plugin.md +2 -1
- package/dist/docs/versioned/next/implementationPlans/ai-dev-loop-boost.md +1 -0
- package/dist/docs/versioned/next/implementationPlans/b2b-platform-program.md +115 -0
- package/dist/docs/versioned/next/implementationPlans/billing-stripe.md +158 -0
- package/dist/docs/versioned/next/implementationPlans/build-terreno-app-validation.md +1 -0
- package/dist/docs/versioned/next/implementationPlans/comms-abstraction.md +323 -0
- package/dist/docs/versioned/next/implementationPlans/comms-adapter-expo-push.md +107 -0
- package/dist/docs/versioned/next/implementationPlans/comms-adapter-sendgrid.md +157 -0
- package/dist/docs/versioned/next/implementationPlans/comms-adapter-twilio-sms.md +155 -0
- package/dist/docs/versioned/next/implementationPlans/comms-adapter-twilio-verify.md +99 -0
- package/dist/docs/versioned/next/implementationPlans/comms-admin-dashboard.md +180 -0
- package/dist/docs/versioned/next/implementationPlans/deploy-to-gcp.md +1 -0
- package/dist/docs/versioned/next/implementationPlans/deploy-to-vercel.md +1 -0
- package/dist/docs/versioned/next/implementationPlans/deployment-foundation.md +1 -0
- package/dist/docs/versioned/next/implementationPlans/docs-reference-coverage.md +1 -0
- package/dist/docs/versioned/next/implementationPlans/docs-tutorials-ai-first.md +1 -0
- package/dist/docs/versioned/next/implementationPlans/examples-demo-coverage.md +1 -0
- package/dist/docs/versioned/next/implementationPlans/infra-mcp-research.md +188 -0
- package/dist/docs/versioned/next/implementationPlans/infra-mcp.md +269 -0
- package/dist/docs/versioned/next/implementationPlans/migrate-cicd-to-circleci-research.md +126 -0
- package/dist/docs/versioned/next/implementationPlans/migrate-cicd-to-circleci.md +269 -0
- package/dist/docs/versioned/next/implementationPlans/native-module-baseline.md +105 -0
- package/dist/docs/versioned/next/implementationPlans/orgs-and-teams.md +158 -0
- package/dist/docs/versioned/next/implementationPlans/oss-governance-baseline.md +1 -0
- package/dist/docs/versioned/next/implementationPlans/password-reset-and-email-verification.md +147 -0
- package/dist/docs/versioned/next/implementationPlans/positioning-django-rails-universal.md +1 -0
- package/dist/docs/versioned/next/implementationPlans/public-roadmap-github.md +1 -0
- package/dist/docs/versioned/next/implementationPlans/upgrade-guides-and-skill.md +1 -0
- package/dist/docs/versioned/next/implementationPlans/web-ssr-and-admin-spa.md +1 -0
- package/dist/docs/versioned/next/reference/README.md +5 -0
- package/dist/docs/versioned/next/reference/admin-spa.md +130 -0
- package/dist/docs/versioned/next/reference/ai.md +519 -0
- package/dist/docs/versioned/next/reference/comms.md +132 -0
- package/dist/docs/versioned/next/reference/environment-variables.md +229 -382
- package/dist/docs/versioned/next/reference/test.md +108 -0
- package/dist/docs/versioned/next/roadmap.md +9 -0
- package/dist/docs/versioned/next/tasks/README.md +42 -0
- package/dist/docs/versioned/next/tasks/agentic-sdlc-plugin.md +5 -5
- package/dist/docs/versioned/next/tasks/billing-stripe.md +75 -0
- package/dist/docs/versioned/next/tasks/comms-abstraction.md +90 -0
- package/dist/docs/versioned/next/tasks/comms-adapter-expo-push.md +29 -0
- package/dist/docs/versioned/next/tasks/comms-adapter-sendgrid.md +39 -0
- package/dist/docs/versioned/next/tasks/comms-adapter-twilio-sms.md +39 -0
- package/dist/docs/versioned/next/tasks/comms-adapter-twilio-verify.md +19 -0
- package/dist/docs/versioned/next/tasks/comms-admin-dashboard.md +52 -0
- package/dist/docs/versioned/next/tasks/deploy-to-gcp.md +11 -11
- package/dist/docs/versioned/next/tasks/deployment-foundation.md +12 -12
- package/dist/docs/versioned/next/tasks/docs-reference-coverage.md +4 -4
- package/dist/docs/versioned/next/tasks/infra-mcp.md +43 -0
- package/dist/docs/versioned/next/tasks/migrate-cicd-to-circleci.md +215 -0
- package/dist/docs/versioned/next/tasks/native-module-baseline.md +42 -0
- package/dist/docs/versioned/next/tasks/orgs-and-teams.md +70 -0
- package/dist/docs/versioned/next/tasks/oss-governance-baseline.md +18 -18
- package/dist/docs/versioned/next/tasks/password-reset-and-email-verification.md +60 -0
- package/dist/docs/versioned/next/tasks/positioning-django-rails-universal.md +4 -4
- package/dist/docs/versioned/next/tasks/public-roadmap-github.md +15 -15
- package/package.json +4 -3
- package/src/docs/templates/bootstrap/backend/types/models/userTypes.template.md +5 -4
- package/src/docs/templates/tools/model.template.md +4 -2
- package/src/docs/upgrades/0.31.0.md +60 -0
- package/src/docs/upgrades/56.0.0-beta.2.md +59 -0
- package/src/docs/upgrades/57.0.0-beta.1.md +41 -0
- package/src/docs/versioned/next/README.md +1 -0
- package/src/docs/versioned/next/explanation/README.md +7 -1
- package/src/docs/versioned/next/explanation/deployment-architecture-gcp.md +65 -0
- package/src/docs/versioned/next/explanation/deployment-baseline.md +78 -0
- package/src/docs/versioned/next/explanation/positioning.md +164 -0
- package/src/docs/versioned/next/explanation/repository-settings.md +44 -0
- package/src/docs/versioned/next/explanation/roadmap-process.md +330 -0
- package/src/docs/versioned/next/explanation/roadmap-seed-issues.md +887 -0
- package/src/docs/versioned/next/how-to/README.md +8 -0
- package/src/docs/versioned/next/how-to/build-for-web.md +69 -0
- package/src/docs/versioned/next/how-to/deploy-backend-to-cloud-run.md +115 -0
- package/src/docs/versioned/next/how-to/deploy-to-gcp.md +20 -228
- package/src/docs/versioned/next/how-to/deploy-web-to-gcs-cdn.md +183 -0
- package/src/docs/versioned/next/implementationPlans/PLAN_INDEX.md +31 -0
- package/src/docs/versioned/next/implementationPlans/README.md +56 -30
- package/src/docs/versioned/next/implementationPlans/agentic-sdlc-plugin.md +2 -1
- package/src/docs/versioned/next/implementationPlans/ai-dev-loop-boost.md +1 -0
- package/src/docs/versioned/next/implementationPlans/b2b-platform-program.md +115 -0
- package/src/docs/versioned/next/implementationPlans/billing-stripe.md +158 -0
- package/src/docs/versioned/next/implementationPlans/build-terreno-app-validation.md +1 -0
- package/src/docs/versioned/next/implementationPlans/comms-abstraction.md +323 -0
- package/src/docs/versioned/next/implementationPlans/comms-adapter-expo-push.md +107 -0
- package/src/docs/versioned/next/implementationPlans/comms-adapter-sendgrid.md +157 -0
- package/src/docs/versioned/next/implementationPlans/comms-adapter-twilio-sms.md +155 -0
- package/src/docs/versioned/next/implementationPlans/comms-adapter-twilio-verify.md +99 -0
- package/src/docs/versioned/next/implementationPlans/comms-admin-dashboard.md +180 -0
- package/src/docs/versioned/next/implementationPlans/deploy-to-gcp.md +1 -0
- package/src/docs/versioned/next/implementationPlans/deploy-to-vercel.md +1 -0
- package/src/docs/versioned/next/implementationPlans/deployment-foundation.md +1 -0
- package/src/docs/versioned/next/implementationPlans/docs-reference-coverage.md +1 -0
- package/src/docs/versioned/next/implementationPlans/docs-tutorials-ai-first.md +1 -0
- package/src/docs/versioned/next/implementationPlans/examples-demo-coverage.md +1 -0
- package/src/docs/versioned/next/implementationPlans/infra-mcp-research.md +188 -0
- package/src/docs/versioned/next/implementationPlans/infra-mcp.md +269 -0
- package/src/docs/versioned/next/implementationPlans/migrate-cicd-to-circleci-research.md +126 -0
- package/src/docs/versioned/next/implementationPlans/migrate-cicd-to-circleci.md +269 -0
- package/src/docs/versioned/next/implementationPlans/native-module-baseline.md +105 -0
- package/src/docs/versioned/next/implementationPlans/orgs-and-teams.md +158 -0
- package/src/docs/versioned/next/implementationPlans/oss-governance-baseline.md +1 -0
- package/src/docs/versioned/next/implementationPlans/password-reset-and-email-verification.md +147 -0
- package/src/docs/versioned/next/implementationPlans/positioning-django-rails-universal.md +1 -0
- package/src/docs/versioned/next/implementationPlans/public-roadmap-github.md +1 -0
- package/src/docs/versioned/next/implementationPlans/upgrade-guides-and-skill.md +1 -0
- package/src/docs/versioned/next/implementationPlans/web-ssr-and-admin-spa.md +1 -0
- package/src/docs/versioned/next/reference/README.md +5 -0
- package/src/docs/versioned/next/reference/admin-spa.md +130 -0
- package/src/docs/versioned/next/reference/ai.md +519 -0
- package/src/docs/versioned/next/reference/comms.md +132 -0
- package/src/docs/versioned/next/reference/environment-variables.md +229 -382
- package/src/docs/versioned/next/reference/test.md +108 -0
- package/src/docs/versioned/next/roadmap.md +9 -0
- package/src/docs/versioned/next/tasks/README.md +42 -0
- package/src/docs/versioned/next/tasks/agentic-sdlc-plugin.md +5 -5
- package/src/docs/versioned/next/tasks/billing-stripe.md +75 -0
- package/src/docs/versioned/next/tasks/comms-abstraction.md +90 -0
- package/src/docs/versioned/next/tasks/comms-adapter-expo-push.md +29 -0
- package/src/docs/versioned/next/tasks/comms-adapter-sendgrid.md +39 -0
- package/src/docs/versioned/next/tasks/comms-adapter-twilio-sms.md +39 -0
- package/src/docs/versioned/next/tasks/comms-adapter-twilio-verify.md +19 -0
- package/src/docs/versioned/next/tasks/comms-admin-dashboard.md +52 -0
- package/src/docs/versioned/next/tasks/deploy-to-gcp.md +11 -11
- package/src/docs/versioned/next/tasks/deployment-foundation.md +12 -12
- package/src/docs/versioned/next/tasks/docs-reference-coverage.md +4 -4
- package/src/docs/versioned/next/tasks/infra-mcp.md +43 -0
- package/src/docs/versioned/next/tasks/migrate-cicd-to-circleci.md +215 -0
- package/src/docs/versioned/next/tasks/native-module-baseline.md +42 -0
- package/src/docs/versioned/next/tasks/orgs-and-teams.md +70 -0
- package/src/docs/versioned/next/tasks/oss-governance-baseline.md +18 -18
- package/src/docs/versioned/next/tasks/password-reset-and-email-verification.md +60 -0
- package/src/docs/versioned/next/tasks/positioning-django-rails-universal.md +4 -4
- package/src/docs/versioned/next/tasks/public-roadmap-github.md +15 -15
|
@@ -2,385 +2,232 @@
|
|
|
2
2
|
|
|
3
3
|
Comprehensive guide to environment variables used across Terreno packages and example applications.
|
|
4
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
|
-
| Variable | Required | Default |
|
|
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
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
|
220
|
-
|
|
221
|
-
| `
|
|
222
|
-
| `
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
### Pull Request Environments
|
|
235
|
-
|
|
236
|
-
| Variable | Required | Default | Description |
|
|
237
|
-
|----------|----------|---------|-------------|
|
|
238
|
-
| `PR_NUMBER` | ❌ | - | Pull request number (set by CI/CD) |
|
|
239
|
-
| `PR_SERVICE_URL` | ❌ | - | Cloud Run service URL base for PR environments |
|
|
240
|
-
|
|
241
|
-
### Performance Monitoring
|
|
242
|
-
|
|
243
|
-
| Variable | Required | Default | Description |
|
|
244
|
-
|----------|----------|---------|-------------|
|
|
245
|
-
| `MEMORY_SAMPLE_INTERVAL_MS` | ❌ | `60000` | Interval for memory usage sampling |
|
|
246
|
-
| `TRACE_SAMPLING_RATE` | ❌ | `0.1` | OpenTelemetry trace sampling rate (0.0-1.0) |
|
|
247
|
-
|
|
248
|
-
### Testing
|
|
249
|
-
|
|
250
|
-
| Variable | Required | Default | Description |
|
|
251
|
-
|----------|----------|---------|-------------|
|
|
252
|
-
| `TEST_MONGO_URI` | ❌ | `mongodb://localhost:27017/test` | MongoDB URI for tests |
|
|
253
|
-
| `CRON_SECRET_KEY` | ❌ | - | Secret key for testing cron endpoints |
|
|
254
|
-
|
|
255
|
-
### Configuration Model System
|
|
256
|
-
|
|
257
|
-
The example backend uses a **Configuration model** with a priority system:
|
|
258
|
-
|
|
259
|
-
**Priority (highest to lowest)**:
|
|
260
|
-
1. Runtime override via `Configuration.set()`
|
|
261
|
-
2. Database cache (persisted values)
|
|
262
|
-
3. Environment variable
|
|
263
|
-
4. Default value
|
|
264
|
-
|
|
265
|
-
``````typescript
|
|
266
|
-
// Get configuration value
|
|
267
|
-
const pageSize = await Configuration.get("DEFAULT_PAGE_SIZE"); // Returns 20
|
|
268
|
-
|
|
269
|
-
// Set configuration value (persists to database)
|
|
270
|
-
await Configuration.set("DEFAULT_PAGE_SIZE", 50);
|
|
271
|
-
|
|
272
|
-
// Register new configuration
|
|
273
|
-
Configuration.register("FEATURE_FLAG", {
|
|
274
|
-
defaultValue: false,
|
|
275
|
-
envVar: "FEATURE_FLAG",
|
|
276
|
-
description: "Enable new feature",
|
|
277
|
-
type: "boolean",
|
|
278
|
-
});
|
|
279
|
-
``````
|
|
280
|
-
|
|
281
|
-
See [Configuration System](../explanation/configuration-system.md) for details.
|
|
282
|
-
|
|
283
|
-
---
|
|
284
|
-
|
|
285
|
-
## Example Frontend
|
|
286
|
-
|
|
287
|
-
Environment variables specific to the example frontend application.
|
|
288
|
-
|
|
289
|
-
### SDK Generation
|
|
290
|
-
|
|
291
|
-
| Variable | Required | Default | Description |
|
|
292
|
-
|----------|----------|---------|-------------|
|
|
293
|
-
| `OPENAPI_URL` | ❌ | `http://localhost:4000/openapi.json` | Backend OpenAPI spec URL for SDK generation |
|
|
294
|
-
|
|
295
|
-
Used by `bun run sdk` to fetch the OpenAPI specification and generate RTK Query hooks.
|
|
296
|
-
|
|
297
|
-
### Development
|
|
298
|
-
|
|
299
|
-
| Variable | Required | Default | Description |
|
|
300
|
-
|----------|----------|---------|-------------|
|
|
301
|
-
| `EXPO_PUBLIC_API_URL` | ❌ | Auto-detected | Backend API URL (see [@terreno/rtk](#terrenortk-frontend-state)) |
|
|
302
|
-
|
|
303
|
-
### Example .env File
|
|
304
|
-
|
|
305
|
-
``````bash
|
|
306
|
-
# Backend API (optional - auto-detected if not set)
|
|
307
|
-
EXPO_PUBLIC_API_URL=http://localhost:4000
|
|
308
|
-
|
|
309
|
-
# SDK generation (optional)
|
|
310
|
-
OPENAPI_URL=http://localhost:4000/openapi.json
|
|
311
|
-
``````
|
|
312
|
-
|
|
313
|
-
---
|
|
314
|
-
|
|
315
|
-
## Best Practices
|
|
316
|
-
|
|
317
|
-
### Security
|
|
318
|
-
|
|
319
|
-
1. **Never commit `.env` files** - Add to `.gitignore`
|
|
320
|
-
2. **Use strong secrets** - Generate with `openssl rand -base64 32`
|
|
321
|
-
3. **Rotate secrets regularly** - Especially `TOKEN_SECRET` and `REFRESH_TOKEN_SECRET`
|
|
322
|
-
4. **Different secrets per environment** - Don't reuse production secrets in development
|
|
323
|
-
|
|
324
|
-
### Development
|
|
325
|
-
|
|
326
|
-
1. **Use `.env.example`** - Check into version control with placeholder values
|
|
327
|
-
2. **Document all variables** - Include description and default values
|
|
328
|
-
3. **Validate required variables** - Fail fast if missing critical config
|
|
329
|
-
4. **Auto-detect when possible** - Like `@terreno/rtk` does for `BASE_URL`
|
|
330
|
-
|
|
331
|
-
### Production
|
|
332
|
-
|
|
333
|
-
1. **Use environment variables** - Not hardcoded values or `.env` files
|
|
334
|
-
2. **Set via platform** - Railway, Heroku, Cloud Run, etc.
|
|
335
|
-
3. **Enable monitoring** - Set `SENTRY_DSN` and `USE_SENTRY_LOGGING`
|
|
336
|
-
4. **Reduce logging** - Set `LOG_REQUESTS=false` to reduce noise
|
|
337
|
-
|
|
338
|
-
---
|
|
339
|
-
|
|
340
|
-
## Troubleshooting
|
|
341
|
-
|
|
342
|
-
### "TOKEN_SECRET is not set"
|
|
343
|
-
|
|
344
|
-
**Problem**: Required authentication variables missing.
|
|
345
|
-
|
|
346
|
-
**Solution**:
|
|
347
|
-
```bash
|
|
348
|
-
cp .env.example .env
|
|
349
|
-
# Edit .env and set all required variables
|
|
350
|
-
```
|
|
351
|
-
|
|
352
|
-
### "Cannot connect to MongoDB"
|
|
353
|
-
|
|
354
|
-
**Problem**: `MONGO_URI` incorrect or MongoDB not running.
|
|
355
|
-
|
|
356
|
-
**Solutions**:
|
|
357
|
-
- Ensure MongoDB is running: `docker run -d -p 27017:27017 mongo`
|
|
358
|
-
- Check `MONGO_URI` in `.env`
|
|
359
|
-
- Test connection: `mongosh mongodb://localhost:27017`
|
|
360
|
-
|
|
361
|
-
### "Network request failed" (Frontend)
|
|
362
|
-
|
|
363
|
-
**Problem**: Frontend can't reach backend.
|
|
364
|
-
|
|
365
|
-
**Solutions**:
|
|
366
|
-
- Ensure backend is running
|
|
367
|
-
- Check `EXPO_PUBLIC_API_URL` matches backend port
|
|
368
|
-
- For physical devices: Use your computer's local IP, not `localhost`
|
|
369
|
-
- Verify CORS settings allow frontend origin
|
|
370
|
-
|
|
371
|
-
### "Invalid token"
|
|
372
|
-
|
|
373
|
-
**Problem**: Token secrets mismatch between frontend/backend.
|
|
374
|
-
|
|
375
|
-
**Solution**: Ensure `TOKEN_SECRET` and `REFRESH_TOKEN_SECRET` are identical across deployments if using shared authentication.
|
|
376
|
-
|
|
377
|
-
---
|
|
378
|
-
|
|
379
|
-
## Related Documentation
|
|
380
|
-
|
|
381
|
-
- [Getting Started Tutorial](../tutorials/getting-started.md)
|
|
382
|
-
- [@terreno/api Reference](./api.md)
|
|
383
|
-
- [@terreno/rtk Reference](./rtk.md)
|
|
384
|
-
- [Configuration System](../explanation/configuration-system.md)
|
|
385
|
-
- [Example Backend README](../../example-backend/README.md)
|
|
386
|
-
- [Example Frontend README](../../example-frontend/README.md)
|
|
5
|
+
> **Build-time client variables:** `EXPO_PUBLIC_*` variables are inlined into the JavaScript bundle at **build** time. They are not secrets and cannot be changed without rebuilding the web or native export. Set `EXPO_PUBLIC_API_URL` before `bun run export`, not on the hosting platform after deploy.
|
|
6
|
+
|
|
7
|
+
## Table columns
|
|
8
|
+
|
|
9
|
+
| Column | Meaning |
|
|
10
|
+
|--------|---------|
|
|
11
|
+
| **Read by** | Package or app that reads the variable |
|
|
12
|
+
| **Required** | Must be set for production use |
|
|
13
|
+
| **Secret** | Treat as credential — never commit or expose in client bundles |
|
|
14
|
+
| **Scope** | `server` = backend runtime; `client` = build-time (inlined); `tooling` = CI/scripts/tests only |
|
|
15
|
+
|
|
16
|
+
## Database
|
|
17
|
+
|
|
18
|
+
| Variable | Read by | Required | Default | Secret | Scope |
|
|
19
|
+
|----------|---------|----------|---------|--------|-------|
|
|
20
|
+
| `MONGO_URI` | `@terreno/api`, example-backend | ✅ prod | `mongodb://localhost:27017` | Yes | server |
|
|
21
|
+
| `MONGODB_URI` | tests, scripts | ❌ | — | Yes | tooling |
|
|
22
|
+
| `TEST_MONGO_URI` | example-backend tests | ❌ | `mongodb://localhost:27017/test` | Yes | tooling |
|
|
23
|
+
| `TERRENO_TEST_MONGODB_URI` | `@terreno/test` | ❌ | auto | Yes | tooling |
|
|
24
|
+
| `TERRENO_TEST_USE_MEMORY_MONGO` | `@terreno/test` | ❌ | — | No | tooling |
|
|
25
|
+
| `TERRENO_TEST_USE_REPLSET` | `@terreno/test` | ❌ | — | No | tooling |
|
|
26
|
+
| `TERRENO_TEST_USE_FIXTURE_CACHE` | `@terreno/test` | ❌ | — | No | tooling |
|
|
27
|
+
| `TERRENO_TEST_CACHE_DIR` | `@terreno/test` | ❌ | — | No | tooling |
|
|
28
|
+
| `BUN_TEST_DISABLE_DB` | test harness | ❌ | — | No | tooling |
|
|
29
|
+
| `DEBUG_MONGO_PRELOAD` | tests | ❌ | — | No | tooling |
|
|
30
|
+
| `DEBUG_TEST_TRANSACTION` | tests | ❌ | — | No | tooling |
|
|
31
|
+
|
|
32
|
+
## Auth — JWT
|
|
33
|
+
|
|
34
|
+
| Variable | Read by | Required | Default | Secret | Scope |
|
|
35
|
+
|----------|---------|----------|---------|--------|-------|
|
|
36
|
+
| `AUTH_PROVIDER` | `@terreno/api` | ❌ | `jwt` | No | server |
|
|
37
|
+
| `TOKEN_SECRET` | `@terreno/api` | ✅ if JWT | — | Yes | server |
|
|
38
|
+
| `TOKEN_ISSUER` | `@terreno/api` | ✅ if JWT | — | No | server |
|
|
39
|
+
| `REFRESH_TOKEN_SECRET` | `@terreno/api` | ✅ if JWT | — | Yes | server |
|
|
40
|
+
| `SESSION_SECRET` | `@terreno/api` | ✅ if JWT | — | Yes | server |
|
|
41
|
+
| `TOKEN_EXPIRES_IN` | `@terreno/api` | ❌ | `15m` | No | server |
|
|
42
|
+
| `REFRESH_TOKEN_EXPIRES_IN` | `@terreno/api` | ❌ | `30d` | No | server |
|
|
43
|
+
| `SIGNUP_DISABLED` | `@terreno/api` | ❌ | `false` | No | server |
|
|
44
|
+
|
|
45
|
+
## Auth — Better Auth
|
|
46
|
+
|
|
47
|
+
| Variable | Read by | Required | Default | Secret | Scope |
|
|
48
|
+
|----------|---------|----------|---------|--------|-------|
|
|
49
|
+
| `BETTER_AUTH_SECRET` | `@terreno/api` | ✅ if Better Auth | — | Yes | server |
|
|
50
|
+
| `BETTER_AUTH_URL` | `@terreno/api` | ✅ if Better Auth | — | No | server |
|
|
51
|
+
| `GOOGLE_CLIENT_ID` | `@terreno/api` | ❌ | — | No | server |
|
|
52
|
+
| `GOOGLE_CLIENT_SECRET` | `@terreno/api` | ❌ | — | Yes | server |
|
|
53
|
+
| `APPLE_CLIENT_ID` | `@terreno/api` | ❌ | — | No | server |
|
|
54
|
+
| `APPLE_CLIENT_SECRET` | `@terreno/api` | ❌ | — | Yes | server |
|
|
55
|
+
| `GITHUB_CLIENT_ID` | `@terreno/api` | ❌ | — | No | server |
|
|
56
|
+
| `GITHUB_CLIENT_SECRET` | `@terreno/api` | ❌ | — | Yes | server |
|
|
57
|
+
| `GITHUB_CALLBACK_URL` | `@terreno/api` | ❌ | — | No | server |
|
|
58
|
+
|
|
59
|
+
## Server configuration
|
|
60
|
+
|
|
61
|
+
| Variable | Read by | Required | Default | Secret | Scope |
|
|
62
|
+
|----------|---------|----------|---------|--------|-------|
|
|
63
|
+
| `PORT` | `@terreno/api` (`terrenoApp.ts`) | ❌ | `9000` | No | server |
|
|
64
|
+
| `NODE_ENV` | various | ❌ | `development` | No | server |
|
|
65
|
+
| `HOST` | servers | ❌ | all interfaces | No | server |
|
|
66
|
+
| `ENABLE_SWAGGER` | `@terreno/api` | ❌ | `false` | No | server |
|
|
67
|
+
| `APP_ENV` | example-backend | ❌ | `development` | No | server |
|
|
68
|
+
| `BACKEND_URL` | scripts, deploy | ❌ | — | No | server |
|
|
69
|
+
| `FRONTEND_URL` | example-backend CORS | ❌ | auto | No | server |
|
|
70
|
+
| `API_URL` | microservice split | ❌ | — | No | server |
|
|
71
|
+
| `DISABLE_LOG_ALL_REQUESTS` | `@terreno/api` logging | ❌ | — | No | server |
|
|
72
|
+
|
|
73
|
+
## Client / build-time
|
|
74
|
+
|
|
75
|
+
| Variable | Read by | Required | Default | Secret | Scope |
|
|
76
|
+
|----------|---------|----------|---------|--------|-------|
|
|
77
|
+
| `EXPO_PUBLIC_API_URL` | `@terreno/rtk` | ✅ prod web | dev auto-detect | No | **client** |
|
|
78
|
+
| `EXPO_PUBLIC_DEV_API_PORT` | `@terreno/rtk` | ❌ | `4000` | No | **client** |
|
|
79
|
+
| `EXPO_PUBLIC_BUILD_NUMBER` | example-frontend | ❌ | — | No | **client** |
|
|
80
|
+
| `OPENAPI_URL` | example-frontend `sdk` script | ❌ | `http://localhost:4000/openapi.json` | No | tooling |
|
|
81
|
+
|
|
82
|
+
### `app.json` `extra` (not `process.env`)
|
|
83
|
+
|
|
84
|
+
Configured in `expo.extra` and read via `expo-constants`:
|
|
85
|
+
|
|
86
|
+
| Key | Read by | Notes |
|
|
87
|
+
|-----|---------|-------|
|
|
88
|
+
| `BASE_URL` | `@terreno/rtk` | Production fallback when `EXPO_PUBLIC_API_URL` unset; use `__SAME_ORIGIN__` for same-origin admin SPA |
|
|
89
|
+
| `DEV_API_PORT` | `@terreno/rtk` | Override dev API port (mirrors `EXPO_PUBLIC_DEV_API_PORT`) |
|
|
90
|
+
| `AUTH_DEBUG` | `@terreno/rtk` | `"true"` enables auth debug logs |
|
|
91
|
+
| `WEBSOCKETS_DEBUG` | `@terreno/rtk` | `"true"` enables socket debug logs |
|
|
92
|
+
| `APP_ENV` | `@terreno/rtk` | Logged at startup |
|
|
93
|
+
|
|
94
|
+
Resolution order for API base URL (`rtk/src/constants.ts`):
|
|
95
|
+
|
|
96
|
+
1. `EXPO_PUBLIC_API_URL` (production and dev)
|
|
97
|
+
2. `extra.BASE_URL` (production only, when env unset)
|
|
98
|
+
3. Dev fallbacks: `hostUri`, experience URL, `localhost`
|
|
99
|
+
|
|
100
|
+
## AI
|
|
101
|
+
|
|
102
|
+
| Variable | Read by | Required | Default | Secret | Scope |
|
|
103
|
+
|----------|---------|----------|---------|--------|-------|
|
|
104
|
+
| `GEMINI_API_KEY` | `@terreno/ai` | ❌ | — | Yes | server |
|
|
105
|
+
| `OPENAI_API_KEY` | `@terreno/ai` | ❌ | — | Yes | server |
|
|
106
|
+
| `GOOGLE_VERTEX_PROJECT` | `@terreno/ai` | ❌ | — | No | server |
|
|
107
|
+
| `GOOGLE_VERTEX_LOCATION` | `@terreno/ai` | ❌ | — | No | server |
|
|
108
|
+
| `GOOGLE_VERTEX_ALLOWED_MODELS` | `@terreno/ai` | ❌ | all | No | server |
|
|
109
|
+
| `CLAUDE_KEY` | tooling | ❌ | — | Yes | tooling |
|
|
110
|
+
| `LANGFUSE_SECRET_KEY` | `@terreno/ai` | ❌ | — | Yes | server |
|
|
111
|
+
| `LANGFUSE_PUBLIC_KEY` | `@terreno/ai` | ❌ | — | No | server |
|
|
112
|
+
| `LANGFUSE_BASE_URL` | `@terreno/ai` | ❌ | — | No | server |
|
|
113
|
+
| `LANGFUSE_ORGANIZATION` | `@terreno/ai` | ❌ | — | No | server |
|
|
114
|
+
| `LANGFUSE_PROJECT` | `@terreno/ai` | ❌ | — | No | server |
|
|
115
|
+
| `LANGFUSE_PROJECT_ID` | `@terreno/ai` | ❌ | — | No | server |
|
|
116
|
+
|
|
117
|
+
## Storage (GCS)
|
|
118
|
+
|
|
119
|
+
| Variable | Read by | Required | Default | Secret | Scope |
|
|
120
|
+
|----------|---------|----------|---------|--------|-------|
|
|
121
|
+
| `GCS_BUCKET` | example-backend, admin | ❌ | — | No | server |
|
|
122
|
+
| `GCS_PROJECT_ID` | GCS clients | ❌ | — | No | server |
|
|
123
|
+
| `GCS_SERVICE_ACCOUNT_KEY` | GCS clients | ❌ | — | Yes | server |
|
|
124
|
+
|
|
125
|
+
## Feature flags
|
|
126
|
+
|
|
127
|
+
| Variable | Read by | Required | Default | Secret | Scope |
|
|
128
|
+
|----------|---------|----------|---------|--------|-------|
|
|
129
|
+
| `FEATURE_FLAGS_DEBUG` | `@terreno/feature-flags` | ❌ | — | No | server |
|
|
130
|
+
|
|
131
|
+
## Communications
|
|
132
|
+
|
|
133
|
+
| Variable | Read by | Required | Default | Secret | Scope |
|
|
134
|
+
|----------|---------|----------|---------|--------|-------|
|
|
135
|
+
| `COMMS_ENABLED` | example-backend | ❌ | `true` | No | server |
|
|
136
|
+
|
|
137
|
+
Set `COMMS_ENABLED=false` to omit the example backend's communications plugin and routes.
|
|
138
|
+
Provider credentials are documented by their separate adapter packages.
|
|
139
|
+
|
|
140
|
+
## Observability
|
|
141
|
+
|
|
142
|
+
| Variable | Read by | Required | Default | Secret | Scope |
|
|
143
|
+
|----------|---------|----------|---------|--------|-------|
|
|
144
|
+
| `SENTRY_DSN` | `@terreno/api`, frontends | ❌ | — | No | server / client |
|
|
145
|
+
| `SENTRY_ENVIRONMENT` | Sentry SDK | ❌ | — | No | server |
|
|
146
|
+
| `SENTRY_TRACES_SAMPLE_RATE` | Sentry SDK | ❌ | — | No | server |
|
|
147
|
+
| `USE_SENTRY_LOGGING` | `@terreno/api` | ❌ | `false` | No | server |
|
|
148
|
+
| `SLOW_REQUEST_THRESHOLD_MS` | `@terreno/api` | ❌ | `5000` | No | server |
|
|
149
|
+
| `SLOW_DB_QUERY_THRESHOLD_MS` | `@terreno/api` | ❌ | `100` | No | server |
|
|
150
|
+
| `TERRENO_LOG_FILE` | logger | ❌ | — | No | server |
|
|
151
|
+
| `TRACE_SAMPLING_RATE` | example-backend OTEL | ❌ | `0.1` | No | server |
|
|
152
|
+
| `MEMORY_SAMPLE_INTERVAL_MS` | example-backend | ❌ | `60000` | No | server |
|
|
153
|
+
| `JOB_TRACE_LOGS` | workers | ❌ | — | No | server |
|
|
154
|
+
|
|
155
|
+
## Caching
|
|
156
|
+
|
|
157
|
+
| Variable | Read by | Required | Default | Secret | Scope |
|
|
158
|
+
|----------|---------|----------|---------|--------|-------|
|
|
159
|
+
| `VALKEY_URL` | `@terreno/api` | ❌ | — | Yes | server |
|
|
160
|
+
| `REDIS_URL` | various | ❌ | — | Yes | server |
|
|
161
|
+
|
|
162
|
+
## Webhooks & notifications
|
|
163
|
+
|
|
164
|
+
| Variable | Read by | Required | Default | Secret | Scope |
|
|
165
|
+
|----------|---------|----------|---------|--------|-------|
|
|
166
|
+
| `SLACK_WEBHOOKS` | `@terreno/api` | ❌ | — | Yes | server |
|
|
167
|
+
| `SLACK_WEBHOOK_URL` | scripts | ❌ | — | Yes | server |
|
|
168
|
+
| `GOOGLE_CHAT_WEBHOOKS` | `@terreno/api` | ❌ | — | Yes | server |
|
|
169
|
+
| `GOOGLE_CHAT_WEBHOOK_URL` | scripts | ❌ | — | Yes | server |
|
|
170
|
+
| `ZOOM_CHAT_WEBHOOKS` | `@terreno/api` | ❌ | — | Yes | server |
|
|
171
|
+
| `ZOOM_WEBHOOK_URL` | scripts | ❌ | — | Yes | server |
|
|
172
|
+
| `WEBHOOK_SECRET` | webhooks | ❌ | — | Yes | server |
|
|
173
|
+
|
|
174
|
+
## Admin SPA
|
|
175
|
+
|
|
176
|
+
| Variable | Read by | Required | Default | Secret | Scope |
|
|
177
|
+
|----------|---------|----------|---------|--------|-------|
|
|
178
|
+
| `ADMIN_SPA_ENABLED` | example-backend | ❌ | — | No | server |
|
|
179
|
+
| `ADMIN_SPA_DIST_DIR` | example-backend Dockerfile | ❌ | — | No | server |
|
|
180
|
+
| `ADMIN_SPA_DEV_PROXY` | admin-spa plugin | ❌ | — | No | server |
|
|
181
|
+
| `ADMIN_SPA_BACKEND_URL` | admin-spa tests | ❌ | — | No | tooling |
|
|
182
|
+
| `ADMIN_SPA_E2E_EMAIL` | e2e | ❌ | — | No | tooling |
|
|
183
|
+
| `ADMIN_SPA_E2E_PASSWORD` | e2e | ❌ | — | Yes | tooling |
|
|
184
|
+
|
|
185
|
+
## MCP server
|
|
186
|
+
|
|
187
|
+
| Variable | Read by | Required | Default | Secret | Scope |
|
|
188
|
+
|----------|---------|----------|---------|--------|-------|
|
|
189
|
+
| `MCP_SERVER_URL` | MCP clients | ❌ | — | No | tooling |
|
|
190
|
+
| `TERRENO_MCP_DOCS_DIR` | `@terreno/mcp` | ❌ | — | No | tooling |
|
|
191
|
+
| `TERRENO_MCP_EVAL` | MCP eval | ❌ | — | No | tooling |
|
|
192
|
+
| `TERRENO_PROJECT_ROOT` | MCP local | ❌ | — | No | tooling |
|
|
193
|
+
|
|
194
|
+
## Example backend (app-specific)
|
|
195
|
+
|
|
196
|
+
| Variable | Read by | Required | Default | Secret | Scope |
|
|
197
|
+
|----------|---------|----------|---------|--------|-------|
|
|
198
|
+
| `FLOURISH_SERVICE` | OpenTelemetry | ❌ | `flourish-backend` | No | server |
|
|
199
|
+
| `PR_NUMBER` | PR preview deploy | ❌ | — | No | server |
|
|
200
|
+
| `PR_SERVICE_URL` | PR preview deploy | ❌ | — | No | server |
|
|
201
|
+
| `DEFAULT_PAGE_SIZE` | Configuration model | ❌ | `20` | No | server |
|
|
202
|
+
| `CRON_SECRET_KEY` | tests | ❌ | — | Yes | tooling |
|
|
203
|
+
| `WIDGET_CLIENT_SECRET` | widgets | ❌ | — | Yes | server |
|
|
204
|
+
| `API_KEY` | integrations | ❌ | — | Yes | server |
|
|
205
|
+
|
|
206
|
+
## Testing & CI (tooling only)
|
|
207
|
+
|
|
208
|
+
| Variable | Read by | Scope |
|
|
209
|
+
|----------|---------|-------|
|
|
210
|
+
| `CI` | CI scripts | tooling |
|
|
211
|
+
| `JEST_WORKER_ID` | test runners | tooling |
|
|
212
|
+
| `SHOW_ALL_TEST_LOGS` | tests | tooling |
|
|
213
|
+
| `KEEP_COVERAGE` | tests | tooling |
|
|
214
|
+
| `DRY_RUN` | scripts | tooling |
|
|
215
|
+
| `APPIUM_CI`, `APPIUM_DEV_SERVER_URL`, `APPIUM_QUICK_LOOP`, `APPIUM_REQUIRE_NON_DEV_CLIENT`, `APPIUM_SPEC_FILE_RETRIES`, `APPIUM_SPECS` | Appium e2e | tooling |
|
|
216
|
+
| `ANDROID_APP_PATH`, `ANDROID_DEVICE_NAME` | mobile e2e | tooling |
|
|
217
|
+
| `IOS_APP_PATH`, `IOS_DEVICE_NAME`, `IOS_DEVICE_UDID`, `IOS_PLATFORM_VERSION` | mobile e2e | tooling |
|
|
218
|
+
| `EXPO_OS` | Expo tooling | tooling |
|
|
219
|
+
| `DEMO_URL`, `DOCS_URL` | link checkers | tooling |
|
|
220
|
+
| `DEBUG_BILLING` | debug | tooling |
|
|
221
|
+
| `TZ` | tests | tooling |
|
|
222
|
+
| `X` | debug flag | tooling |
|
|
223
|
+
|
|
224
|
+
## Example `.env` files
|
|
225
|
+
|
|
226
|
+
- [`example-backend/.env.example`](https://github.com/FlourishHealth/terreno/blob/master/example-backend/.env.example)
|
|
227
|
+
- [`example-frontend/.env.example`](https://github.com/FlourishHealth/terreno/blob/master/example-frontend/.env.example)
|
|
228
|
+
|
|
229
|
+
## Related documentation
|
|
230
|
+
|
|
231
|
+
- [Deployment baseline](../explanation/deployment-baseline.md)
|
|
232
|
+
- [Build for web](../how-to/build-for-web.md)
|
|
233
|
+
- [Configure Better Auth](../how-to/configure-better-auth.md)
|