@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
@@ -0,0 +1,65 @@
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
@@ -0,0 +1,78 @@
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`).
@@ -0,0 +1,164 @@
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
+ ```
@@ -0,0 +1,44 @@
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