@terreno/mcp 56.0.0-beta.0 → 56.0.0-beta.2

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.
Files changed (154) hide show
  1. package/LICENSE +21 -0
  2. package/dist/bootstrap.js +7 -7
  3. package/dist/bootstrap.js.map +1 -1
  4. package/dist/docs/templates/bootstrap/backend/types/models/userTypes.template.md +5 -4
  5. package/dist/docs/templates/tools/model.template.md +4 -2
  6. package/dist/docs/upgrades/0.31.0.md +60 -0
  7. package/dist/docs/upgrades/56.0.0-beta.2.md +59 -0
  8. package/dist/docs/versioned/next/README.md +1 -0
  9. package/dist/docs/versioned/next/explanation/README.md +7 -1
  10. package/dist/docs/versioned/next/explanation/deployment-architecture-gcp.md +65 -0
  11. package/dist/docs/versioned/next/explanation/deployment-baseline.md +78 -0
  12. package/dist/docs/versioned/next/explanation/positioning.md +164 -0
  13. package/dist/docs/versioned/next/explanation/repository-settings.md +44 -0
  14. package/dist/docs/versioned/next/explanation/roadmap-process.md +330 -0
  15. package/dist/docs/versioned/next/explanation/roadmap-seed-issues.md +887 -0
  16. package/dist/docs/versioned/next/how-to/README.md +8 -0
  17. package/dist/docs/versioned/next/how-to/build-for-web.md +69 -0
  18. package/dist/docs/versioned/next/how-to/deploy-backend-to-cloud-run.md +115 -0
  19. package/dist/docs/versioned/next/how-to/deploy-to-gcp.md +20 -228
  20. package/dist/docs/versioned/next/how-to/deploy-web-to-gcs-cdn.md +183 -0
  21. package/dist/docs/versioned/next/implementationPlans/PLAN_INDEX.md +31 -0
  22. package/dist/docs/versioned/next/implementationPlans/README.md +56 -30
  23. package/dist/docs/versioned/next/implementationPlans/agentic-sdlc-plugin.md +2 -1
  24. package/dist/docs/versioned/next/implementationPlans/ai-dev-loop-boost.md +1 -0
  25. package/dist/docs/versioned/next/implementationPlans/b2b-platform-program.md +115 -0
  26. package/dist/docs/versioned/next/implementationPlans/billing-stripe.md +158 -0
  27. package/dist/docs/versioned/next/implementationPlans/build-terreno-app-validation.md +1 -0
  28. package/dist/docs/versioned/next/implementationPlans/comms-abstraction.md +323 -0
  29. package/dist/docs/versioned/next/implementationPlans/comms-adapter-expo-push.md +107 -0
  30. package/dist/docs/versioned/next/implementationPlans/comms-adapter-sendgrid.md +157 -0
  31. package/dist/docs/versioned/next/implementationPlans/comms-adapter-twilio-sms.md +155 -0
  32. package/dist/docs/versioned/next/implementationPlans/comms-adapter-twilio-verify.md +99 -0
  33. package/dist/docs/versioned/next/implementationPlans/comms-admin-dashboard.md +180 -0
  34. package/dist/docs/versioned/next/implementationPlans/deploy-to-gcp.md +1 -0
  35. package/dist/docs/versioned/next/implementationPlans/deploy-to-vercel.md +1 -0
  36. package/dist/docs/versioned/next/implementationPlans/deployment-foundation.md +1 -0
  37. package/dist/docs/versioned/next/implementationPlans/docs-reference-coverage.md +1 -0
  38. package/dist/docs/versioned/next/implementationPlans/docs-tutorials-ai-first.md +1 -0
  39. package/dist/docs/versioned/next/implementationPlans/examples-demo-coverage.md +1 -0
  40. package/dist/docs/versioned/next/implementationPlans/infra-mcp-research.md +188 -0
  41. package/dist/docs/versioned/next/implementationPlans/infra-mcp.md +269 -0
  42. package/dist/docs/versioned/next/implementationPlans/migrate-cicd-to-circleci-research.md +126 -0
  43. package/dist/docs/versioned/next/implementationPlans/migrate-cicd-to-circleci.md +269 -0
  44. package/dist/docs/versioned/next/implementationPlans/native-module-baseline.md +105 -0
  45. package/dist/docs/versioned/next/implementationPlans/orgs-and-teams.md +158 -0
  46. package/dist/docs/versioned/next/implementationPlans/oss-governance-baseline.md +1 -0
  47. package/dist/docs/versioned/next/implementationPlans/password-reset-and-email-verification.md +147 -0
  48. package/dist/docs/versioned/next/implementationPlans/positioning-django-rails-universal.md +1 -0
  49. package/dist/docs/versioned/next/implementationPlans/public-roadmap-github.md +1 -0
  50. package/dist/docs/versioned/next/implementationPlans/upgrade-guides-and-skill.md +1 -0
  51. package/dist/docs/versioned/next/implementationPlans/web-ssr-and-admin-spa.md +1 -0
  52. package/dist/docs/versioned/next/reference/README.md +5 -0
  53. package/dist/docs/versioned/next/reference/admin-spa.md +130 -0
  54. package/dist/docs/versioned/next/reference/ai.md +519 -0
  55. package/dist/docs/versioned/next/reference/comms.md +132 -0
  56. package/dist/docs/versioned/next/reference/environment-variables.md +229 -382
  57. package/dist/docs/versioned/next/reference/test.md +108 -0
  58. package/dist/docs/versioned/next/roadmap.md +9 -0
  59. package/dist/docs/versioned/next/tasks/README.md +42 -0
  60. package/dist/docs/versioned/next/tasks/agentic-sdlc-plugin.md +5 -5
  61. package/dist/docs/versioned/next/tasks/billing-stripe.md +75 -0
  62. package/dist/docs/versioned/next/tasks/comms-abstraction.md +90 -0
  63. package/dist/docs/versioned/next/tasks/comms-adapter-expo-push.md +29 -0
  64. package/dist/docs/versioned/next/tasks/comms-adapter-sendgrid.md +39 -0
  65. package/dist/docs/versioned/next/tasks/comms-adapter-twilio-sms.md +39 -0
  66. package/dist/docs/versioned/next/tasks/comms-adapter-twilio-verify.md +19 -0
  67. package/dist/docs/versioned/next/tasks/comms-admin-dashboard.md +52 -0
  68. package/dist/docs/versioned/next/tasks/deploy-to-gcp.md +11 -11
  69. package/dist/docs/versioned/next/tasks/deployment-foundation.md +12 -12
  70. package/dist/docs/versioned/next/tasks/docs-reference-coverage.md +4 -4
  71. package/dist/docs/versioned/next/tasks/infra-mcp.md +43 -0
  72. package/dist/docs/versioned/next/tasks/migrate-cicd-to-circleci.md +215 -0
  73. package/dist/docs/versioned/next/tasks/native-module-baseline.md +42 -0
  74. package/dist/docs/versioned/next/tasks/orgs-and-teams.md +70 -0
  75. package/dist/docs/versioned/next/tasks/oss-governance-baseline.md +18 -18
  76. package/dist/docs/versioned/next/tasks/password-reset-and-email-verification.md +60 -0
  77. package/dist/docs/versioned/next/tasks/positioning-django-rails-universal.md +4 -4
  78. package/dist/docs/versioned/next/tasks/public-roadmap-github.md +15 -15
  79. package/package.json +4 -3
  80. package/src/docs/templates/bootstrap/backend/types/models/userTypes.template.md +5 -4
  81. package/src/docs/templates/tools/model.template.md +4 -2
  82. package/src/docs/upgrades/0.31.0.md +60 -0
  83. package/src/docs/upgrades/56.0.0-beta.2.md +59 -0
  84. package/src/docs/versioned/next/README.md +1 -0
  85. package/src/docs/versioned/next/explanation/README.md +7 -1
  86. package/src/docs/versioned/next/explanation/deployment-architecture-gcp.md +65 -0
  87. package/src/docs/versioned/next/explanation/deployment-baseline.md +78 -0
  88. package/src/docs/versioned/next/explanation/positioning.md +164 -0
  89. package/src/docs/versioned/next/explanation/repository-settings.md +44 -0
  90. package/src/docs/versioned/next/explanation/roadmap-process.md +330 -0
  91. package/src/docs/versioned/next/explanation/roadmap-seed-issues.md +887 -0
  92. package/src/docs/versioned/next/how-to/README.md +8 -0
  93. package/src/docs/versioned/next/how-to/build-for-web.md +69 -0
  94. package/src/docs/versioned/next/how-to/deploy-backend-to-cloud-run.md +115 -0
  95. package/src/docs/versioned/next/how-to/deploy-to-gcp.md +20 -228
  96. package/src/docs/versioned/next/how-to/deploy-web-to-gcs-cdn.md +183 -0
  97. package/src/docs/versioned/next/implementationPlans/PLAN_INDEX.md +31 -0
  98. package/src/docs/versioned/next/implementationPlans/README.md +56 -30
  99. package/src/docs/versioned/next/implementationPlans/agentic-sdlc-plugin.md +2 -1
  100. package/src/docs/versioned/next/implementationPlans/ai-dev-loop-boost.md +1 -0
  101. package/src/docs/versioned/next/implementationPlans/b2b-platform-program.md +115 -0
  102. package/src/docs/versioned/next/implementationPlans/billing-stripe.md +158 -0
  103. package/src/docs/versioned/next/implementationPlans/build-terreno-app-validation.md +1 -0
  104. package/src/docs/versioned/next/implementationPlans/comms-abstraction.md +323 -0
  105. package/src/docs/versioned/next/implementationPlans/comms-adapter-expo-push.md +107 -0
  106. package/src/docs/versioned/next/implementationPlans/comms-adapter-sendgrid.md +157 -0
  107. package/src/docs/versioned/next/implementationPlans/comms-adapter-twilio-sms.md +155 -0
  108. package/src/docs/versioned/next/implementationPlans/comms-adapter-twilio-verify.md +99 -0
  109. package/src/docs/versioned/next/implementationPlans/comms-admin-dashboard.md +180 -0
  110. package/src/docs/versioned/next/implementationPlans/deploy-to-gcp.md +1 -0
  111. package/src/docs/versioned/next/implementationPlans/deploy-to-vercel.md +1 -0
  112. package/src/docs/versioned/next/implementationPlans/deployment-foundation.md +1 -0
  113. package/src/docs/versioned/next/implementationPlans/docs-reference-coverage.md +1 -0
  114. package/src/docs/versioned/next/implementationPlans/docs-tutorials-ai-first.md +1 -0
  115. package/src/docs/versioned/next/implementationPlans/examples-demo-coverage.md +1 -0
  116. package/src/docs/versioned/next/implementationPlans/infra-mcp-research.md +188 -0
  117. package/src/docs/versioned/next/implementationPlans/infra-mcp.md +269 -0
  118. package/src/docs/versioned/next/implementationPlans/migrate-cicd-to-circleci-research.md +126 -0
  119. package/src/docs/versioned/next/implementationPlans/migrate-cicd-to-circleci.md +269 -0
  120. package/src/docs/versioned/next/implementationPlans/native-module-baseline.md +105 -0
  121. package/src/docs/versioned/next/implementationPlans/orgs-and-teams.md +158 -0
  122. package/src/docs/versioned/next/implementationPlans/oss-governance-baseline.md +1 -0
  123. package/src/docs/versioned/next/implementationPlans/password-reset-and-email-verification.md +147 -0
  124. package/src/docs/versioned/next/implementationPlans/positioning-django-rails-universal.md +1 -0
  125. package/src/docs/versioned/next/implementationPlans/public-roadmap-github.md +1 -0
  126. package/src/docs/versioned/next/implementationPlans/upgrade-guides-and-skill.md +1 -0
  127. package/src/docs/versioned/next/implementationPlans/web-ssr-and-admin-spa.md +1 -0
  128. package/src/docs/versioned/next/reference/README.md +5 -0
  129. package/src/docs/versioned/next/reference/admin-spa.md +130 -0
  130. package/src/docs/versioned/next/reference/ai.md +519 -0
  131. package/src/docs/versioned/next/reference/comms.md +132 -0
  132. package/src/docs/versioned/next/reference/environment-variables.md +229 -382
  133. package/src/docs/versioned/next/reference/test.md +108 -0
  134. package/src/docs/versioned/next/roadmap.md +9 -0
  135. package/src/docs/versioned/next/tasks/README.md +42 -0
  136. package/src/docs/versioned/next/tasks/agentic-sdlc-plugin.md +5 -5
  137. package/src/docs/versioned/next/tasks/billing-stripe.md +75 -0
  138. package/src/docs/versioned/next/tasks/comms-abstraction.md +90 -0
  139. package/src/docs/versioned/next/tasks/comms-adapter-expo-push.md +29 -0
  140. package/src/docs/versioned/next/tasks/comms-adapter-sendgrid.md +39 -0
  141. package/src/docs/versioned/next/tasks/comms-adapter-twilio-sms.md +39 -0
  142. package/src/docs/versioned/next/tasks/comms-adapter-twilio-verify.md +19 -0
  143. package/src/docs/versioned/next/tasks/comms-admin-dashboard.md +52 -0
  144. package/src/docs/versioned/next/tasks/deploy-to-gcp.md +11 -11
  145. package/src/docs/versioned/next/tasks/deployment-foundation.md +12 -12
  146. package/src/docs/versioned/next/tasks/docs-reference-coverage.md +4 -4
  147. package/src/docs/versioned/next/tasks/infra-mcp.md +43 -0
  148. package/src/docs/versioned/next/tasks/migrate-cicd-to-circleci.md +215 -0
  149. package/src/docs/versioned/next/tasks/native-module-baseline.md +42 -0
  150. package/src/docs/versioned/next/tasks/orgs-and-teams.md +70 -0
  151. package/src/docs/versioned/next/tasks/oss-governance-baseline.md +18 -18
  152. package/src/docs/versioned/next/tasks/password-reset-and-email-verification.md +60 -0
  153. package/src/docs/versioned/next/tasks/positioning-django-rails-universal.md +4 -4
  154. 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
- ## 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)
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)