@terreno/mcp 0.31.0 → 56.0.0-beta.0
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/dist/bootstrap.d.ts.map +1 -1
- package/dist/bootstrap.js +15 -16
- package/dist/bootstrap.js.map +1 -1
- package/dist/docs/templates/bootstrap/backend/types/models/userTypes.template.md +4 -5
- package/dist/docs/templates/bootstrap/frontend/app/_layout.template.tsx +1 -1
- package/dist/docs/templates/tools/model.template.md +2 -4
- package/dist/docs/versioned/next/README.md +1 -0
- package/dist/docs/versioned/next/explanation/README.md +1 -7
- package/dist/docs/versioned/next/how-to/README.md +2 -8
- package/dist/docs/versioned/next/how-to/deploy-to-gcp.md +228 -20
- package/dist/docs/versioned/next/how-to/migrate-rtk-to-syncdb.md +445 -0
- package/dist/docs/versioned/next/implementationPlans/PLAN_INDEX.md +4 -57
- package/dist/docs/versioned/next/implementationPlans/README.md +30 -56
- package/dist/docs/versioned/next/implementationPlans/agentic-sdlc-plugin.md +1 -2
- package/dist/docs/versioned/next/implementationPlans/ai-dev-loop-boost.md +0 -1
- package/dist/docs/versioned/next/implementationPlans/build-terreno-app-validation.md +0 -1
- package/dist/docs/versioned/next/implementationPlans/deploy-to-gcp.md +0 -1
- package/dist/docs/versioned/next/implementationPlans/deploy-to-vercel.md +0 -1
- package/dist/docs/versioned/next/implementationPlans/deployment-foundation.md +0 -1
- package/dist/docs/versioned/next/implementationPlans/docs-reference-coverage.md +0 -1
- package/dist/docs/versioned/next/implementationPlans/docs-tutorials-ai-first.md +0 -1
- package/dist/docs/versioned/next/implementationPlans/examples-demo-coverage.md +0 -1
- package/dist/docs/versioned/next/implementationPlans/oss-governance-baseline.md +0 -1
- package/dist/docs/versioned/next/implementationPlans/positioning-django-rails-universal.md +0 -1
- package/dist/docs/versioned/next/implementationPlans/public-roadmap-github.md +0 -1
- package/dist/docs/versioned/next/implementationPlans/rtk-to-syncdb-migration-docs.md +52 -47
- package/dist/docs/versioned/next/implementationPlans/syncdb-api-inventory.md +303 -0
- package/dist/docs/versioned/next/implementationPlans/syncdb-codegen.md +252 -0
- package/dist/docs/versioned/next/implementationPlans/syncdb-local-first.md +468 -420
- package/dist/docs/versioned/next/implementationPlans/syncdb-phase-c-design.md +425 -0
- package/dist/docs/versioned/next/implementationPlans/terreno-syncdb-2.md +800 -0
- package/dist/docs/versioned/next/implementationPlans/upgrade-guides-and-skill.md +0 -1
- package/dist/docs/versioned/next/implementationPlans/web-ssr-and-admin-spa.md +0 -1
- package/dist/docs/versioned/next/reference/README.md +1 -4
- package/dist/docs/versioned/next/reference/environment-variables.md +382 -220
- package/dist/docs/versioned/next/reference/syncdb.md +456 -0
- package/dist/docs/versioned/next/superpowers/plans/2026-07-28-admin-mobile-navigation.md +97 -0
- package/dist/docs/versioned/next/superpowers/specs/2026-07-28-admin-mobile-navigation-design.md +36 -0
- package/dist/docs/versioned/next/tasks/agentic-sdlc-plugin.md +5 -5
- 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/oss-governance-baseline.md +18 -18
- 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/dist/docs/versioned/next/tasks/rtk-to-syncdb-migration-docs.md +10 -10
- package/dist/docs/versioned/next/tasks/syncdb-codegen.md +65 -0
- package/dist/docs/versioned/next/tasks/syncdb-local-first.md +434 -117
- package/package.json +4 -5
- package/src/docs/templates/bootstrap/backend/types/models/userTypes.template.md +4 -5
- package/src/docs/templates/bootstrap/frontend/app/_layout.template.tsx +1 -1
- package/src/docs/templates/tools/model.template.md +2 -4
- package/src/docs/versioned/next/README.md +1 -0
- package/src/docs/versioned/next/explanation/README.md +1 -7
- package/src/docs/versioned/next/how-to/README.md +2 -8
- package/src/docs/versioned/next/how-to/deploy-to-gcp.md +228 -20
- package/src/docs/versioned/next/how-to/migrate-rtk-to-syncdb.md +445 -0
- package/src/docs/versioned/next/implementationPlans/PLAN_INDEX.md +4 -57
- package/src/docs/versioned/next/implementationPlans/README.md +30 -56
- package/src/docs/versioned/next/implementationPlans/agentic-sdlc-plugin.md +1 -2
- package/src/docs/versioned/next/implementationPlans/ai-dev-loop-boost.md +0 -1
- package/src/docs/versioned/next/implementationPlans/build-terreno-app-validation.md +0 -1
- package/src/docs/versioned/next/implementationPlans/deploy-to-gcp.md +0 -1
- package/src/docs/versioned/next/implementationPlans/deploy-to-vercel.md +0 -1
- package/src/docs/versioned/next/implementationPlans/deployment-foundation.md +0 -1
- package/src/docs/versioned/next/implementationPlans/docs-reference-coverage.md +0 -1
- package/src/docs/versioned/next/implementationPlans/docs-tutorials-ai-first.md +0 -1
- package/src/docs/versioned/next/implementationPlans/examples-demo-coverage.md +0 -1
- package/src/docs/versioned/next/implementationPlans/oss-governance-baseline.md +0 -1
- package/src/docs/versioned/next/implementationPlans/positioning-django-rails-universal.md +0 -1
- package/src/docs/versioned/next/implementationPlans/public-roadmap-github.md +0 -1
- package/src/docs/versioned/next/implementationPlans/rtk-to-syncdb-migration-docs.md +52 -47
- package/src/docs/versioned/next/implementationPlans/syncdb-api-inventory.md +303 -0
- package/src/docs/versioned/next/implementationPlans/syncdb-codegen.md +252 -0
- package/src/docs/versioned/next/implementationPlans/syncdb-local-first.md +468 -420
- package/src/docs/versioned/next/implementationPlans/syncdb-phase-c-design.md +425 -0
- package/src/docs/versioned/next/implementationPlans/terreno-syncdb-2.md +800 -0
- package/src/docs/versioned/next/implementationPlans/upgrade-guides-and-skill.md +0 -1
- package/src/docs/versioned/next/implementationPlans/web-ssr-and-admin-spa.md +0 -1
- package/src/docs/versioned/next/reference/README.md +1 -4
- package/src/docs/versioned/next/reference/environment-variables.md +382 -220
- package/src/docs/versioned/next/reference/syncdb.md +456 -0
- package/src/docs/versioned/next/superpowers/plans/2026-07-28-admin-mobile-navigation.md +97 -0
- package/src/docs/versioned/next/superpowers/specs/2026-07-28-admin-mobile-navigation-design.md +36 -0
- package/src/docs/versioned/next/tasks/agentic-sdlc-plugin.md +5 -5
- 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/oss-governance-baseline.md +18 -18
- 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
- package/src/docs/versioned/next/tasks/rtk-to-syncdb-migration-docs.md +10 -10
- package/src/docs/versioned/next/tasks/syncdb-codegen.md +65 -0
- package/src/docs/versioned/next/tasks/syncdb-local-first.md +434 -117
- package/LICENSE +0 -21
- package/dist/__tests__/bootstrap.test.d.ts +0 -2
- package/dist/__tests__/bootstrap.test.d.ts.map +0 -1
- package/dist/__tests__/bootstrap.test.js +0 -299
- package/dist/__tests__/bootstrap.test.js.map +0 -1
- package/dist/__tests__/databaseQuery.test.d.ts +0 -2
- package/dist/__tests__/databaseQuery.test.d.ts.map +0 -1
- package/dist/__tests__/databaseQuery.test.js +0 -83
- package/dist/__tests__/databaseQuery.test.js.map +0 -1
- package/dist/__tests__/docsRoot.test.d.ts +0 -2
- package/dist/__tests__/docsRoot.test.d.ts.map +0 -1
- package/dist/__tests__/docsRoot.test.js +0 -59
- package/dist/__tests__/docsRoot.test.js.map +0 -1
- package/dist/__tests__/inferPackages.test.d.ts +0 -2
- package/dist/__tests__/inferPackages.test.d.ts.map +0 -1
- package/dist/__tests__/inferPackages.test.js +0 -35
- package/dist/__tests__/inferPackages.test.js.map +0 -1
- package/dist/__tests__/preload.d.ts +0 -2
- package/dist/__tests__/preload.d.ts.map +0 -1
- package/dist/__tests__/preload.js +0 -12
- package/dist/__tests__/preload.js.map +0 -1
- package/dist/__tests__/prompts.test.d.ts +0 -2
- package/dist/__tests__/prompts.test.d.ts.map +0 -1
- package/dist/__tests__/prompts.test.js +0 -295
- package/dist/__tests__/prompts.test.js.map +0 -1
- package/dist/__tests__/resources.test.d.ts +0 -2
- package/dist/__tests__/resources.test.d.ts.map +0 -1
- package/dist/__tests__/resources.test.js +0 -352
- package/dist/__tests__/resources.test.js.map +0 -1
- package/dist/__tests__/search.test.d.ts +0 -2
- package/dist/__tests__/search.test.d.ts.map +0 -1
- package/dist/__tests__/search.test.js +0 -163
- package/dist/__tests__/search.test.js.map +0 -1
- package/dist/__tests__/tools.test.d.ts +0 -2
- package/dist/__tests__/tools.test.d.ts.map +0 -1
- package/dist/__tests__/tools.test.js +0 -540
- package/dist/__tests__/tools.test.js.map +0 -1
- package/dist/__tests__/upgradeGuide.test.d.ts +0 -2
- package/dist/__tests__/upgradeGuide.test.d.ts.map +0 -1
- package/dist/__tests__/upgradeGuide.test.js +0 -22
- package/dist/__tests__/upgradeGuide.test.js.map +0 -1
- package/dist/docs/upgrades/0.31.0.md +0 -60
- package/dist/docs/versioned/next/explanation/deployment-architecture-gcp.md +0 -65
- package/dist/docs/versioned/next/explanation/deployment-baseline.md +0 -78
- package/dist/docs/versioned/next/explanation/positioning.md +0 -164
- package/dist/docs/versioned/next/explanation/repository-settings.md +0 -44
- package/dist/docs/versioned/next/explanation/roadmap-process.md +0 -330
- package/dist/docs/versioned/next/explanation/roadmap-seed-issues.md +0 -866
- package/dist/docs/versioned/next/how-to/build-for-web.md +0 -69
- package/dist/docs/versioned/next/how-to/deploy-backend-to-cloud-run.md +0 -115
- package/dist/docs/versioned/next/how-to/deploy-web-to-gcs-cdn.md +0 -183
- package/dist/docs/versioned/next/implementationPlans/b2b-platform-program.md +0 -114
- package/dist/docs/versioned/next/implementationPlans/billing-stripe.md +0 -158
- package/dist/docs/versioned/next/implementationPlans/comms-abstraction.md +0 -240
- package/dist/docs/versioned/next/implementationPlans/comms-adapter-expo-push.md +0 -107
- package/dist/docs/versioned/next/implementationPlans/comms-adapter-sendgrid.md +0 -107
- package/dist/docs/versioned/next/implementationPlans/comms-adapter-twilio-sms.md +0 -102
- package/dist/docs/versioned/next/implementationPlans/comms-adapter-twilio-verify.md +0 -93
- package/dist/docs/versioned/next/implementationPlans/infra-mcp-research.md +0 -188
- package/dist/docs/versioned/next/implementationPlans/infra-mcp.md +0 -269
- package/dist/docs/versioned/next/implementationPlans/native-module-baseline.md +0 -105
- package/dist/docs/versioned/next/implementationPlans/orgs-and-teams.md +0 -158
- package/dist/docs/versioned/next/implementationPlans/password-reset-and-email-verification.md +0 -147
- package/dist/docs/versioned/next/reference/admin-spa.md +0 -130
- package/dist/docs/versioned/next/reference/ai.md +0 -519
- package/dist/docs/versioned/next/reference/test.md +0 -108
- package/dist/docs/versioned/next/roadmap.md +0 -9
- package/dist/docs/versioned/next/tasks/README.md +0 -42
- package/dist/docs/versioned/next/tasks/billing-stripe.md +0 -75
- package/dist/docs/versioned/next/tasks/comms-abstraction.md +0 -77
- package/dist/docs/versioned/next/tasks/comms-adapter-expo-push.md +0 -29
- package/dist/docs/versioned/next/tasks/comms-adapter-sendgrid.md +0 -29
- package/dist/docs/versioned/next/tasks/comms-adapter-twilio-sms.md +0 -29
- package/dist/docs/versioned/next/tasks/comms-adapter-twilio-verify.md +0 -19
- package/dist/docs/versioned/next/tasks/infra-mcp.md +0 -43
- package/dist/docs/versioned/next/tasks/native-module-baseline.md +0 -42
- package/dist/docs/versioned/next/tasks/orgs-and-teams.md +0 -70
- package/dist/docs/versioned/next/tasks/password-reset-and-email-verification.md +0 -60
- package/src/docs/upgrades/0.31.0.md +0 -60
- package/src/docs/versioned/next/explanation/deployment-architecture-gcp.md +0 -65
- package/src/docs/versioned/next/explanation/deployment-baseline.md +0 -78
- package/src/docs/versioned/next/explanation/positioning.md +0 -164
- package/src/docs/versioned/next/explanation/repository-settings.md +0 -44
- package/src/docs/versioned/next/explanation/roadmap-process.md +0 -330
- package/src/docs/versioned/next/explanation/roadmap-seed-issues.md +0 -866
- package/src/docs/versioned/next/how-to/build-for-web.md +0 -69
- package/src/docs/versioned/next/how-to/deploy-backend-to-cloud-run.md +0 -115
- package/src/docs/versioned/next/how-to/deploy-web-to-gcs-cdn.md +0 -183
- package/src/docs/versioned/next/implementationPlans/b2b-platform-program.md +0 -114
- package/src/docs/versioned/next/implementationPlans/billing-stripe.md +0 -158
- package/src/docs/versioned/next/implementationPlans/comms-abstraction.md +0 -240
- package/src/docs/versioned/next/implementationPlans/comms-adapter-expo-push.md +0 -107
- package/src/docs/versioned/next/implementationPlans/comms-adapter-sendgrid.md +0 -107
- package/src/docs/versioned/next/implementationPlans/comms-adapter-twilio-sms.md +0 -102
- package/src/docs/versioned/next/implementationPlans/comms-adapter-twilio-verify.md +0 -93
- package/src/docs/versioned/next/implementationPlans/infra-mcp-research.md +0 -188
- package/src/docs/versioned/next/implementationPlans/infra-mcp.md +0 -269
- package/src/docs/versioned/next/implementationPlans/native-module-baseline.md +0 -105
- package/src/docs/versioned/next/implementationPlans/orgs-and-teams.md +0 -158
- package/src/docs/versioned/next/implementationPlans/password-reset-and-email-verification.md +0 -147
- package/src/docs/versioned/next/reference/admin-spa.md +0 -130
- package/src/docs/versioned/next/reference/ai.md +0 -519
- package/src/docs/versioned/next/reference/test.md +0 -108
- package/src/docs/versioned/next/roadmap.md +0 -9
- package/src/docs/versioned/next/tasks/README.md +0 -42
- package/src/docs/versioned/next/tasks/billing-stripe.md +0 -75
- package/src/docs/versioned/next/tasks/comms-abstraction.md +0 -77
- package/src/docs/versioned/next/tasks/comms-adapter-expo-push.md +0 -29
- package/src/docs/versioned/next/tasks/comms-adapter-sendgrid.md +0 -29
- package/src/docs/versioned/next/tasks/comms-adapter-twilio-sms.md +0 -29
- package/src/docs/versioned/next/tasks/comms-adapter-twilio-verify.md +0 -19
- package/src/docs/versioned/next/tasks/infra-mcp.md +0 -43
- package/src/docs/versioned/next/tasks/native-module-baseline.md +0 -42
- package/src/docs/versioned/next/tasks/orgs-and-teams.md +0 -70
- package/src/docs/versioned/next/tasks/password-reset-and-email-verification.md +0 -60
|
@@ -2,223 +2,385 @@
|
|
|
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 |
|
|
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
|
-
| Variable |
|
|
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
|
-
-
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [@terreno/api (Backend)](#terrenoapi-backend)
|
|
8
|
+
- [@terreno/rtk (Frontend State)](#terrenortk-frontend-state)
|
|
9
|
+
- [@terreno/ui (Components)](#terrenoui-components)
|
|
10
|
+
- [Example Backend](#example-backend)
|
|
11
|
+
- [Example Frontend](#example-frontend)
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## @terreno/api (Backend)
|
|
16
|
+
|
|
17
|
+
Environment variables used by the `@terreno/api` package.
|
|
18
|
+
|
|
19
|
+
### Authentication
|
|
20
|
+
|
|
21
|
+
| Variable | Required | Default | Description |
|
|
22
|
+
|----------|----------|---------|-------------|
|
|
23
|
+
| `AUTH_PROVIDER` | ❌ | `jwt` | Authentication provider: `"jwt"` or `"better-auth"` |
|
|
24
|
+
| `TOKEN_SECRET` | ✅ (if JWT) | - | Secret key for signing JWT access tokens |
|
|
25
|
+
| `TOKEN_ISSUER` | ✅ (if JWT) | - | JWT issuer claim (e.g., `your-app.com`) |
|
|
26
|
+
| `REFRESH_TOKEN_SECRET` | ✅ (if JWT) | - | Secret key for signing refresh tokens |
|
|
27
|
+
| `SESSION_SECRET` | ✅ (if JWT) | - | Express session secret |
|
|
28
|
+
| `TOKEN_EXPIRES_IN` | ❌ | `15m` | Access token expiration (e.g., `1h`, `30m`) |
|
|
29
|
+
| `REFRESH_TOKEN_EXPIRES_IN` | ❌ | `30d` | Refresh token expiration (e.g., `7d`, `90d`) |
|
|
30
|
+
| `SIGNUP_DISABLED` | ❌ | `false` | Disable user registration (invite-only mode) |
|
|
31
|
+
|
|
32
|
+
### Better Auth (Optional)
|
|
33
|
+
|
|
34
|
+
| Variable | Required | Default | Description |
|
|
35
|
+
|----------|----------|---------|-------------|
|
|
36
|
+
| `BETTER_AUTH_SECRET` | ✅ (if Better Auth) | - | Secret key for Better Auth session encryption |
|
|
37
|
+
| `BETTER_AUTH_URL` | ✅ (if Better Auth) | - | Base URL for Better Auth server (e.g., `https://api.example.com`) |
|
|
38
|
+
| `GOOGLE_CLIENT_ID` | ❌ | - | Google OAuth client ID |
|
|
39
|
+
| `GOOGLE_CLIENT_SECRET` | ❌ | - | Google OAuth client secret |
|
|
40
|
+
| `APPLE_CLIENT_ID` | ❌ | - | Apple Sign In service ID |
|
|
41
|
+
| `APPLE_CLIENT_SECRET` | ❌ | - | Apple Sign In private key |
|
|
42
|
+
|
|
43
|
+
### GitHub OAuth (Optional)
|
|
44
|
+
|
|
45
|
+
| Variable | Required | Default | Description |
|
|
46
|
+
|----------|----------|---------|-------------|
|
|
47
|
+
| `GITHUB_CLIENT_ID` | ❌ | - | GitHub OAuth application client ID |
|
|
48
|
+
| `GITHUB_CLIENT_SECRET` | ❌ | - | GitHub OAuth application client secret |
|
|
49
|
+
| `GITHUB_CALLBACK_URL` | ❌ | - | OAuth callback URL (e.g., `https://api.example.com/auth/github/callback`) |
|
|
50
|
+
|
|
51
|
+
### Server Configuration
|
|
52
|
+
|
|
53
|
+
| Variable | Required | Default | Description |
|
|
54
|
+
|----------|----------|---------|-------------|
|
|
55
|
+
| `PORT` | ❌ | `3000` | HTTP server port |
|
|
56
|
+
| `NODE_ENV` | ❌ | `development` | Node environment (`development`, `production`, `test`) |
|
|
57
|
+
| `MONGO_URI` | ❌ | `mongodb://localhost:27017` | MongoDB connection string |
|
|
58
|
+
| `ENABLE_SWAGGER` | ❌ | `false` | Enable Swagger UI at `/swagger` endpoint |
|
|
59
|
+
|
|
60
|
+
### Logging & Monitoring
|
|
61
|
+
|
|
62
|
+
| Variable | Required | Default | Description |
|
|
63
|
+
|----------|----------|---------|-------------|
|
|
64
|
+
| `SENTRY_DSN` | ❌ | - | Sentry DSN for error tracking |
|
|
65
|
+
| `USE_SENTRY_LOGGING` | ❌ | `false` | Send logs to Sentry |
|
|
66
|
+
| `LOG_REQUESTS` | ❌ | `false` | Log all HTTP requests |
|
|
67
|
+
| `LOG_SLOW_REQUESTS` | ❌ | `false` | Log requests exceeding threshold |
|
|
68
|
+
| `SLOW_REQUEST_THRESHOLD_MS` | ❌ | `5000` | Milliseconds to consider a request "slow" |
|
|
69
|
+
| `SLOW_DB_QUERY_THRESHOLD_MS` | ❌ | `100` | Milliseconds to consider a DB query "slow" |
|
|
70
|
+
|
|
71
|
+
### Webhooks & Notifications (Optional)
|
|
72
|
+
|
|
73
|
+
| Variable | Required | Default | Description |
|
|
74
|
+
|----------|----------|---------|-------------|
|
|
75
|
+
| `SLACK_WEBHOOKS` | ❌ | - | JSON object mapping names to Slack webhook URLs<br/>Example: `{"default": "https://hooks.slack.com/..."}` |
|
|
76
|
+
| `GOOGLE_CHAT_WEBHOOKS` | ❌ | - | JSON object mapping names to Google Chat webhook URLs<br/>Example: `{"default": "https://chat.googleapis.com/..."}` |
|
|
77
|
+
| `ZOOM_WEBHOOK` | ❌ | - | Zoom webhook URL for notifications |
|
|
78
|
+
|
|
79
|
+
### Google Cloud Platform (Optional)
|
|
80
|
+
|
|
81
|
+
| Variable | Required | Default | Description |
|
|
82
|
+
|----------|----------|---------|-------------|
|
|
83
|
+
| `GCP_PROJECT` | ❌ | - | Google Cloud project ID |
|
|
84
|
+
| `GCP_LOCATION` | ❌ | - | GCP region (e.g., `us-central1`) |
|
|
85
|
+
| `GCP_SERVICE_ACCOUNT_EMAIL` | ❌ | - | Service account email for authentication |
|
|
86
|
+
| `GCP_TASKS_NOTIFICATIONS_QUEUE` | ❌ | - | Cloud Tasks queue name for notifications |
|
|
87
|
+
| `GCP_TASK_PROCESSOR_QUEUE` | ❌ | - | Cloud Tasks queue name for background tasks |
|
|
88
|
+
|
|
89
|
+
### Caching & Performance
|
|
90
|
+
|
|
91
|
+
| Variable | Required | Default | Description |
|
|
92
|
+
|----------|----------|---------|-------------|
|
|
93
|
+
| `VALKEY_URL` | ❌ | - | Redis/Valkey connection URL (e.g., `redis://localhost:6379`) |
|
|
94
|
+
|
|
95
|
+
### Other APIs
|
|
96
|
+
|
|
97
|
+
| Variable | Required | Default | Description |
|
|
98
|
+
|----------|----------|---------|-------------|
|
|
99
|
+
| `GEMINI_API_KEY` | ❌ | - | Google Gemini API key for AI features |
|
|
100
|
+
|
|
101
|
+
### Example .env File
|
|
102
|
+
|
|
103
|
+
``````bash
|
|
104
|
+
# Authentication Provider
|
|
105
|
+
AUTH_PROVIDER=jwt # or "better-auth"
|
|
106
|
+
|
|
107
|
+
# Required for JWT authentication
|
|
108
|
+
TOKEN_SECRET=your-secret-key-change-this-in-production
|
|
109
|
+
TOKEN_ISSUER=your-app.com
|
|
110
|
+
REFRESH_TOKEN_SECRET=your-refresh-secret-change-this-too
|
|
111
|
+
SESSION_SECRET=your-session-secret-change-this-also
|
|
112
|
+
|
|
113
|
+
# Required for Better Auth (if AUTH_PROVIDER=better-auth)
|
|
114
|
+
# BETTER_AUTH_SECRET=your-better-auth-secret-min-32-chars
|
|
115
|
+
# BETTER_AUTH_URL=http://localhost:4000
|
|
116
|
+
|
|
117
|
+
# Optional - Social OAuth (Better Auth)
|
|
118
|
+
# GOOGLE_CLIENT_ID=your-google-client-id
|
|
119
|
+
# GOOGLE_CLIENT_SECRET=your-google-client-secret
|
|
120
|
+
# GITHUB_CLIENT_ID=your-github-client-id
|
|
121
|
+
# GITHUB_CLIENT_SECRET=your-github-client-secret
|
|
122
|
+
|
|
123
|
+
# Database
|
|
124
|
+
MONGO_URI=mongodb://localhost:27017/your-app
|
|
125
|
+
|
|
126
|
+
# Optional - Common in development
|
|
127
|
+
PORT=3000
|
|
128
|
+
NODE_ENV=development
|
|
129
|
+
ENABLE_SWAGGER=true
|
|
130
|
+
LOG_REQUESTS=true
|
|
131
|
+
|
|
132
|
+
# Optional - Production monitoring
|
|
133
|
+
SENTRY_DSN=https://your-sentry-dsn@sentry.io/project-id
|
|
134
|
+
USE_SENTRY_LOGGING=true
|
|
135
|
+
``````
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## @terreno/rtk (Frontend State)
|
|
140
|
+
|
|
141
|
+
Environment variables used by the `@terreno/rtk` package and frontend applications.
|
|
142
|
+
|
|
143
|
+
### Base URL Configuration
|
|
144
|
+
|
|
145
|
+
The base URL is resolved in priority order:
|
|
146
|
+
|
|
147
|
+
1. `Constants.expoConfig?.extra?.BASE_URL` (production/staging builds)
|
|
148
|
+
2. `process.env.EXPO_PUBLIC_API_URL` (development web)
|
|
149
|
+
3. `Constants.expoConfig?.hostUri` + the dev API port (dev simulator/device)
|
|
150
|
+
4. `http://localhost:<dev API port>` (fallback)
|
|
151
|
+
|
|
152
|
+
The dev API port defaults to `4000` and is overridable per app via `EXPO_PUBLIC_DEV_API_PORT`
|
|
153
|
+
or `expoConfig.extra.DEV_API_PORT` (for example `3000` or `9000`).
|
|
154
|
+
|
|
155
|
+
| Variable | Required | Default | Description |
|
|
156
|
+
|----------|----------|---------|-------------|
|
|
157
|
+
| `EXPO_PUBLIC_API_URL` | ❌ | Auto-detected | Backend API base URL<br/>Web: `http://localhost:4000`<br/>Simulator: Auto-detected via `hostUri`<br/>Device: Use your computer's local IP |
|
|
158
|
+
| `EXPO_PUBLIC_DEV_API_PORT` | ❌ | 4000 | Local dev API port for host/localhost resolution (also settable via `extra.DEV_API_PORT`) |
|
|
159
|
+
|
|
160
|
+
### Debug Flags
|
|
161
|
+
|
|
162
|
+
| Variable | Required | Default | Description |
|
|
163
|
+
|----------|----------|---------|-------------|
|
|
164
|
+
| `AUTH_DEBUG` | ❌ | `false` | Enable authentication debug logging |
|
|
165
|
+
| `WEBSOCKETS_DEBUG` | ❌ | `false` | Enable WebSocket debug logging |
|
|
166
|
+
|
|
167
|
+
### Example app.json Configuration
|
|
168
|
+
|
|
169
|
+
``````json
|
|
170
|
+
{
|
|
171
|
+
"expo": {
|
|
172
|
+
"extra": {
|
|
173
|
+
"BASE_URL": "https://api.example.com",
|
|
174
|
+
"AUTH_DEBUG": "false",
|
|
175
|
+
"WEBSOCKETS_DEBUG": "false"
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
``````
|
|
180
|
+
|
|
181
|
+
### Example .env for Web Development
|
|
182
|
+
|
|
183
|
+
``````bash
|
|
184
|
+
# Backend API URL
|
|
185
|
+
EXPO_PUBLIC_API_URL=http://localhost:4000
|
|
186
|
+
``````
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## @terreno/ui (Components)
|
|
191
|
+
|
|
192
|
+
The `@terreno/ui` package **does not require environment variables**. All configuration is done at runtime via the `TerrenoProvider` component.
|
|
193
|
+
|
|
194
|
+
### Runtime Configuration
|
|
195
|
+
|
|
196
|
+
``````typescript
|
|
197
|
+
import {TerrenoProvider} from "@terreno/ui";
|
|
198
|
+
|
|
199
|
+
<TerrenoProvider
|
|
200
|
+
initialTheme={{
|
|
201
|
+
primitives: {
|
|
202
|
+
primary500: "#0066CC",
|
|
203
|
+
accent500: "#FF6B35",
|
|
204
|
+
}
|
|
205
|
+
}}
|
|
206
|
+
>
|
|
207
|
+
<App />
|
|
208
|
+
</TerrenoProvider>
|
|
209
|
+
``````
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## Example Backend
|
|
214
|
+
|
|
215
|
+
Environment variables specific to the example backend application (not part of @terreno/api).
|
|
216
|
+
|
|
217
|
+
### Application Configuration
|
|
218
|
+
|
|
219
|
+
| Variable | Required | Default | Description |
|
|
220
|
+
|----------|----------|---------|-------------|
|
|
221
|
+
| `APP_ENV` | ❌ | `development` | Application environment (`development`, `staging`, `production`) |
|
|
222
|
+
| `BACKEND_SERVICE` | ❌ | `all` | Service type to run: `api`, `websockets`, `tasks`, or `all` |
|
|
223
|
+
| `API_URL` | ❌ | - | API service URL (for microservice architecture) |
|
|
224
|
+
| `TASKS_URL` | ❌ | - | Tasks service URL (for microservice architecture) |
|
|
225
|
+
| `FLOURISH_SERVICE` | ❌ | `flourish-backend` | Service name for OpenTelemetry tracing |
|
|
226
|
+
|
|
227
|
+
### WebSockets
|
|
228
|
+
|
|
229
|
+
| Variable | Required | Default | Description |
|
|
230
|
+
|----------|----------|---------|-------------|
|
|
231
|
+
| `WEBSOCKET_PORT` | ❌ | Same as `PORT` | WebSocket server port (if separate from HTTP) |
|
|
232
|
+
| `FRONTEND_URL` | ❌ | Auto-detected | Frontend URL for CORS (e.g., `http://localhost:8082`) |
|
|
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)
|