@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
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
# 0.31.0
|
|
2
|
-
|
|
3
|
-
Terreno packages move in lockstep. Nothing in this release removes or renames a public
|
|
4
|
-
export, so most apps upgrade by bumping the `@terreno/*` versions and running:
|
|
5
|
-
|
|
6
|
-
- `bun run compile` and `bun run lint` at the repo root
|
|
7
|
-
- `cd <your frontend> && bun run sdk` after any `@terreno/api` route or model surface change
|
|
8
|
-
|
|
9
|
-
## Mongoose 9 is now supported (Mongoose 8 still works)
|
|
10
|
-
|
|
11
|
-
Every published package that talks to Mongoose (`api`, `test`, `admin-backend`, `ai`,
|
|
12
|
-
`feature-flags`) widened its peer dependency to `^8.0.0 || ^9.0.0`. Terreno itself
|
|
13
|
-
develops against Mongoose 9.7.4.
|
|
14
|
-
|
|
15
|
-
You can stay on Mongoose 8 with no changes. If you upgrade your app to Mongoose 9, the
|
|
16
|
-
changes that mattered inside Terreno will most likely matter in your code too:
|
|
17
|
-
|
|
18
|
-
```typescript
|
|
19
|
-
// Before (Mongoose 8)
|
|
20
|
-
await Model.findOneAndUpdate(filter, update, {new: true});
|
|
21
|
-
|
|
22
|
-
// After (Mongoose 9)
|
|
23
|
-
await Model.findOneAndUpdate(filter, update, {returnDocument: "after"});
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
- Aggregation-pipeline updates must pass `updatePipeline: true` to `updateMany`.
|
|
27
|
-
- Query middleware no longer takes the legacy `next()` callback — use the async form.
|
|
28
|
-
- Array schema paths expose `getEmbeddedSchemaType()`; the private `caster` property is gone.
|
|
29
|
-
- Mongoose 9 ships its own types, so `@types/mongodb` and
|
|
30
|
-
`@types/passport-local-mongoose` should be removed from your dev dependencies.
|
|
31
|
-
- Pin `bson` to `7.2.0` if your lockfile resolves an older copy alongside Mongoose 9.
|
|
32
|
-
|
|
33
|
-
Mongoose 9 requires Node >= 20.19.0. Terreno's root `package.json` now declares that
|
|
34
|
-
engine range for local development.
|
|
35
|
-
|
|
36
|
-
## `@terreno/api` type changes
|
|
37
|
-
|
|
38
|
-
Both changes widen or relax types; they are source-compatible for normal usage, but
|
|
39
|
-
explicit annotations may need updating:
|
|
40
|
-
|
|
41
|
-
- `modelRouter` now accepts `Model<T, any, any, any, any, any>` instead of `Model<T>`,
|
|
42
|
-
so models with custom query helpers, methods, or virtuals no longer need a cast.
|
|
43
|
-
- `findOneOrNoneFor(model, query)` takes `ModelQuery<T>` (a partial record keyed by the
|
|
44
|
-
document fields) instead of Mongoose's `FilterQuery<T>`. If you were building a
|
|
45
|
-
`FilterQuery<T>` value to pass in, it still works; if you were annotating the variable
|
|
46
|
-
as `FilterQuery<T>` and relying on operator typing, switch to `ModelQuery<T>`.
|
|
47
|
-
|
|
48
|
-
## `@terreno/admin-backend` array field metadata
|
|
49
|
-
|
|
50
|
-
`GET /admin/config` derives array item metadata (`itemType`, `itemRef`, `itemEnum`) from
|
|
51
|
-
Mongoose's public `getEmbeddedSchemaType()` when available, falling back to the Mongoose 8
|
|
52
|
-
`caster` shape. `itemEnum` is only emitted when the embedded enum is an array, so an enum
|
|
53
|
-
declared as an object map no longer produces a malformed `itemEnum`. Admin clients that
|
|
54
|
-
read `itemEnum` should treat it as optional.
|
|
55
|
-
|
|
56
|
-
## License changed from Apache-2.0 to MIT
|
|
57
|
-
|
|
58
|
-
All published `@terreno/*` packages are now MIT licensed and ship a `LICENSE` file in the
|
|
59
|
-
package tarball. No code change is required; update any license inventory or attribution
|
|
60
|
-
list that pinned Terreno as Apache-2.0.
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
# GCP deployment architecture
|
|
2
|
-
|
|
3
|
-
Reference topology for hosting a Terreno full-stack app on Google Cloud Platform.
|
|
4
|
-
|
|
5
|
-
This page is conceptual — commands live in the [how-to guides](../how-to/deploy-to-gcp.md).
|
|
6
|
-
|
|
7
|
-
## Topology
|
|
8
|
-
|
|
9
|
-
```mermaid
|
|
10
|
-
flowchart TD
|
|
11
|
-
U["User<br/>iOS / Android / Web"]
|
|
12
|
-
CDN["Cloud CDN + GCS bucket<br/>expo export -p web output"]
|
|
13
|
-
CR["Cloud Run<br/>@terreno/api backend"]
|
|
14
|
-
SM["Secret Manager<br/>auth secrets, MONGO_URI"]
|
|
15
|
-
AT["MongoDB Atlas<br/>replica set (change streams)"]
|
|
16
|
-
GCS["GCS bucket<br/>user file uploads"]
|
|
17
|
-
AR["Artifact Registry<br/>backend image"]
|
|
18
|
-
U -->|"web"| CDN
|
|
19
|
-
U -->|"native app"| CR
|
|
20
|
-
CDN -->|"API calls"| CR
|
|
21
|
-
CR --> SM
|
|
22
|
-
CR --> AT
|
|
23
|
-
CR --> GCS
|
|
24
|
-
AR --> CR
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Component responsibilities
|
|
28
|
-
|
|
29
|
-
| Component | Role |
|
|
30
|
-
|-----------|------|
|
|
31
|
-
| **Artifact Registry** | Stores versioned backend container images built from `example-backend/Dockerfile` |
|
|
32
|
-
| **Cloud Run** | Runs the long-lived `@terreno/api` process (HTTP + Socket.io) |
|
|
33
|
-
| **Secret Manager** | Holds `MONGO_URI`, JWT secrets, and other credentials — mounted as env vars |
|
|
34
|
-
| **MongoDB Atlas** | Primary database; must be a replica set for change streams (realtime, feature flags) |
|
|
35
|
-
| **GCS (web bucket)** | Serves static web export; CDN caches at the edge |
|
|
36
|
-
| **GCS (uploads bucket)** | Private object storage for user uploads via `@terreno/api` file plugins |
|
|
37
|
-
|
|
38
|
-
## Why Cloud Run (not App Engine or GKE)
|
|
39
|
-
|
|
40
|
-
| Option | Tradeoff |
|
|
41
|
-
|--------|----------|
|
|
42
|
-
| **Cloud Run** | Pay-per-use, minimal ops, supports WebSockets with session affinity — fits Terreno's socket + HTTP model |
|
|
43
|
-
| **App Engine** | Similar serverless model but less flexible for custom containers and long timeouts |
|
|
44
|
-
| **GKE** | Full control but requires cluster management — overkill for a single Terreno backend |
|
|
45
|
-
|
|
46
|
-
## Why Atlas (not self-hosted Mongo on GCP)
|
|
47
|
-
|
|
48
|
-
| Option | Tradeoff |
|
|
49
|
-
|--------|----------|
|
|
50
|
-
| **MongoDB Atlas** | Managed replica sets, backups, and change streams out of the box |
|
|
51
|
-
| **Self-hosted on Compute Engine** | You operate replica set elections, backups, and upgrades — documented as out of scope for launch |
|
|
52
|
-
|
|
53
|
-
## Static web vs server-rendered
|
|
54
|
-
|
|
55
|
-
| Approach | Tradeoff |
|
|
56
|
-
|----------|----------|
|
|
57
|
-
| **GCS + CDN (static export)** | Cheapest, simplest, works today with Expo `single`/`static` output — no SSR or API routes |
|
|
58
|
-
| **Node/Bun server (SSR)** | Better SEO and API routes — requires Expo SDK ≥ 55; not available in the current `~54` catalog |
|
|
59
|
-
|
|
60
|
-
Native iOS and Android apps call Cloud Run directly; only the web client uses the CDN origin.
|
|
61
|
-
|
|
62
|
-
## Related
|
|
63
|
-
|
|
64
|
-
- [Deployment baseline](deployment-baseline.md) — seven requirements every host must satisfy
|
|
65
|
-
- [Deploy to GCP](../how-to/deploy-to-gcp.md) — step-by-step guides
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
# Deployment baseline
|
|
2
|
-
|
|
3
|
-
Every Terreno production deployment needs the same seven foundations. Provider guides ([Deploy to GCP](../how-to/deploy-to-gcp.md), future Vercel guide) map these to specific platforms; this page names them once.
|
|
4
|
-
|
|
5
|
-
See also the [environment variables reference](../reference/environment-variables.md).
|
|
6
|
-
|
|
7
|
-
## Seven baseline requirements
|
|
8
|
-
|
|
9
|
-
| # | Requirement | Why Terreno needs it | When missing |
|
|
10
|
-
|---|-------------|----------------------|--------------|
|
|
11
|
-
| 1 | **MongoDB replica set** | Change streams power realtime and live feature-flag updates | Startup logs: `FeatureFlag.watch() failed — live updates require MongoDB as a replica set` (`feature-flags/src/featureFlagsApp.ts`) |
|
|
12
|
-
| 2 | **Auth secrets** | JWT signing and sessions (or Better Auth encryption) | Login fails; tokens rejected |
|
|
13
|
-
| 3 | **Long-lived backend process** | Socket.io connections are not request/response | Websockets drop on platforms with short request timeouts or aggressive scale-to-zero |
|
|
14
|
-
| 4 | **Correct origins** | CORS and Better Auth `trustedOrigins` must include your web and native schemes | Browser: blocked by CORS; native: auth redirects fail |
|
|
15
|
-
| 5 | **Build-time client config** | `EXPO_PUBLIC_*` values are inlined into the web bundle at build time | API calls go to `undefined` or localhost after deploy — see [Build for web](../how-to/build-for-web.md) |
|
|
16
|
-
| 6 | **Health endpoint** | Load balancers and orchestrators need readiness probes | Platform marks the service unhealthy and stops routing traffic |
|
|
17
|
-
| 7 | **Durable file storage** | Uploads must not live on ephemeral container disk | Files disappear on restart; use GCS/S3 and credentials |
|
|
18
|
-
|
|
19
|
-
Requirements **1**, **3**, and **5** are the ones teams miss most often.
|
|
20
|
-
|
|
21
|
-
### Symptom details
|
|
22
|
-
|
|
23
|
-
**1 — Standalone MongoDB**
|
|
24
|
-
|
|
25
|
-
Terreno's feature-flag plugin opens a change stream on startup. Without a replica set, live flag sync is disabled and logs:
|
|
26
|
-
|
|
27
|
-
```text
|
|
28
|
-
[feature-flags] FeatureFlag.watch() failed — live updates require MongoDB as a replica set (even single-node).
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
Use [MongoDB Atlas](https://www.mongodb.com/atlas) or a single-node replica set for development.
|
|
32
|
-
|
|
33
|
-
**3 — Short-lived serverless timeouts**
|
|
34
|
-
|
|
35
|
-
The RTK/socket client enables reconnection (`reconnection: true`, `reconnectionAttempts: 5` in `rtk/src/socket.ts`). When the backend drops idle connections (for example Cloud Run's default 300s request timeout), clients reconnect but realtime state may lag until the new socket attaches.
|
|
36
|
-
|
|
37
|
-
**5 — Build-time API URL**
|
|
38
|
-
|
|
39
|
-
If you set `EXPO_PUBLIC_API_URL` only at runtime on the static host, the bundle still contains whatever was present at `bun run export` time — often `http://localhost:4000`. The browser then fails network requests against localhost.
|
|
40
|
-
|
|
41
|
-
## Web output modes
|
|
42
|
-
|
|
43
|
-
Expo Router supports three web output modes. The choice determines hosting options.
|
|
44
|
-
|
|
45
|
-
| Mode | Output | API routes | SSR | Hosting | Terreno status |
|
|
46
|
-
|------|--------|-----------|-----|---------|----------------|
|
|
47
|
-
| `single` | One `index.html` SPA | No | No | Any static host | **Current default** |
|
|
48
|
-
| `static` | Per-route HTML files | No | No | Any static host | Available; better SEO |
|
|
49
|
-
| `server` | `dist/client` + `dist/server` | Yes | Yes (alpha, SDK ≥ 55) | Node/Bun/edge runtime | Not yet — repo catalog is Expo `~54.0.29`; see [Web SSR and admin SPA](https://github.com/FlourishHealth/terreno/blob/master/docs/implementationPlans/web-ssr-and-admin-spa.md) |
|
|
50
|
-
|
|
51
|
-
## Multi-environment checklist
|
|
52
|
-
|
|
53
|
-
Staging and production differ in these values (each environment needs its **own web build** because of `EXPO_PUBLIC_API_URL`):
|
|
54
|
-
|
|
55
|
-
| Item | Where to configure |
|
|
56
|
-
|------|-------------------|
|
|
57
|
-
| Secret values | Platform secret store / Secret Manager |
|
|
58
|
-
| `MONGO_URI` | Separate cluster or database per environment |
|
|
59
|
-
| `EXPO_PUBLIC_API_URL` | Set before `bun run export` — one build per environment |
|
|
60
|
-
| `corsOrigin` | `setupServer({ corsOrigin })` in backend |
|
|
61
|
-
| Better Auth `trustedOrigins` + `BETTER_AUTH_URL` | Better Auth config / env |
|
|
62
|
-
| Feature-flag defaults | MongoDB documents or seed scripts |
|
|
63
|
-
|
|
64
|
-
## Containerizing the backend
|
|
65
|
-
|
|
66
|
-
The canonical Dockerfile is [`example-backend/Dockerfile`](https://github.com/FlourishHealth/terreno/blob/master/example-backend/Dockerfile). It:
|
|
67
|
-
|
|
68
|
-
1. Installs workspace dependencies and compiles packages in dependency order.
|
|
69
|
-
2. Builds a Bun-compiled binary for production.
|
|
70
|
-
3. Runs as a non-root user and exposes `/health` via `@terreno/api-health`.
|
|
71
|
-
|
|
72
|
-
Three details consumers get wrong:
|
|
73
|
-
|
|
74
|
-
- **`PORT`** — Cloud Run and other platforms assign the listen port via `PORT`. Terreno reads `process.env.PORT` in `api/src/terrenoApp.ts` (default `9000` if unset).
|
|
75
|
-
- **Non-root** — Do not run the container as root in production.
|
|
76
|
-
- **Compile order** — Workspace packages (`@terreno/api`, `@terreno/test`, etc.) must compile before the example backend bundles.
|
|
77
|
-
|
|
78
|
-
CI builds the image on every PR that touches backend paths (`.github/workflows/example-backend-docker.yml`).
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
# Positioning
|
|
2
|
-
|
|
3
|
-
This is the single source of truth for how Terreno describes itself. The problem
|
|
4
|
-
this page exists to fix is drift: the README, the docs landing page, `AGENTS.md`,
|
|
5
|
-
and the npm package descriptions have historically said different things, so a
|
|
6
|
-
visitor's impression of Terreno depended on which door they walked through.
|
|
7
|
-
|
|
8
|
-
The rule is simple: **write the wording once, here, then reuse it verbatim
|
|
9
|
-
everywhere else.** Do not paraphrase per surface.
|
|
10
|
-
|
|
11
|
-
## Canonical copy blocks
|
|
12
|
-
|
|
13
|
-
Copy these blocks exactly. They are in fenced code blocks so they can be lifted
|
|
14
|
-
without markdown-rendering surprises.
|
|
15
|
-
|
|
16
|
-
### `tagline`
|
|
17
|
-
|
|
18
|
-
Used by: README H1 subtitle, docs site `tagline`, npm `description` prefix.
|
|
19
|
-
|
|
20
|
-
```
|
|
21
|
-
Terreno is Django/Rails for TypeScript — with universal app support.
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
### `elevator`
|
|
25
|
-
|
|
26
|
-
Used by: README intro, docs landing intro, package READMEs.
|
|
27
|
-
|
|
28
|
-
```
|
|
29
|
-
Terreno is Django/Rails for TypeScript — a batteries-included, full-stack
|
|
30
|
-
framework where the undifferentiated 80% of an app is already written. On the
|
|
31
|
-
backend you get Mongoose models, auto-generated REST APIs, permissions, an admin
|
|
32
|
-
panel, authentication, and an AI service. On the frontend you get one universal
|
|
33
|
-
app — a single React Native codebase that ships to iOS, Android, and web. It is
|
|
34
|
-
built to be driven by AI coding agents from the first prompt to a production
|
|
35
|
-
deploy.
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
### `pillars`
|
|
39
|
-
|
|
40
|
-
Used by: README, docs landing, `AGENTS.md`. Keep the order.
|
|
41
|
-
|
|
42
|
-
```
|
|
43
|
-
- Batteries included — auth, CRUD APIs, admin, permissions, AI, realtime,
|
|
44
|
-
feature flags, and consent are already built, so your code is business logic.
|
|
45
|
-
- Universal by default — one React Native codebase ships to iOS, Android, and
|
|
46
|
-
web. Not a web framework with a mobile bolt-on.
|
|
47
|
-
- AI-native — agents are a first-class client of the framework, not an
|
|
48
|
-
afterthought.
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### `aiPillar`
|
|
52
|
-
|
|
53
|
-
Used wherever the AI-native pillar gets more than a bullet. It must always name
|
|
54
|
-
**both** layers (see language rule 5).
|
|
55
|
-
|
|
56
|
-
```
|
|
57
|
-
Terreno's AI-native story has two layers. The tool layer is a Model Context
|
|
58
|
-
Protocol (MCP) server that gives coding agents codegen, documentation search,
|
|
59
|
-
and component reference for the framework's conventions. The process layer is the
|
|
60
|
-
`/terreno-*` SDLC pipeline — plan, implement test-first, verify in a fresh
|
|
61
|
-
context, submit with evidence, then own the review loop — which today runs inside
|
|
62
|
-
the Terreno repository while its consumer-installable packaging is finished.
|
|
63
|
-
Django gives you `manage.py startapp`; Terreno is building a reviewed path from a
|
|
64
|
-
request to a mergeable pull request.
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
> **Portability gate (do not remove until cleared).** The `/terreno-*` pipeline
|
|
68
|
-
> is not yet verified to run in a consumer application — that is
|
|
69
|
-
> [`agentic-sdlc-plugin`](../implementationPlans/agentic-sdlc-plugin.md) Task 2.5,
|
|
70
|
-
> which is still open. Until it passes, describe the pipeline as in-progress
|
|
71
|
-
> packaging (as the `aiPillar` block above does) and never imply a consumer can
|
|
72
|
-
> install and run it today. When Task 2.5 passes, update the `aiPillar` block to
|
|
73
|
-
> claim the pipeline as consumer-ready.
|
|
74
|
-
|
|
75
|
-
### `pitch`
|
|
76
|
-
|
|
77
|
-
Used by: blog post intros, conference abstracts, social. ~150 words.
|
|
78
|
-
|
|
79
|
-
```
|
|
80
|
-
Every app needs the same foundation: authentication, user management, CRUD APIs,
|
|
81
|
-
an admin panel, permissions, realtime updates, feature flags, and AI. That work
|
|
82
|
-
is weeks of undifferentiated effort, and it is the same in every product.
|
|
83
|
-
|
|
84
|
-
Terreno is Django/Rails for TypeScript. Define a Mongoose model, register it, and
|
|
85
|
-
you have a permissioned REST API with pagination, filtering, and an OpenAPI spec.
|
|
86
|
-
Add the admin package and you have a working admin panel. Your app is left with
|
|
87
|
-
the part that is actually yours: the business logic.
|
|
88
|
-
|
|
89
|
-
The difference from Django or Rails is universal apps — one React Native codebase
|
|
90
|
-
ships to iOS, Android, and web — and being AI-native. Agents are a first-class
|
|
91
|
-
client: an MCP server teaches them the conventions, and a reviewed SDLC pipeline
|
|
92
|
-
takes a request to a mergeable pull request. You build with AI from the first
|
|
93
|
-
prompt to production.
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
## Why the Django/Rails analogy
|
|
97
|
-
|
|
98
|
-
Django and Rails won by deciding that the generic parts of a web app — the ORM,
|
|
99
|
-
the router, the admin, auth — belong in the framework, not in every project. They
|
|
100
|
-
are opinionated, batteries-included, and productive because of it. Terreno makes
|
|
101
|
-
the same bet for TypeScript: the generic 80% of an app lives in the framework so
|
|
102
|
-
your codebase is the 20% that is unique to your product.
|
|
103
|
-
|
|
104
|
-
The analogy earns two honest caveats. First, Terreno targets a document store
|
|
105
|
-
(MongoDB via Mongoose), not a relational ORM, and it has no migrations framework.
|
|
106
|
-
Second, it is younger — several Django/Rails staples (background jobs,
|
|
107
|
-
server-side rendering, role-based access control) are not shipped yet. The
|
|
108
|
-
comparison table below is deliberately straight about where the analogy holds and
|
|
109
|
-
where it does not; being honest about the gaps is what makes the analogy credible
|
|
110
|
-
rather than marketing.
|
|
111
|
-
|
|
112
|
-
The two things Django and Rails do not give you, and Terreno does, are **universal
|
|
113
|
-
apps** (one codebase for iOS, Android, and web) and being **AI-native** by design.
|
|
114
|
-
|
|
115
|
-
## Comparison table
|
|
116
|
-
|
|
117
|
-
Every "shipped" row cites where the feature lives in the source. Every "not
|
|
118
|
-
shipped" row links the implementation plan or roadmap item that tracks it.
|
|
119
|
-
|
|
120
|
-
| Django / Rails concept | Terreno equivalent | Honest caveat |
|
|
121
|
-
|------------------------|--------------------|----------------|
|
|
122
|
-
| Models + ORM | Mongoose schemas + `@terreno/api` plugins (`api/src/plugins.ts`) | Document store, not relational; no migrations framework (see the Migrations row) |
|
|
123
|
-
| `ModelViewSet` / scaffolds | `modelRouter` (`api/src/api.ts`) | REST only; no GraphQL |
|
|
124
|
-
| Django admin | `@terreno/admin-backend` + `@terreno/admin-frontend` / `@terreno/admin-spa` | Younger; the parity gap is tracked in [`admin-ui-v2-django-parity`](../implementationPlans/admin-ui-v2-django-parity.md) |
|
|
125
|
-
| Auth + permissions | Better Auth (`api/src/betterAuthApp.ts`) + `Permissions` (`api/src/permissions.ts`) | Fine-grained RBAC is in progress ([`rbac-permissions`](../implementationPlans/rbac-permissions.md)) |
|
|
126
|
-
| Templates / views | `@terreno/ui` components — one universal codebase for iOS, Android, and web | Server-side rendering for web is not shipped yet ([`web-ssr-and-admin-spa`](../implementationPlans/web-ssr-and-admin-spa.md)) |
|
|
127
|
-
| `manage.py` / generators | MCP server tools — the *tool* layer (`mcp-server/src/tools.ts`) + the `/terreno-*` SDLC pipeline — the *process* layer (`plugins/terreno-planning/skills/`) | Agent-driven rather than CLI-driven; the pipeline is not yet packaged for consumer apps ([`agentic-sdlc-plugin`](../implementationPlans/agentic-sdlc-plugin.md) Task 2.5) |
|
|
128
|
-
| Celery / ActiveJob (background jobs) | Not shipped | On the [roadmap](../../ROADMAP.md) |
|
|
129
|
-
| Migrations | No migrations framework | Schema evolution is convention plus the `mongoose-schema-safety` skill (`.claude/skills/mongoose-schema-safety/`) |
|
|
130
|
-
|
|
131
|
-
## Language rules
|
|
132
|
-
|
|
133
|
-
Every doc, README, landing page, and agent-facing surface follows these rules.
|
|
134
|
-
|
|
135
|
-
1. **Lead with the analogy.** Say "Django/Rails for TypeScript" within the first
|
|
136
|
-
two sentences of the README and the docs landing page.
|
|
137
|
-
2. **Say "universal app,"** not "cross-platform" and not "React Native app," when
|
|
138
|
-
describing the frontend. It is one codebase that ships to iOS, Android, and
|
|
139
|
-
web.
|
|
140
|
-
3. **Never claim an unshipped feature as available.** If a capability is on the
|
|
141
|
-
roadmap or tracked by an open IP, say so. Grep the package source before
|
|
142
|
-
writing that something ships.
|
|
143
|
-
4. **Keep superlatives off reference pages.** "The best framework for X" belongs
|
|
144
|
-
on the landing page and the pitch, never in reference documentation.
|
|
145
|
-
5. **Never describe one AI layer without the other.** The tool layer (MCP server)
|
|
146
|
-
and the process layer (`/terreno-*` pipeline) are always named together, and
|
|
147
|
-
the pipeline is described honestly per the portability gate above.
|
|
148
|
-
|
|
149
|
-
## Repository metadata (maintainer action)
|
|
150
|
-
|
|
151
|
-
The GitHub repository description and topics cannot be set from a commit. A
|
|
152
|
-
maintainer must set them in **Settings → General** and the **About** panel.
|
|
153
|
-
|
|
154
|
-
**Description** (the short tagline variant):
|
|
155
|
-
|
|
156
|
-
```
|
|
157
|
-
Django/Rails for TypeScript, with universal iOS/Android/web apps.
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
**Topics:**
|
|
161
|
-
|
|
162
|
-
```
|
|
163
|
-
typescript, react-native, expo, express, mongoose, framework, mcp, ai, universal-apps, full-stack
|
|
164
|
-
```
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
# Repository settings (maintainers)
|
|
2
|
-
|
|
3
|
-
Some GitHub settings cannot be committed to the repo. Enable these manually in
|
|
4
|
-
the [Terreno repository settings](https://github.com/FlourishHealth/terreno/settings).
|
|
5
|
-
|
|
6
|
-
## Discussions
|
|
7
|
-
|
|
8
|
-
**Path:** Settings → General → Features → Discussions
|
|
9
|
-
|
|
10
|
-
Enable Discussions and create these categories (see
|
|
11
|
-
[public roadmap IP](../implementationPlans/public-roadmap-github.md) for
|
|
12
|
-
descriptions):
|
|
13
|
-
|
|
14
|
-
1. Announcements (maintainers only)
|
|
15
|
-
2. Q&A
|
|
16
|
-
3. Ideas
|
|
17
|
-
4. Agents & AI
|
|
18
|
-
5. RFCs
|
|
19
|
-
6. Show and tell
|
|
20
|
-
7. Docs feedback
|
|
21
|
-
|
|
22
|
-
## Security
|
|
23
|
-
|
|
24
|
-
**Path:** Settings → Security → Code security and analysis
|
|
25
|
-
|
|
26
|
-
- Enable **Private vulnerability reporting** (GitHub PVR as the primary channel;
|
|
27
|
-
`security@terreno.app` is the email fallback — see [SECURITY.md](../../SECURITY.md))
|
|
28
|
-
|
|
29
|
-
## Branch protection (`master`)
|
|
30
|
-
|
|
31
|
-
**Path:** Settings → Branches → Branch protection rules → `master`
|
|
32
|
-
|
|
33
|
-
- Require a pull request before merging
|
|
34
|
-
- Require status checks to pass (include Repository policies, package CI, and
|
|
35
|
-
Rulesync Check jobs relevant to the change)
|
|
36
|
-
- Require branches to be up to date before merging
|
|
37
|
-
- Do not allow bypassing the above settings
|
|
38
|
-
|
|
39
|
-
## Merge settings
|
|
40
|
-
|
|
41
|
-
**Path:** Settings → General → Pull Requests
|
|
42
|
-
|
|
43
|
-
- Allow **squash merging** only (disable merge commits and rebase merging)
|
|
44
|
-
- Enable **Automatically delete head branches** after merge
|