oneie 3.6.40 → 3.8.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.
Files changed (984) hide show
  1. package/README.md +28 -9
  2. package/dist/admin/build.d.ts +15 -0
  3. package/dist/admin/build.d.ts.map +1 -0
  4. package/dist/admin/build.js +295 -0
  5. package/dist/admin/build.js.map +1 -0
  6. package/dist/admin/index.d.ts +24 -0
  7. package/dist/admin/index.d.ts.map +1 -0
  8. package/dist/admin/index.js +98 -0
  9. package/dist/admin/index.js.map +1 -0
  10. package/dist/admin/list.d.ts +14 -0
  11. package/dist/admin/list.d.ts.map +1 -0
  12. package/dist/admin/list.js +90 -0
  13. package/dist/admin/list.js.map +1 -0
  14. package/dist/admin/manifest.d.ts +86 -0
  15. package/dist/admin/manifest.d.ts.map +1 -0
  16. package/dist/admin/manifest.js +183 -0
  17. package/dist/admin/manifest.js.map +1 -0
  18. package/dist/admin/monorepo.d.ts +25 -0
  19. package/dist/admin/monorepo.d.ts.map +1 -0
  20. package/dist/admin/monorepo.js +59 -0
  21. package/dist/admin/monorepo.js.map +1 -0
  22. package/dist/admin/release.d.ts +17 -0
  23. package/dist/admin/release.d.ts.map +1 -0
  24. package/dist/admin/release.js +144 -0
  25. package/dist/admin/release.js.map +1 -0
  26. package/dist/admin/sync.d.ts +14 -0
  27. package/dist/admin/sync.d.ts.map +1 -0
  28. package/dist/admin/sync.js +104 -0
  29. package/dist/admin/sync.js.map +1 -0
  30. package/dist/admin/validate.d.ts +15 -0
  31. package/dist/admin/validate.d.ts.map +1 -0
  32. package/dist/admin/validate.js +169 -0
  33. package/dist/admin/validate.js.map +1 -0
  34. package/dist/commands/agent.d.ts +2 -0
  35. package/dist/commands/agent.d.ts.map +1 -1
  36. package/dist/commands/agent.js +44 -0
  37. package/dist/commands/agent.js.map +1 -1
  38. package/dist/commands/ask.d.ts +4 -0
  39. package/dist/commands/ask.d.ts.map +1 -0
  40. package/dist/commands/ask.js +8 -0
  41. package/dist/commands/ask.js.map +1 -0
  42. package/dist/commands/bounty.d.ts +4 -0
  43. package/dist/commands/bounty.d.ts.map +1 -0
  44. package/dist/commands/bounty.js +24 -0
  45. package/dist/commands/bounty.js.map +1 -0
  46. package/dist/commands/capabilities.d.ts +4 -0
  47. package/dist/commands/capabilities.d.ts.map +1 -0
  48. package/dist/commands/capabilities.js +18 -0
  49. package/dist/commands/capabilities.js.map +1 -0
  50. package/dist/commands/claw.d.ts +4 -0
  51. package/dist/commands/claw.d.ts.map +1 -0
  52. package/dist/commands/claw.js +14 -0
  53. package/dist/commands/claw.js.map +1 -0
  54. package/dist/commands/commend.d.ts +4 -0
  55. package/dist/commands/commend.d.ts.map +1 -0
  56. package/dist/commands/commend.js +13 -0
  57. package/dist/commands/commend.js.map +1 -0
  58. package/dist/commands/completion.d.ts +4 -0
  59. package/dist/commands/completion.d.ts.map +1 -0
  60. package/dist/commands/completion.js +49 -0
  61. package/dist/commands/completion.js.map +1 -0
  62. package/dist/commands/config.d.ts +4 -0
  63. package/dist/commands/config.d.ts.map +1 -0
  64. package/dist/commands/config.js +78 -0
  65. package/dist/commands/config.js.map +1 -0
  66. package/dist/commands/deploy.d.ts +4 -0
  67. package/dist/commands/deploy.d.ts.map +1 -0
  68. package/dist/commands/deploy.js +10 -0
  69. package/dist/commands/deploy.js.map +1 -0
  70. package/dist/commands/doctor.d.ts +4 -0
  71. package/dist/commands/doctor.d.ts.map +1 -0
  72. package/dist/commands/doctor.js +72 -0
  73. package/dist/commands/doctor.js.map +1 -0
  74. package/dist/commands/export.d.ts +4 -0
  75. package/dist/commands/export.d.ts.map +1 -0
  76. package/dist/commands/export.js +15 -0
  77. package/dist/commands/export.js.map +1 -0
  78. package/dist/commands/fade.d.ts +4 -0
  79. package/dist/commands/fade.d.ts.map +1 -0
  80. package/dist/commands/fade.js +15 -0
  81. package/dist/commands/fade.js.map +1 -0
  82. package/dist/commands/flag.d.ts +4 -0
  83. package/dist/commands/flag.d.ts.map +1 -0
  84. package/dist/commands/flag.js +13 -0
  85. package/dist/commands/flag.js.map +1 -0
  86. package/dist/commands/forget.d.ts +4 -0
  87. package/dist/commands/forget.d.ts.map +1 -0
  88. package/dist/commands/forget.js +16 -0
  89. package/dist/commands/forget.js.map +1 -0
  90. package/dist/commands/frontier.d.ts +4 -0
  91. package/dist/commands/frontier.d.ts.map +1 -0
  92. package/dist/commands/frontier.js +11 -0
  93. package/dist/commands/frontier.js.map +1 -0
  94. package/dist/commands/health.d.ts +4 -0
  95. package/dist/commands/health.d.ts.map +1 -0
  96. package/dist/commands/health.js +11 -0
  97. package/dist/commands/health.js.map +1 -0
  98. package/dist/commands/highways.d.ts +4 -0
  99. package/dist/commands/highways.d.ts.map +1 -0
  100. package/dist/commands/highways.js +14 -0
  101. package/dist/commands/highways.js.map +1 -0
  102. package/dist/commands/hire.d.ts +4 -0
  103. package/dist/commands/hire.d.ts.map +1 -0
  104. package/dist/commands/hire.js +16 -0
  105. package/dist/commands/hire.js.map +1 -0
  106. package/dist/commands/init.d.ts.map +1 -1
  107. package/dist/commands/init.js +69 -42
  108. package/dist/commands/init.js.map +1 -1
  109. package/dist/commands/know.d.ts +4 -0
  110. package/dist/commands/know.d.ts.map +1 -0
  111. package/dist/commands/know.js +8 -0
  112. package/dist/commands/know.js.map +1 -0
  113. package/dist/commands/launch.d.ts +4 -0
  114. package/dist/commands/launch.d.ts.map +1 -0
  115. package/dist/commands/launch.js +16 -0
  116. package/dist/commands/launch.js.map +1 -0
  117. package/dist/commands/mark.d.ts +4 -0
  118. package/dist/commands/mark.d.ts.map +1 -0
  119. package/dist/commands/mark.js +15 -0
  120. package/dist/commands/mark.js.map +1 -0
  121. package/dist/commands/pay.d.ts +4 -0
  122. package/dist/commands/pay.d.ts.map +1 -0
  123. package/dist/commands/pay.js +21 -0
  124. package/dist/commands/pay.js.map +1 -0
  125. package/dist/commands/pipe.d.ts +4 -0
  126. package/dist/commands/pipe.d.ts.map +1 -0
  127. package/dist/commands/pipe.js +35 -0
  128. package/dist/commands/pipe.js.map +1 -0
  129. package/dist/commands/publish.d.ts +4 -0
  130. package/dist/commands/publish.d.ts.map +1 -0
  131. package/dist/commands/publish.js +23 -0
  132. package/dist/commands/publish.js.map +1 -0
  133. package/dist/commands/recall.d.ts +4 -0
  134. package/dist/commands/recall.d.ts.map +1 -0
  135. package/dist/commands/recall.js +12 -0
  136. package/dist/commands/recall.js.map +1 -0
  137. package/dist/commands/repl.d.ts +4 -0
  138. package/dist/commands/repl.d.ts.map +1 -0
  139. package/dist/commands/repl.js +56 -0
  140. package/dist/commands/repl.js.map +1 -0
  141. package/dist/commands/reveal.d.ts +4 -0
  142. package/dist/commands/reveal.d.ts.map +1 -0
  143. package/dist/commands/reveal.js +11 -0
  144. package/dist/commands/reveal.js.map +1 -0
  145. package/dist/commands/revenue.d.ts +4 -0
  146. package/dist/commands/revenue.d.ts.map +1 -0
  147. package/dist/commands/revenue.js +11 -0
  148. package/dist/commands/revenue.js.map +1 -0
  149. package/dist/commands/select.d.ts +4 -0
  150. package/dist/commands/select.d.ts.map +1 -0
  151. package/dist/commands/select.js +19 -0
  152. package/dist/commands/select.js.map +1 -0
  153. package/dist/commands/signal.d.ts +4 -0
  154. package/dist/commands/signal.d.ts.map +1 -0
  155. package/dist/commands/signal.js +8 -0
  156. package/dist/commands/signal.js.map +1 -0
  157. package/dist/commands/stats.d.ts +4 -0
  158. package/dist/commands/stats.d.ts.map +1 -0
  159. package/dist/commands/stats.js +11 -0
  160. package/dist/commands/stats.js.map +1 -0
  161. package/dist/commands/status.d.ts +4 -0
  162. package/dist/commands/status.d.ts.map +1 -0
  163. package/dist/commands/status.js +18 -0
  164. package/dist/commands/status.js.map +1 -0
  165. package/dist/commands/sync.d.ts +4 -0
  166. package/dist/commands/sync.d.ts.map +1 -0
  167. package/dist/commands/sync.js +20 -0
  168. package/dist/commands/sync.js.map +1 -0
  169. package/dist/commands/tail.d.ts +4 -0
  170. package/dist/commands/tail.d.ts.map +1 -0
  171. package/dist/commands/tail.js +51 -0
  172. package/dist/commands/tail.js.map +1 -0
  173. package/dist/commands/warn.d.ts +4 -0
  174. package/dist/commands/warn.d.ts.map +1 -0
  175. package/dist/commands/warn.js +15 -0
  176. package/dist/commands/warn.js.map +1 -0
  177. package/dist/create-org-profile.js +2 -2
  178. package/dist/create-user-profile.js +2 -2
  179. package/dist/index.js +135 -7
  180. package/dist/index.js.map +1 -1
  181. package/dist/lib/args.d.ts +11 -0
  182. package/dist/lib/args.d.ts.map +1 -0
  183. package/dist/lib/args.js +57 -0
  184. package/dist/lib/args.js.map +1 -0
  185. package/dist/lib/config.d.ts +12 -0
  186. package/dist/lib/config.d.ts.map +1 -0
  187. package/dist/lib/config.js +38 -0
  188. package/dist/lib/config.js.map +1 -0
  189. package/dist/lib/http.d.ts +9 -0
  190. package/dist/lib/http.d.ts.map +1 -0
  191. package/dist/lib/http.js +25 -0
  192. package/dist/lib/http.js.map +1 -0
  193. package/dist/lib/output.d.ts +5 -0
  194. package/dist/lib/output.d.ts.map +1 -0
  195. package/dist/lib/output.js +32 -0
  196. package/dist/lib/output.js.map +1 -0
  197. package/dist/lib/sdk.d.ts +10 -0
  198. package/dist/lib/sdk.d.ts.map +1 -0
  199. package/dist/lib/sdk.js +22 -0
  200. package/dist/lib/sdk.js.map +1 -0
  201. package/dist/lib/telemetry.d.ts +4 -0
  202. package/dist/lib/telemetry.d.ts.map +1 -0
  203. package/dist/lib/telemetry.js +61 -0
  204. package/dist/lib/telemetry.js.map +1 -0
  205. package/dist/utils/file-resolver.js +1 -3
  206. package/dist/utils/file-resolver.js.map +1 -1
  207. package/dist/utils/installation-setup.d.ts +15 -0
  208. package/dist/utils/installation-setup.d.ts.map +1 -1
  209. package/dist/utils/installation-setup.js +71 -8
  210. package/dist/utils/installation-setup.js.map +1 -1
  211. package/package.json +5 -21
  212. package/.claude/agents/TROUBLESHOOTING.md +0 -530
  213. package/.claude/agents/agent-backend.md +0 -574
  214. package/.claude/agents/agent-builder.md +0 -911
  215. package/.claude/agents/agent-claude.md +0 -645
  216. package/.claude/agents/agent-clean.md +0 -477
  217. package/.claude/agents/agent-clone.md +0 -554
  218. package/.claude/agents/agent-designer.md +0 -1080
  219. package/.claude/agents/agent-director.md +0 -2254
  220. package/.claude/agents/agent-documenter.md +0 -688
  221. package/.claude/agents/agent-frontend.md +0 -1199
  222. package/.claude/agents/agent-integrator.md +0 -670
  223. package/.claude/agents/agent-lawyer.md +0 -1320
  224. package/.claude/agents/agent-news.md +0 -363
  225. package/.claude/agents/agent-onboard.md +0 -613
  226. package/.claude/agents/agent-ontology.md +0 -585
  227. package/.claude/agents/agent-ops.md +0 -1275
  228. package/.claude/agents/agent-problem-solver.md +0 -669
  229. package/.claude/agents/agent-quality.md +0 -1042
  230. package/.claude/agents/agent-sales.md +0 -507
  231. package/.claude/agents/agent-writer.md +0 -1068
  232. package/.claude/commands/cascade.md +0 -742
  233. package/.claude/commands/chat.md +0 -728
  234. package/.claude/commands/commit.md +0 -95
  235. package/.claude/commands/create.md +0 -544
  236. package/.claude/commands/deploy.md +0 -309
  237. package/.claude/commands/fast.md +0 -636
  238. package/.claude/commands/mcp-on.md +0 -191
  239. package/.claude/commands/media-upload.md +0 -186
  240. package/.claude/commands/news.md +0 -274
  241. package/.claude/commands/onboard.md +0 -440
  242. package/.claude/commands/one.md +0 -398
  243. package/.claude/commands/optimize.md +0 -74
  244. package/.claude/commands/plan.md +0 -719
  245. package/.claude/commands/push.md +0 -214
  246. package/.claude/commands/release.md +0 -105
  247. package/.claude/commands/review.md +0 -99
  248. package/.claude/commands/server.md +0 -487
  249. package/.claude/commands/start.md +0 -227
  250. package/.claude/commands/test.md +0 -197
  251. package/.claude/commands/validate.md +0 -140
  252. package/.claude/hooks/.last-news-context +0 -1
  253. package/.claude/hooks/PULL-BEFORE-PUSH-GUIDE.md +0 -473
  254. package/.claude/hooks/README-knowledge-hooks.md +0 -451
  255. package/.claude/hooks/README-news-generation.md +0 -364
  256. package/.claude/hooks/README-root-cleanup.md +0 -200
  257. package/.claude/hooks/README.md +0 -284
  258. package/.claude/hooks/__pycache__/todo.cpython-312.pyc +0 -0
  259. package/.claude/hooks/__pycache__/todo.cpython-313.pyc +0 -0
  260. package/.claude/hooks/auto-format.sh +0 -106
  261. package/.claude/hooks/check-filenames.py +0 -177
  262. package/.claude/hooks/clean-post.py +0 -468
  263. package/.claude/hooks/clean-pre.py +0 -393
  264. package/.claude/hooks/clean-root-markdown.sh +0 -73
  265. package/.claude/hooks/commit-push.sh +0 -95
  266. package/.claude/hooks/done.py +0 -236
  267. package/.claude/hooks/format-hook.sh +0 -163
  268. package/.claude/hooks/formatting.py +0 -187
  269. package/.claude/hooks/hook-logger.sh +0 -173
  270. package/.claude/hooks/knowledge-post.py +0 -355
  271. package/.claude/hooks/knowledge-pre.py +0 -245
  272. package/.claude/hooks/mcp-on.sh +0 -134
  273. package/.claude/hooks/notification-hook.sh +0 -279
  274. package/.claude/hooks/ontology-validation.py +0 -255
  275. package/.claude/hooks/push.sh +0 -153
  276. package/.claude/hooks/release-cli.sh +0 -205
  277. package/.claude/hooks/root-cleanup.py +0 -217
  278. package/.claude/hooks/security-hook.sh +0 -397
  279. package/.claude/hooks/tag-all-docs.py +0 -464
  280. package/.claude/hooks/test-validate-ontology.sh +0 -170
  281. package/.claude/hooks/todo.py +0 -368
  282. package/.claude/hooks/track-changes.sh +0 -101
  283. package/.claude/hooks/validate-imports.py +0 -182
  284. package/.claude/hooks/validate-ontology-structure-summary.md +0 -243
  285. package/.claude/hooks/validate-ontology-structure.py +0 -558
  286. package/.claude/hooks/validate-ontology-structure.py.backup +0 -518
  287. package/.claude/hooks/validate-ontology.py +0 -140
  288. package/.claude/hooks/write-news.sh +0 -194
  289. package/.claude/skills/INDEX.md +0 -523
  290. package/.claude/skills/REGISTRY.md +0 -529
  291. package/.claude/skills/agent-backend-create-mutation.md +0 -319
  292. package/.claude/skills/agent-designer-create-wireframe.md +0 -341
  293. package/.claude/skills/agent-frontend-create-page.md +0 -413
  294. package/.claude/skills/agents/README.md +0 -238
  295. package/.claude/skills/astro/add-content-collection.md +0 -30
  296. package/.claude/skills/astro/check-build.md +0 -29
  297. package/.claude/skills/astro/create-component.md +0 -29
  298. package/.claude/skills/astro/create-page.md +0 -30
  299. package/.claude/skills/astro/optimize-performance.md +0 -21
  300. package/.claude/skills/convex/check-deployment.md +0 -46
  301. package/.claude/skills/convex/create-mutation.md +0 -405
  302. package/.claude/skills/convex/create-query.md +0 -52
  303. package/.claude/skills/convex/read-schema.md +0 -373
  304. package/.claude/skills/convex/test-function.md +0 -50
  305. package/.claude/skills/deployment/check-deployment-health.md +0 -20
  306. package/.claude/skills/deployment/create-release.md +0 -21
  307. package/.claude/skills/deployment/deploy-cloudflare.md +0 -31
  308. package/.claude/skills/deployment/deploy-convex.md +0 -30
  309. package/.claude/skills/deployment/sync-repositories.md +0 -19
  310. package/.claude/skills/design/check-accessibility.md +0 -21
  311. package/.claude/skills/design/create-component-spec.md +0 -27
  312. package/.claude/skills/design/generate-design-tokens.md +0 -24
  313. package/.claude/skills/design/generate-wireframe.md +0 -30
  314. package/.claude/skills/documentation/create-migration-guide.md +0 -20
  315. package/.claude/skills/documentation/generate-api-docs.md +0 -27
  316. package/.claude/skills/documentation/generate-readme.md +0 -22
  317. package/.claude/skills/documentation/update-knowledge.md +0 -20
  318. package/.claude/skills/integration/connect-external-system.md +0 -21
  319. package/.claude/skills/integration/implement-a2a.md +0 -20
  320. package/.claude/skills/integration/implement-acp.md +0 -20
  321. package/.claude/skills/integration/verify-integration.md +0 -20
  322. package/.claude/skills/ontology/README.md +0 -255
  323. package/.claude/skills/ontology/check-dimension.md +0 -307
  324. package/.claude/skills/ontology/generate-entity-type.md +0 -339
  325. package/.claude/skills/ontology/validate-schema.md +0 -229
  326. package/.claude/skills/ontology/verify-relationships.md +0 -310
  327. package/.claude/skills/problem-solving/analyze-test-failure.md +0 -21
  328. package/.claude/skills/problem-solving/identify-root-cause.md +0 -20
  329. package/.claude/skills/problem-solving/propose-solution.md +0 -29
  330. package/.claude/skills/problem-solving/verify-fix.md +0 -21
  331. package/.claude/skills/sales/generate-demo-script.md +0 -21
  332. package/.claude/skills/sales/qualify-lead.md +0 -30
  333. package/.claude/skills/sales/track-trial.md +0 -20
  334. package/.claude/skills/sales/verify-kyc.md +0 -20
  335. package/.claude/skills/testing/analyze-coverage.md +0 -24
  336. package/.claude/skills/testing/generate-tests.md +0 -24
  337. package/.claude/skills/testing/run-tests.md +0 -27
  338. package/.claude/skills/testing/validate-e2e.md +0 -25
  339. package/AGENTS.md +0 -60
  340. package/CLAUDE.md +0 -321
  341. package/CREATE-WEBSITE.md +0 -458
  342. package/SECURITY.md +0 -31
  343. package/dist/commands/create-website.d.ts +0 -19
  344. package/dist/commands/create-website.d.ts.map +0 -1
  345. package/dist/commands/create-website.js +0 -231
  346. package/dist/commands/create-website.js.map +0 -1
  347. package/folders.yaml +0 -92
  348. package/one/README.md +0 -760
  349. package/one/connections/a2a.md +0 -600
  350. package/one/connections/acp.md +0 -808
  351. package/one/connections/acps.md +0 -749
  352. package/one/connections/agentkit.md +0 -367
  353. package/one/connections/agui.md +0 -785
  354. package/one/connections/any-backend.md +0 -1720
  355. package/one/connections/ap2.md +0 -1072
  356. package/one/connections/api/queries-reference.md +0 -860
  357. package/one/connections/api-docs.md +0 -1909
  358. package/one/connections/api-reference.md +0 -1029
  359. package/one/connections/api.md +0 -2208
  360. package/one/connections/architecture-diagram.md +0 -112
  361. package/one/connections/communications.md +0 -467
  362. package/one/connections/connections.md +0 -357
  363. package/one/connections/copilotkit.md +0 -1577
  364. package/one/connections/cryptonetworks.md +0 -799
  365. package/one/connections/documentation.md +0 -1138
  366. package/one/connections/effect.md +0 -297
  367. package/one/connections/elizaos.md +0 -1308
  368. package/one/connections/groups.md +0 -814
  369. package/one/connections/inference.md +0 -76
  370. package/one/connections/integration-examples.md +0 -893
  371. package/one/connections/integration-guide.md +0 -887
  372. package/one/connections/integration-phase2.md +0 -754
  373. package/one/connections/kyc.md +0 -650
  374. package/one/connections/mcp.md +0 -860
  375. package/one/connections/membership.md +0 -1170
  376. package/one/connections/middleware.md +0 -1085
  377. package/one/connections/multitenant.md +0 -1359
  378. package/one/connections/n8n.md +0 -1033
  379. package/one/connections/patterns.md +0 -107
  380. package/one/connections/protocols.md +0 -297
  381. package/one/connections/relationships.md +0 -125
  382. package/one/connections/schema.md +0 -605
  383. package/one/connections/service-layer.md +0 -568
  384. package/one/connections/vectors.md +0 -225
  385. package/one/connections/wordpress.md +0 -1320
  386. package/one/connections/workflow-copy.md +0 -923
  387. package/one/connections/workflow-examples.md +0 -759
  388. package/one/connections/workflow-onboarding.md +0 -701
  389. package/one/connections/workflow.md +0 -923
  390. package/one/connections/workflows/delegation.md +0 -903
  391. package/one/connections/workflows/frontend.md +0 -1055
  392. package/one/connections/workflows/strategy.md +0 -921
  393. package/one/connections/workflows/tasks.md +0 -716
  394. package/one/connections/x402-baazar.md +0 -131
  395. package/one/connections/x402.md +0 -1353
  396. package/one/groups/features.md +0 -2904
  397. package/one/groups/groups.md +0 -587
  398. package/one/groups/one.md +0 -619
  399. package/one/groups/strategy-copy.md +0 -887
  400. package/one/knowledge/.obsidian/app.json +0 -1
  401. package/one/knowledge/.obsidian/appearance.json +0 -1
  402. package/one/knowledge/.obsidian/core-plugins.json +0 -33
  403. package/one/knowledge/.obsidian/ecommerce-ontology.md +0 -210
  404. package/one/knowledge/.obsidian/workspace.json +0 -211
  405. package/one/knowledge/100-inference-quick-reference.md +0 -449
  406. package/one/knowledge/ag-ui-protocol.md +0 -613
  407. package/one/knowledge/agent-onboard-usage.md +0 -630
  408. package/one/knowledge/agentic-commerce.md +0 -146
  409. package/one/knowledge/ai-agents-vs-memecoins-thesis.md +0 -683
  410. package/one/knowledge/ai-api-reference.md +0 -715
  411. package/one/knowledge/ai-platform.md +0 -323
  412. package/one/knowledge/ai-quickstart.md +0 -355
  413. package/one/knowledge/ai-sdk-implementation.md +0 -436
  414. package/one/knowledge/ai-token-crypto-analysis-framework.md +0 -1191
  415. package/one/knowledge/ai-token-paradigm-shift-2025.md +0 -732
  416. package/one/knowledge/altcoin-cycle-prediction-ontology.md +0 -884
  417. package/one/knowledge/altcoin-cycle-trading-strategy.md +0 -642
  418. package/one/knowledge/architecture-any-backend.md +0 -1589
  419. package/one/knowledge/architecture-diagram.md +0 -404
  420. package/one/knowledge/architecture-frontend.md +0 -1014
  421. package/one/knowledge/architecture.md +0 -1742
  422. package/one/knowledge/archived/ontology.old.md +0 -2840
  423. package/one/knowledge/astro-effect-complete-vision.md +0 -2148
  424. package/one/knowledge/astro-effect-simple-architecture.md +0 -750
  425. package/one/knowledge/audit-agent-onboard-alignment.md +0 -481
  426. package/one/knowledge/audit-agent-sales-alignment.md +0 -444
  427. package/one/knowledge/backend-api-reference.md +0 -728
  428. package/one/knowledge/cascading-context-specification.md +0 -1617
  429. package/one/knowledge/claude-code-integration.md +0 -1293
  430. package/one/knowledge/cli-claude-handoff.md +0 -736
  431. package/one/knowledge/context-engineering.md +0 -610
  432. package/one/knowledge/crypto-analysis-strategy.md +0 -1276
  433. package/one/knowledge/crypto-cycle-2024-2025-analysis.md +0 -44
  434. package/one/knowledge/crypto.md +0 -978
  435. package/one/knowledge/develop/design.md +0 -364
  436. package/one/knowledge/develop/index.md +0 -145
  437. package/one/knowledge/development-commands.md +0 -251
  438. package/one/knowledge/docs.md +0 -627
  439. package/one/knowledge/dsl.md +0 -1678
  440. package/one/knowledge/event-driven-documentation.md +0 -270
  441. package/one/knowledge/files.md +0 -2489
  442. package/one/knowledge/frontend.md +0 -1056
  443. package/one/knowledge/games-english.md +0 -691
  444. package/one/knowledge/games.md +0 -1082
  445. package/one/knowledge/generative-ui-patterns.md +0 -559
  446. package/one/knowledge/guidelines.md +0 -314
  447. package/one/knowledge/hono.md +0 -2127
  448. package/one/knowledge/implementation-examples.md +0 -2554
  449. package/one/knowledge/installation-folders.md +0 -366
  450. package/one/knowledge/institutional-cycle-paradigm-2025.md +0 -555
  451. package/one/knowledge/knowledge.md +0 -660
  452. package/one/knowledge/language.md +0 -998
  453. package/one/knowledge/lessons-learned.md +0 -378
  454. package/one/knowledge/lessons-website-building-focus.md +0 -382
  455. package/one/knowledge/merge-report.md +0 -254
  456. package/one/knowledge/metadata-system.md +0 -504
  457. package/one/knowledge/nine-padel-playbook.md +0 -229
  458. package/one/knowledge/one-protocol-ai-agents.md +0 -892
  459. package/one/knowledge/one-protocol-executive-report.md +0 -617
  460. package/one/knowledge/one-protocol-standard.md +0 -869
  461. package/one/knowledge/one-protocol-whitepaper.md +0 -756
  462. package/one/knowledge/ontology-blog.yaml +0 -47
  463. package/one/knowledge/ontology-cheatsheet.md +0 -617
  464. package/one/knowledge/ontology-community.yaml +0 -65
  465. package/one/knowledge/ontology-core-universal.md +0 -740
  466. package/one/knowledge/ontology-core.yaml +0 -63
  467. package/one/knowledge/ontology-courses.yaml +0 -76
  468. package/one/knowledge/ontology-creator.md +0 -402
  469. package/one/knowledge/ontology-crypto.md +0 -1603
  470. package/one/knowledge/ontology-developer-guide.md +0 -814
  471. package/one/knowledge/ontology-documentation.md +0 -377
  472. package/one/knowledge/ontology-ecommerce.md +0 -269
  473. package/one/knowledge/ontology-education-game.md +0 -1654
  474. package/one/knowledge/ontology-education.md +0 -938
  475. package/one/knowledge/ontology-engineering-specification.md +0 -1310
  476. package/one/knowledge/ontology-engineering.md +0 -1676
  477. package/one/knowledge/ontology-files.yaml +0 -525
  478. package/one/knowledge/ontology-frontend-master.md +0 -2898
  479. package/one/knowledge/ontology-frontend-specifications.md +0 -2196
  480. package/one/knowledge/ontology-frontend.md +0 -2475
  481. package/one/knowledge/ontology-index.md +0 -397
  482. package/one/knowledge/ontology-minimal.yaml +0 -301
  483. package/one/knowledge/ontology-portfolio.yaml +0 -45
  484. package/one/knowledge/ontology-quickstart.md +0 -602
  485. package/one/knowledge/ontology-release.md +0 -317
  486. package/one/knowledge/ontology-shop.yaml +0 -148
  487. package/one/knowledge/ontology-tokens.yaml +0 -51
  488. package/one/knowledge/ontology-tutorial.md +0 -455
  489. package/one/knowledge/ontology-v2.md +0 -4449
  490. package/one/knowledge/ontology-video-script.md +0 -939
  491. package/one/knowledge/ontology-visual-guide.md +0 -378
  492. package/one/knowledge/ontology.md +0 -3847
  493. package/one/knowledge/ontology.yaml +0 -1653
  494. package/one/knowledge/parallel-agents.md +0 -932
  495. package/one/knowledge/patterns/backend/convex-mutation-pattern.md +0 -130
  496. package/one/knowledge/patterns/backend/convex-query-pattern.md +0 -143
  497. package/one/knowledge/patterns/backend/mutation-template.md +0 -249
  498. package/one/knowledge/patterns/backend/query-template.md +0 -286
  499. package/one/knowledge/patterns/backend/service-template.md +0 -258
  500. package/one/knowledge/patterns/design/component-architecture.md +0 -435
  501. package/one/knowledge/patterns/design/index.md +0 -160
  502. package/one/knowledge/patterns/design/test-driven-design-pattern.md +0 -196
  503. package/one/knowledge/patterns/design/wireframe-template.md +0 -250
  504. package/one/knowledge/patterns/frontend/component-template.md +0 -246
  505. package/one/knowledge/patterns/frontend/form-template.md +0 -348
  506. package/one/knowledge/patterns/frontend/page-template.md +0 -209
  507. package/one/knowledge/patterns/frontend/react-component-pattern.md +0 -188
  508. package/one/knowledge/patterns/test/acceptance-criteria-template.md +0 -396
  509. package/one/knowledge/patterns/test/technical-test-template.md +0 -566
  510. package/one/knowledge/patterns/test/test-driven-pattern.md +0 -160
  511. package/one/knowledge/patterns/test/user-flow-template.md +0 -272
  512. package/one/knowledge/performance.md +0 -459
  513. package/one/knowledge/provider-agnostic-content.md +0 -995
  514. package/one/knowledge/provider-creation-guide.md +0 -1082
  515. package/one/knowledge/quality-loop.md +0 -419
  516. package/one/knowledge/quick-start-ontology-mapping.md +0 -773
  517. package/one/knowledge/readme-architecture.md +0 -158
  518. package/one/knowledge/readme.md +0 -149
  519. package/one/knowledge/rules.md +0 -644
  520. package/one/knowledge/score.md +0 -85
  521. package/one/knowledge/specifications.md +0 -873
  522. package/one/knowledge/tags.md +0 -148
  523. package/one/knowledge/todo-template.md +0 -269
  524. package/one/knowledge/todo.md +0 -269
  525. package/one/knowledge/troubleshooting.md +0 -434
  526. package/one/knowledge/typescript-patterns.md +0 -321
  527. package/one/knowledge/universal-generation-language.md +0 -827
  528. package/one/knowledge/x402-research.md +0 -104
  529. package/one/license.md +0 -107
  530. package/one/people/anthony-o-connell.md +0 -469
  531. package/one/people/people.md +0 -590
  532. package/one/things/ALIGNMENT_AUDIT_QUALITY_AGENT.md +0 -401
  533. package/one/things/AUDIT_AGENT_INTEGRATOR_ALIGNMENT.md +0 -588
  534. package/one/things/AUDIT_REPORT_AGENT_CLEAN.md +0 -461
  535. package/one/things/CHECKLIST.md +0 -407
  536. package/one/things/IMPLEMENTATION_STATUS.md +0 -379
  537. package/one/things/ONE.md +0 -529
  538. package/one/things/agents/agent-backend.md +0 -1501
  539. package/one/things/agents/agent-builder.md +0 -1064
  540. package/one/things/agents/agent-clean.md +0 -1112
  541. package/one/things/agents/agent-clone.md +0 -1324
  542. package/one/things/agents/agent-deploy.md +0 -986
  543. package/one/things/agents/agent-designer.md +0 -2305
  544. package/one/things/agents/agent-director.md +0 -1526
  545. package/one/things/agents/agent-documenter.md +0 -1129
  546. package/one/things/agents/agent-frontend.md +0 -1201
  547. package/one/things/agents/agent-integrator.md +0 -1269
  548. package/one/things/agents/agent-lawyer.md +0 -1371
  549. package/one/things/agents/agent-problem-solver.md +0 -1457
  550. package/one/things/agents/agent-quality.md +0 -1483
  551. package/one/things/agents/agent-sales.md +0 -1074
  552. package/one/things/cascade/cascade.yaml +0 -481
  553. package/one/things/cascade/docs/examples/1-1-agent-prompts/design.md +0 -523
  554. package/one/things/cascade/docs/examples/1-1-agent-prompts/tests.md +0 -314
  555. package/one/things/cascade/docs/examples/1-1-agent-prompts.md +0 -562
  556. package/one/things/cascade/docs/examples/1-2-yaml-orchestrator/design.md +0 -543
  557. package/one/things/cascade/docs/examples/1-2-yaml-orchestrator/tests.md +0 -272
  558. package/one/things/cascade/docs/examples/1-2-yaml-orchestrator.md +0 -548
  559. package/one/things/cascade/docs/examples/1-3-event-coordination/design.md +0 -586
  560. package/one/things/cascade/docs/examples/1-3-event-coordination/tests.md +0 -267
  561. package/one/things/cascade/docs/examples/1-3-event-coordination.md +0 -547
  562. package/one/things/cascade/docs/examples/1-4-knowledge-management/design.md +0 -665
  563. package/one/things/cascade/docs/examples/1-4-knowledge-management/tests.md +0 -236
  564. package/one/things/cascade/docs/examples/1-4-knowledge-management.md +0 -652
  565. package/one/things/cascade/docs/examples/1-5-quality-loops/design.md +0 -860
  566. package/one/things/cascade/docs/examples/1-5-quality-loops/tests.md +0 -255
  567. package/one/things/cascade/docs/examples/1-5-quality-loops.md +0 -725
  568. package/one/things/cascade/docs/examples/1-6-numbering-structure/design.md +0 -659
  569. package/one/things/cascade/docs/examples/1-6-numbering-structure/tests.md +0 -256
  570. package/one/things/cascade/docs/examples/1-6-numbering-structure.md +0 -639
  571. package/one/things/cascade/docs/examples/readme.md +0 -259
  572. package/one/things/cascade/docs/getting-started.md +0 -533
  573. package/one/things/cascade/docs/workflow.md +0 -1378
  574. package/one/things/cascade/readme.md +0 -379
  575. package/one/things/cascade/templates/feature-template.md +0 -289
  576. package/one/things/claude/agents/advocacy-activation-manager.md +0 -710
  577. package/one/things/claude/agents/advocacy-campaign-designer.md +0 -688
  578. package/one/things/claude/agents/analyst.md +0 -508
  579. package/one/things/claude/agents/architect.md +0 -505
  580. package/one/things/claude/agents/brand-identity-specialist.md +0 -538
  581. package/one/things/claude/agents/bstp-token-strategist.md +0 -690
  582. package/one/things/claude/agents/builder-repo.md +0 -532
  583. package/one/things/claude/agents/bullstamp-community-builder.md +0 -597
  584. package/one/things/claude/agents/bullstamp-marketing-orchestrator.md +0 -529
  585. package/one/things/claude/agents/bulltilt-platform-growth.md +0 -590
  586. package/one/things/claude/agents/company-bullstamp-character.md +0 -602
  587. package/one/things/claude/agents/company-bullstamp-community.md +0 -307
  588. package/one/things/claude/agents/company-bullstamp-marketing.md +0 -307
  589. package/one/things/claude/agents/company-bullstamp-token.md +0 -307
  590. package/one/things/claude/agents/company-bulltilt-growth.md +0 -307
  591. package/one/things/claude/agents/content-bibliography-formatter.md +0 -404
  592. package/one/things/claude/agents/content-calendar-planner.md +0 -473
  593. package/one/things/claude/agents/content-chapter-formatter.md +0 -513
  594. package/one/things/claude/agents/content-formatter.md +0 -571
  595. package/one/things/claude/agents/content-hook-specialist.md +0 -485
  596. package/one/things/claude/agents/content-image-formatter.md +0 -560
  597. package/one/things/claude/agents/content-introduction-formatter.md +0 -510
  598. package/one/things/claude/agents/content-multiplication-engine.md +0 -579
  599. package/one/things/claude/agents/content-playbook-writer.md +0 -473
  600. package/one/things/claude/agents/content-team-manager.md +0 -647
  601. package/one/things/claude/agents/content-toc-formatter.md +0 -547
  602. package/one/things/claude/agents/convex-backend-specialist.md +0 -2725
  603. package/one/things/claude/agents/core-manager.md +0 -607
  604. package/one/things/claude/agents/core-master.md +0 -426
  605. package/one/things/claude/agents/cross-functional-manager.md +0 -476
  606. package/one/things/claude/agents/crypto-airdrop-strategist.md +0 -622
  607. package/one/things/claude/agents/crypto-analytics-educator.md +0 -596
  608. package/one/things/claude/agents/crypto-architecture-specialist.md +0 -497
  609. package/one/things/claude/agents/crypto-community-analyst.md +0 -314
  610. package/one/things/claude/agents/crypto-community-psychologist.md +0 -546
  611. package/one/things/claude/agents/crypto-dex-optimization-expert.md +0 -579
  612. package/one/things/claude/agents/crypto-dex-optimizer.md +0 -307
  613. package/one/things/claude/agents/crypto-diamond-formation-specialist.md +0 -552
  614. package/one/things/claude/agents/crypto-diamond-hands.md +0 -307
  615. package/one/things/claude/agents/crypto-ecosystem-expansion-manager.md +0 -597
  616. package/one/things/claude/agents/crypto-engagement-specialist.md +0 -581
  617. package/one/things/claude/agents/crypto-market-researcher.md +0 -307
  618. package/one/things/claude/agents/crypto-marketing-orchestrator.md +0 -563
  619. package/one/things/claude/agents/crypto-network-effect-amplifier.md +0 -614
  620. package/one/things/claude/agents/crypto-optimization-analyst.md +0 -597
  621. package/one/things/claude/agents/crypto-strategic-synthesizer.md +0 -556
  622. package/one/things/claude/agents/crypto-team-manager.md +0 -392
  623. package/one/things/claude/agents/crypto-token-analyst.md +0 -319
  624. package/one/things/claude/agents/crypto-viral-content-creator.md +0 -549
  625. package/one/things/claude/agents/crypto-wallet-identification-expert.md +0 -527
  626. package/one/things/claude/agents/crypto-wallet-identifier.md +0 -307
  627. package/one/things/claude/agents/customer-journey-designer.md +0 -474
  628. package/one/things/claude/agents/customer-success-manager.md +0 -574
  629. package/one/things/claude/agents/dev.md +0 -406
  630. package/one/things/claude/agents/documenter.md +0 -548
  631. package/one/things/claude/agents/elevate-marketing-orchestrator.md +0 -403
  632. package/one/things/claude/agents/engagement-specialist.md +0 -502
  633. package/one/things/claude/agents/engineering-architect.md +0 -387
  634. package/one/things/claude/agents/engineering-business-analyst.md +0 -527
  635. package/one/things/claude/agents/engineering-developer.md +0 -386
  636. package/one/things/claude/agents/engineering-director.md +0 -322
  637. package/one/things/claude/agents/engineering-ingestor.md +0 -659
  638. package/one/things/claude/agents/engineering-product-manager.md +0 -525
  639. package/one/things/claude/agents/engineering-product-owner.md +0 -527
  640. package/one/things/claude/agents/engineering-project-coordinator.md +0 -525
  641. package/one/things/claude/agents/engineering-quality-assurance.md +0 -392
  642. package/one/things/claude/agents/engineering-team-manager.md +0 -515
  643. package/one/things/claude/agents/engineering-user-experience.md +0 -386
  644. package/one/things/claude/agents/framework-elevate-manager.md +0 -309
  645. package/one/things/claude/agents/improver.md +0 -805
  646. package/one/things/claude/agents/intelligence-team-manager.md +0 -390
  647. package/one/things/claude/agents/lead-capture-expert.md +0 -459
  648. package/one/things/claude/agents/lead-magnet-creator.md +0 -446
  649. package/one/things/claude/agents/market-research-analyst.md +0 -435
  650. package/one/things/claude/agents/marketing-brand-identity.md +0 -344
  651. package/one/things/claude/agents/marketing-content-hooks.md +0 -455
  652. package/one/things/claude/agents/marketing-content-multiplier.md +0 -331
  653. package/one/things/claude/agents/marketing-content-poster.md +0 -372
  654. package/one/things/claude/agents/marketing-customer-journey.md +0 -331
  655. package/one/things/claude/agents/marketing-director.md +0 -402
  656. package/one/things/claude/agents/marketing-engagement.md +0 -331
  657. package/one/things/claude/agents/marketing-lead-capture.md +0 -331
  658. package/one/things/claude/agents/marketing-lead-magnet.md +0 -331
  659. package/one/things/claude/agents/marketing-network-effects.md +0 -331
  660. package/one/things/claude/agents/marketing-nurture-campaigns.md +0 -331
  661. package/one/things/claude/agents/marketing-share-optimizer.md +0 -331
  662. package/one/things/claude/agents/marketing-team-manager.md +0 -451
  663. package/one/things/claude/agents/marketing-viral-growth.md +0 -232
  664. package/one/things/claude/agents/mission-commander.md +0 -378
  665. package/one/things/claude/agents/network-effect-analyst.md +0 -604
  666. package/one/things/claude/agents/nextjs-15-specialist.md +0 -1634
  667. package/one/things/claude/agents/npx.md +0 -946
  668. package/one/things/claude/agents/nurture-campaign-manager.md +0 -554
  669. package/one/things/claude/agents/one-master.md +0 -378
  670. package/one/things/claude/agents/one-orchestrator.md +0 -345
  671. package/one/things/claude/agents/one.md +0 -658
  672. package/one/things/claude/agents/playbook-generator.md +0 -526
  673. package/one/things/claude/agents/pm.md +0 -349
  674. package/one/things/claude/agents/po.md +0 -370
  675. package/one/things/claude/agents/qa.md +0 -361
  676. package/one/things/claude/agents/research-foundation-analyst.md +0 -324
  677. package/one/things/claude/agents/research-intelligence-gatherer.md +0 -435
  678. package/one/things/claude/agents/research-market-analyst.md +0 -324
  679. package/one/things/claude/agents/research-team-manager.md +0 -489
  680. package/one/things/claude/agents/sales-environment-optimizer.md +0 -519
  681. package/one/things/claude/agents/sales-team-manager.md +0 -407
  682. package/one/things/claude/agents/sales-upsell-strategist.md +0 -324
  683. package/one/things/claude/agents/service-advocacy-campaigns.md +0 -324
  684. package/one/things/claude/agents/service-advocacy-manager.md +0 -324
  685. package/one/things/claude/agents/service-success-manager.md +0 -324
  686. package/one/things/claude/agents/service-team-manager.md +0 -405
  687. package/one/things/claude/agents/shadcn-ui-design-system-specialist.md +0 -2357
  688. package/one/things/claude/agents/share-optimization-specialist.md +0 -576
  689. package/one/things/claude/agents/sm.md +0 -352
  690. package/one/things/claude/agents/story-teller.md +0 -498
  691. package/one/things/claude/agents/task-master.md +0 -621
  692. package/one/things/claude/agents/tauri-cross-platform-specialist.md +0 -1912
  693. package/one/things/claude/agents/tester.md +0 -595
  694. package/one/things/claude/agents/the-bull-character-manager.md +0 -603
  695. package/one/things/claude/agents/tools-playbook-generator.md +0 -492
  696. package/one/things/claude/agents/turbo-repo-builder.md +0 -346
  697. package/one/things/claude/agents/upsell-strategist.md +0 -503
  698. package/one/things/claude/agents/ux-expert.md +0 -360
  699. package/one/things/claude/agents/viral-growth-orchestrator.md +0 -520
  700. package/one/things/claude/claude-code-hooks-development.json +0 -21
  701. package/one/things/claude/claude-code-hooks-production.json +0 -21
  702. package/one/things/claude/claude-code-hooks.json +0 -25
  703. package/one/things/claude/commands/agent.md +0 -124
  704. package/one/things/claude/commands/cascade-status.md +0 -153
  705. package/one/things/claude/commands/ingest.md +0 -343
  706. package/one/things/claude/commands/ingestor.md +0 -158
  707. package/one/things/claude/commands/mission.md +0 -103
  708. package/one/things/claude/commands/npx.md +0 -156
  709. package/one/things/claude/commands/one.md +0 -486
  710. package/one/things/claude/commands/quality-check.md +0 -252
  711. package/one/things/claude/commands/smart-route.md +0 -261
  712. package/one/things/claude/commands/start.md +0 -139
  713. package/one/things/claude/commands/story.md +0 -103
  714. package/one/things/claude/commands/task.md +0 -193
  715. package/one/things/claude/hook-bypass.json +0 -32
  716. package/one/things/claude/hooks/agent-hook-config.json +0 -427
  717. package/one/things/claude/hooks/build-hook.sh +0 -156
  718. package/one/things/claude/hooks/cleanup-hook.sh +0 -201
  719. package/one/things/claude/hooks/file-organization-hook.sh +0 -80
  720. package/one/things/claude/hooks/format-hook.sh +0 -43
  721. package/one/things/claude/hooks/hook-bypass.sh +0 -293
  722. package/one/things/claude/hooks/hook-debouncer.sh +0 -62
  723. package/one/things/claude/hooks/hook-logger.sh +0 -89
  724. package/one/things/claude/hooks/lint-hook.sh +0 -140
  725. package/one/things/claude/hooks/notification-hook.sh +0 -204
  726. package/one/things/claude/hooks/ontology-validation-hook.sh +0 -86
  727. package/one/things/claude/hooks/performance-metrics.json +0 -25
  728. package/one/things/claude/hooks/security-hook.sh +0 -256
  729. package/one/things/claude/hooks/story-validation-hook-enhanced.sh +0 -210
  730. package/one/things/claude/hooks/story-validation-hook.sh +0 -145
  731. package/one/things/claude/hooks/test-hook.sh +0 -145
  732. package/one/things/claude/hooks/test-story-validation.sh +0 -170
  733. package/one/things/claude/settings-local.json +0 -86
  734. package/one/things/cli/cli-code.md +0 -677
  735. package/one/things/cli/cli-compiler-code.md +0 -677
  736. package/one/things/cli/cli.md +0 -871
  737. package/one/things/components/card-shadcn.md +0 -953
  738. package/one/things/components/card.md +0 -1041
  739. package/one/things/components.md +0 -1743
  740. package/one/things/componets.md +0 -19
  741. package/one/things/contracts/Move.toml +0 -12
  742. package/one/things/contracts/README.md +0 -288
  743. package/one/things/contracts/one.move +0 -762
  744. package/one/things/contracts/sdk.ts +0 -578
  745. package/one/things/creator-diagram.md +0 -184
  746. package/one/things/crypto/FEATURES.md +0 -78
  747. package/one/things/crypto/ONECORE.md +0 -62
  748. package/one/things/crypto/ONECOREFAQ.md +0 -22
  749. package/one/things/crypto/ONECOREHOW.md +0 -46
  750. package/one/things/crypto/ONEENTERPRISE.md +0 -64
  751. package/one/things/crypto/ONEENTERPRISEFAQ.md +0 -64
  752. package/one/things/crypto/ONEENTERPRISEHOW.md +0 -53
  753. package/one/things/crypto/ONEPRO.md +0 -60
  754. package/one/things/crypto/ONEPROFAQ.md +0 -22
  755. package/one/things/crypto/ONEPROHOW.md +0 -53
  756. package/one/things/crypto/READMEAGENCY.md +0 -64
  757. package/one/things/crypto/VSL.md +0 -45
  758. package/one/things/crypto/WebsiteCopy.md +0 -176
  759. package/one/things/demo-accessibility-animations.md +0 -1025
  760. package/one/things/demo-components.md +0 -1310
  761. package/one/things/demo-design-summary.md +0 -692
  762. package/one/things/demo-design-system.md +0 -973
  763. package/one/things/demo-page-layouts.md +0 -1016
  764. package/one/things/design-system.md +0 -832
  765. package/one/things/designs/accessibility-audit.md +0 -877
  766. package/one/things/designs/component-specifications.md +0 -855
  767. package/one/things/designs/design-overview.md +0 -377
  768. package/one/things/designs/design-tokens.md +0 -448
  769. package/one/things/designs/wireframes-dashboard.md +0 -710
  770. package/one/things/docs/api-requests.md +0 -987
  771. package/one/things/docs/ecommerce/ARCHITECTURE-DIAGRAM.md +0 -485
  772. package/one/things/docs/ecommerce/CONVERSION-ELEMENTS-IMPLEMENTATION.md +0 -465
  773. package/one/things/docs/ecommerce/CONVERSION-ELEMENTS-SUMMARY.md +0 -425
  774. package/one/things/docs/ecommerce/CONVERSION-UX-IMPLEMENTATION-SUMMARY.md +0 -451
  775. package/one/things/docs/ecommerce/FEATURE-SUMMARY.md +0 -536
  776. package/one/things/docs/ecommerce/IMPLEMENTATION-NOTES.md +0 -650
  777. package/one/things/docs/ecommerce/INTEGRATION-EXAMPLE.md +0 -473
  778. package/one/things/docs/ecommerce/QUICK-START.md +0 -405
  779. package/one/things/docs/ecommerce/URGENCY-IMPLEMENTATION-SUMMARY.md +0 -567
  780. package/one/things/docs/ecommerce/URGENCY-QUICK-REFERENCE.md +0 -271
  781. package/one/things/docs/ecommerce/USAGE-EXAMPLE.astro +0 -171
  782. package/one/things/docs/ecommerce/demo.astro +0 -309
  783. package/one/things/examples/children/lemonade-stand.md +0 -404
  784. package/one/things/examples/enterprise/crm-saas.md +0 -1444
  785. package/one/things/features/1-1-agent-prompts.md +0 -562
  786. package/one/things/features/1-2-yaml-orchestrator.md +0 -548
  787. package/one/things/features/1-3-event-coordination.md +0 -547
  788. package/one/things/features/1-4-knowledge-management.md +0 -652
  789. package/one/things/features/1-5-quality-loops.md +0 -725
  790. package/one/things/features/1-6-numbering-structure.md +0 -639
  791. package/one/things/features/2-1-dataprovider-interface.md +0 -2583
  792. package/one/things/features/2-2-config-system.md +0 -3242
  793. package/one/things/features/2-3-effectts-services.md +0 -1645
  794. package/one/things/features/2-4-react-hooks.md +0 -2136
  795. package/one/things/features/2-5-auth-migration.md +0 -2144
  796. package/one/things/features/2-6-dashboard-migration.md +0 -2084
  797. package/one/things/features/2-7-alternative-providers.md +0 -2578
  798. package/one/things/features/2-7-implementation-report.md +0 -724
  799. package/one/things/features/2-cli.md +0 -1720
  800. package/one/things/features/2-design.md +0 -1770
  801. package/one/things/features/2-tests.md +0 -576
  802. package/one/things/features/AUTH_HOOKS_IMPLEMENTATION.md +0 -576
  803. package/one/things/features/DECOUPLING.md +0 -290
  804. package/one/things/features/DEPLOYMENT.md +0 -470
  805. package/one/things/features/IMPLEMENTATION_SUMMARY.md +0 -362
  806. package/one/things/features/improve.md +0 -861
  807. package/one/things/features/remove-convex-deps.md +0 -63
  808. package/one/things/features/top-features.md +0 -87
  809. package/one/things/features/use-one-backend.md +0 -1217
  810. package/one/things/features-in-english.md +0 -200
  811. package/one/things/files.yaml +0 -721
  812. package/one/things/ideas/1-create-workflow.md +0 -207
  813. package/one/things/ideas/2-backend-agnostic-frontend.md +0 -439
  814. package/one/things/implementation/backend-guide.md +0 -457
  815. package/one/things/interface.md +0 -257
  816. package/one/things/landing-page-implementation.md +0 -455
  817. package/one/things/legal/README.md +0 -234
  818. package/one/things/legal/privacy-policy.md +0 -1227
  819. package/one/things/legal/terms-of-service.md +0 -1432
  820. package/one/things/master-workflow-plan.md +0 -806
  821. package/one/things/pay.one.ie.md +0 -53
  822. package/one/things/plans/0-in-sync.md +0 -136
  823. package/one/things/plans/0-timeline.md +0 -36
  824. package/one/things/plans/1-create-workflow.md +0 -732
  825. package/one/things/plans/QUICK-START-SIMPLIFICATION.md +0 -333
  826. package/one/things/plans/README-SIMPLIFICATION.md +0 -349
  827. package/one/things/plans/SIMPLIFICATION-EXAMPLES.md +0 -16
  828. package/one/things/plans/SIMPLIFICATION-SUMMARY.md +0 -455
  829. package/one/things/plans/ai-elements-integration.md +0 -483
  830. package/one/things/plans/ai-elements.md +0 -1278
  831. package/one/things/plans/ai-integration-plan.md +0 -263
  832. package/one/things/plans/ai-integration.md +0 -996
  833. package/one/things/plans/ai-sdk.md +0 -798
  834. package/one/things/plans/ai-tools.md +0 -621
  835. package/one/things/plans/app.md +0 -832
  836. package/one/things/plans/architecture-summary.md +0 -312
  837. package/one/things/plans/async-ai-agents.md +0 -233
  838. package/one/things/plans/backend-agnostic-frontend.md +0 -390
  839. package/one/things/plans/backend-cleanup-quickstart.md +0 -380
  840. package/one/things/plans/backend-ontology-conformance.md +0 -475
  841. package/one/things/plans/backend-status.md +0 -599
  842. package/one/things/plans/backend-structure.md +0 -847
  843. package/one/things/plans/backend-target-structure.md +0 -482
  844. package/one/things/plans/backend.md +0 -1175
  845. package/one/things/plans/better-auth-any-backend-revised.md +0 -1103
  846. package/one/things/plans/better-auth-any-backend.md +0 -1896
  847. package/one/things/plans/better-auth-available-features.md +0 -273
  848. package/one/things/plans/big-plan.md +0 -52
  849. package/one/things/plans/cli-updates-required.md +0 -320
  850. package/one/things/plans/complete-step-by-step.md +0 -1409
  851. package/one/things/plans/components.md +0 -709
  852. package/one/things/plans/convex-agents.md +0 -1034
  853. package/one/things/plans/convex-better-auth.md +0 -1141
  854. package/one/things/plans/convex-on-off.md +0 -407
  855. package/one/things/plans/crypto-token-researcher.md +0 -629
  856. package/one/things/plans/data-quality-metrics.md +0 -745
  857. package/one/things/plans/deep-researcher-agent.md +0 -466
  858. package/one/things/plans/deploy-to-cloudflare.md +0 -623
  859. package/one/things/plans/deployment-architecture.md +0 -469
  860. package/one/things/plans/desktop.md +0 -1139
  861. package/one/things/plans/development-plan.md +0 -1283
  862. package/one/things/plans/development-workflow-tldr.md +0 -207
  863. package/one/things/plans/development-workflow.md +0 -959
  864. package/one/things/plans/dsl-claude-code.md +0 -1011
  865. package/one/things/plans/effect-components.md +0 -1743
  866. package/one/things/plans/effect-patterns-reference.md +0 -2235
  867. package/one/things/plans/effect.md +0 -1806
  868. package/one/things/plans/email.md +0 -966
  869. package/one/things/plans/enhance-auth.md +0 -1692
  870. package/one/things/plans/execution-strategy.md +0 -1291
  871. package/one/things/plans/existing-infrastructure.md +0 -712
  872. package/one/things/plans/feature-based-sites.md +0 -894
  873. package/one/things/plans/frontend-effects.md +0 -1276
  874. package/one/things/plans/group-folder-multi-tenancy.md +0 -893
  875. package/one/things/plans/improve-codebase.md +0 -1811
  876. package/one/things/plans/install-components.md +0 -215
  877. package/one/things/plans/integrate-frontend-and-backend.md +0 -603
  878. package/one/things/plans/landing.md +0 -820
  879. package/one/things/plans/layout.md +0 -249
  880. package/one/things/plans/mail-backend.md +0 -1361
  881. package/one/things/plans/mail.md +0 -2677
  882. package/one/things/plans/mcp-clear-context-prompt.md +0 -81
  883. package/one/things/plans/mcp-simple.md +0 -248
  884. package/one/things/plans/multi-ontology-architecture.md +0 -885
  885. package/one/things/plans/next-features.md +0 -114
  886. package/one/things/plans/npx-agent-safety.md +0 -785
  887. package/one/things/plans/npx-agent.md +0 -1089
  888. package/one/things/plans/onboarding.md +0 -51
  889. package/one/things/plans/one-protocol-and-payone-usage.md +0 -82
  890. package/one/things/plans/one.md +0 -677
  891. package/one/things/plans/ontology-6-dimensions.md +0 -2201
  892. package/one/things/plans/ontology-compliance-audit.md +0 -342
  893. package/one/things/plans/ontology-driven-strategy.md +0 -882
  894. package/one/things/plans/ontology-refine.md +0 -586
  895. package/one/things/plans/ontology-ui-approach.md +0 -375
  896. package/one/things/plans/open-agent.md +0 -840
  897. package/one/things/plans/performace.md +0 -122
  898. package/one/things/plans/phase-1-foundation.md +0 -620
  899. package/one/things/plans/phase-3-implementation.md +0 -1037
  900. package/one/things/plans/plan-connect-to-api.md +0 -146
  901. package/one/things/plans/quick-wins.md +0 -1428
  902. package/one/things/plans/r2.md +0 -777
  903. package/one/things/plans/readme-backend-cleanup.md +0 -402
  904. package/one/things/plans/release.md +0 -507
  905. package/one/things/plans/remove-backend-development-from-agents.md +0 -1331
  906. package/one/things/plans/repos.md +0 -98
  907. package/one/things/plans/separate-copy-2.md +0 -1349
  908. package/one/things/plans/separate-copy-3.md +0 -2479
  909. package/one/things/plans/separate-copy.md +0 -1349
  910. package/one/things/plans/separate-demo.md +0 -864
  911. package/one/things/plans/separate.md +0 -1999
  912. package/one/things/plans/sequence.md +0 -2040
  913. package/one/things/plans/shadcn-integration-summary.md +0 -510
  914. package/one/things/plans/sidebar.md +0 -206
  915. package/one/things/plans/skills.md +0 -709
  916. package/one/things/plans/small-fixes.md +0 -23
  917. package/one/things/plans/start-new.md +0 -764
  918. package/one/things/plans/switch-off-auth.md +0 -42
  919. package/one/things/plans/sync-checklist.md +0 -351
  920. package/one/things/plans/test-backend-connection.md +0 -514
  921. package/one/things/plans/unified-implementation-plan.md +0 -934
  922. package/one/things/plans/update-demos.md +0 -581
  923. package/one/things/plans/use-our-backend.md +0 -572
  924. package/one/things/plans/video-backend.md +0 -638
  925. package/one/things/plans/video-frontend.md +0 -490
  926. package/one/things/plans/video-old-archived.md +0 -656
  927. package/one/things/plans/wave1-onboarding-100-inferences.md +0 -1686
  928. package/one/things/plans/wave1-onboarding-vision.md +0 -744
  929. package/one/things/plans/wave1-orchestration-summary.md +0 -604
  930. package/one/things/plans/wave1-specialist-assignments.md +0 -1413
  931. package/one/things/plans/workflow-files.md +0 -1210
  932. package/one/things/plans/workflow.md +0 -1378
  933. package/one/things/plans-u.md +0 -905
  934. package/one/things/products/Blockchain Products.md +0 -6278
  935. package/one/things/products/cascade-landing-page.md +0 -841
  936. package/one/things/products/cascade.md +0 -1568
  937. package/one/things/products/context-engineering.md +0 -1488
  938. package/one/things/products/onthology.md +0 -15
  939. package/one/things/products/ontology-ui-shadcn.md +0 -1302
  940. package/one/things/products/ontology-ui.md +0 -1429
  941. package/one/things/products/ontology.md +0 -789
  942. package/one/things/products/sdk.md +0 -573
  943. package/one/things/promptkit.md +0 -930
  944. package/one/things/repos/all-repos.md +0 -0
  945. package/one/things/scripts-clean-mac.sh +0 -409
  946. package/one/things/service-providers-new.md +0 -1052
  947. package/one/things/service-providers.md +0 -1121
  948. package/one/things/structure.md +0 -532
  949. package/one/things/system.md +0 -618
  950. package/one/things/templates.md +0 -294
  951. package/one/things/tests/2-1-dataprovider-interface.md +0 -1216
  952. package/one/things/tests/2-1-test-analysis.md +0 -544
  953. package/one/things/things.md +0 -384
  954. package/one/things/todo-acp-integration.md +0 -744
  955. package/one/things/todo-ai.md +0 -933
  956. package/one/things/todo-api.md +0 -1078
  957. package/one/things/todo-assignment.md +0 -580
  958. package/one/things/todo-buy-chatgpt.md +0 -1450
  959. package/one/things/todo-components.md +0 -1683
  960. package/one/things/todo-connections.md +0 -278
  961. package/one/things/todo-ecommerce-frontend.md +0 -1313
  962. package/one/things/todo-ecommerce.md +0 -569
  963. package/one/things/todo-effects.md +0 -1075
  964. package/one/things/todo-frontend-effects.md +0 -977
  965. package/one/things/todo-landing-page.md +0 -1091
  966. package/one/things/todo-mail.md +0 -1160
  967. package/one/things/todo-master-plan.md +0 -490
  968. package/one/things/todo-onboard.md +0 -666
  969. package/one/things/todo-one-ie.md +0 -538
  970. package/one/things/todo-page.md +0 -606
  971. package/one/things/todo-plans.md +0 -282
  972. package/one/things/todo-projects.md +0 -241
  973. package/one/things/todo-refactoring-plan.md +0 -366
  974. package/one/things/todo-release.md +0 -654
  975. package/one/things/todo-sequence.md +0 -1621
  976. package/one/things/todo-use-our-backend.md +0 -1908
  977. package/one/things/todo-workflow.md +0 -626
  978. package/one/things/todo-x402.md +0 -2047
  979. package/one/things/todo.md +0 -21
  980. package/one/things/video/scripts-crypto.md +0 -835
  981. package/one/things/video-script-backup.md +0 -318
  982. package/one/things/video-script-demo.md +0 -382
  983. package/one/things/video-script-ontology.md +0 -333
  984. package/one/things/video-script.md +0 -361
@@ -1,2479 +0,0 @@
1
- ---
2
- title: Separate Copy 3
3
- dimension: things
4
- category: plans
5
- tags: architecture, backend, frontend, ontology
6
- related_dimensions: connections, events, groups
7
- scope: global
8
- created: 2025-11-03
9
- updated: 2025-11-03
10
- version: 1.0.0
11
- ai_context: |
12
- This document is part of the things dimension in the plans category.
13
- Location: one/things/plans/separate-copy-3.md
14
- Purpose: Documents frontend-backend separation plan
15
- Related dimensions: connections, events, groups
16
- For AI agents: Read this to understand separate copy 3.
17
- ---
18
-
19
- # Frontend-Backend Separation Plan
20
-
21
- ## Executive Summary
22
-
23
- **Goal:** Transform the current tightly-coupled architecture into a fully headless, **backend-agnostic** architecture where:
24
-
25
- - **Frontend:** Pure Astro/React UI with DataProvider interface (no backend dependency)
26
- - **Backend:** ANY backend that implements the 6-dimension ontology (Convex, WordPress, Notion, Supabase, etc.)
27
- - **Connection:** DataProvider interface - swap backends by changing ONE line
28
-
29
- **Current State:**
30
-
31
- - ✅ Frontend is **working** and connected to Convex backend
32
- - ✅ Auth is functional with tests in `frontend/tests/auth/*`
33
- - ✅ Direct Convex integration (using `useQuery`, `useMutation`, Convex hooks)
34
- - ⚠️ Tightly coupled to Convex - can't swap to WordPress/Notion/Supabase
35
-
36
- **Target State:**
37
-
38
- - Frontend uses DataProvider interface
39
- - Backend is pluggable - organizations can use Convex, their existing WordPress site, Notion databases, or any other backend
40
- - Existing auth tests continue to pass
41
- - All current functionality preserved while adding flexibility
42
-
43
- ---
44
-
45
- ## Important Context
46
-
47
- **This is NOT a bug fix - this is a strategic enhancement.**
48
-
49
- ✅ **Current System Works:**
50
-
51
- - Frontend successfully talks to Convex backend
52
- - Auth is functional with passing tests
53
- - All features operational
54
- - No critical issues requiring immediate changes
55
-
56
- ⚠️ **Why Separate Now:**
57
-
58
- - Add backend flexibility (support WordPress, Notion, Shopify, etc.)
59
- - Enable multi-backend federation (auth in Convex, blog in WordPress, products in Shopify)
60
- - Allow organizations to use existing infrastructure
61
- - Remove Convex lock-in
62
-
63
- **Migration Approach:**
64
-
65
- - Zero downtime - wrap existing working functionality
66
- - Preserve all existing tests (especially auth tests)
67
- - Gradual page-by-page migration
68
- - Can rollback at any phase
69
- - No data migration required
70
-
71
- **Priority:** Medium (strategic, not urgent)
72
-
73
- ---
74
-
75
- ## Table of Contents
76
-
77
- 1. [Architecture Comparison](#architecture-comparison)
78
- 2. [Benefits of Separation](#benefits-of-separation)
79
- 3. [Migration Strategy](#migration-strategy)
80
- 4. [API Key Authentication](#api-key-authentication)
81
- 5. [File Structure Changes](#file-structure-changes)
82
- 6. [Implementation Steps](#implementation-steps)
83
- 7. [Testing Strategy](#testing-strategy)
84
- 8. [Deployment Changes](#deployment-changes)
85
-
86
- ---
87
-
88
- ## Architecture Comparison
89
-
90
- ### Current Architecture (Working, but Coupled)
91
-
92
- ```
93
- ┌─────────────────────────────────────────────────────────┐
94
- │ FRONTEND (Astro + React) │
95
- │ ┌──────────────────────────────────────────────────┐ │
96
- │ │ Pages & Components │ │
97
- │ │ ├─ import { useQuery } from 'convex/react' │ │
98
- │ │ ├─ import { api } from 'convex/_generated/api' │ │
99
- │ │ └─ const data = useQuery(api.things.get) │ │
100
- │ └──────────────────────────────────────────────────┘ │
101
- │ │
102
- │ frontend/convex/* (schema, mutations, queries) │
103
- │ ↓ Direct WebSocket Connection (WORKING) │
104
- │ │
105
- │ frontend/tests/auth/* (Auth tests passing) │
106
- └─────────────────────────────────────────────────────────┘
107
- │
108
- ▼
109
- ┌───────────────────────┐
110
- │ CONVEX BACKEND │
111
- │ (Real-time DB) │
112
- │ 6-Dimension Ontology │
113
- └───────────────────────┘
114
- ```
115
-
116
- **Status:** ✅ Working - Auth functional, tests passing
117
-
118
- **Limitations (Not Bugs):**
119
-
120
- - ⚠️ Frontend tightly coupled to Convex (works, but inflexible)
121
- - ⚠️ Can't swap backend without rewriting frontend
122
- - ⚠️ Organizations must use Convex (can't use existing WordPress/Notion)
123
- - ⚠️ Hard to add mobile/desktop apps without Convex SDK
124
- - ⚠️ No multi-backend support (can't federate data from Shopify/WordPress)
125
-
126
- ---
127
-
128
- ### Target Architecture (Backend-Agnostic with 6-Dimension Ontology)
129
-
130
- ```
131
- ┌──────────────────────────────────────────────────────────┐
132
- │ FRONTEND (Backend-Agnostic) │
133
- │ ┌────────────────────────────────────────────────────┐ │
134
- │ │ Astro Pages + React Components │ │
135
- │ │ - Renders UI from data │ │
136
- │ │ - Calls DataProvider methods │ │
137
- │ │ - NO backend-specific code │ │
138
- │ └────────────────────────────────────────────────────┘ │
139
- │ │
140
- │ ┌────────────────────────────────────────────────────┐ │
141
- │ │ Effect.ts Services (Backend-Agnostic) │ │
142
- │ │ - ThingService │ │
143
- │ │ - ConnectionService │ │
144
- │ │ - Uses DataProvider interface │ │
145
- │ └────────────────────────────────────────────────────┘ │
146
- │ │
147
- │ ┌────────────────────────────────────────────────────┐ │
148
- │ │ DataProvider Interface (Universal API) │ │
149
- │ │ organizations: { get, list, update } │ │
150
- │ │ people: { get, list, create, update } │ │
151
- │ │ things: { get, list, create, update, delete } │ │
152
- │ │ connections: { create, getRelated, getCount } │ │
153
- │ │ events: { log, query } │ │
154
- │ │ knowledge: { embed, search } │ │
155
- │ └────────────────────────────────────────────────────┘ │
156
- └──────────────────────────────────────────────────────────┘
157
- │
158
- ↓ Provider Implementation
159
- ┌──────────────────────────────────────────────────────────┐
160
- │ BACKEND PROVIDERS (Choose One - ONE Line!) │
161
- │ │
162
- │ ┌─────────────────────────────────────────────┐ │
163
- │ │ Option 1: ConvexProvider │ │
164
- │ │ → Convex backend (real-time, serverless) │ │
165
- │ └─────────────────────────────────────────────┘ │
166
- │ │
167
- │ ┌─────────────────────────────────────────────┐ │
168
- │ │ Option 2: WordPressProvider │ │
169
- │ │ → WordPress + WooCommerce (existing CMS) │ │
170
- │ └─────────────────────────────────────────────┘ │
171
- │ │
172
- │ ┌─────────────────────────────────────────────┐ │
173
- │ │ Option 3: NotionProvider │ │
174
- │ │ → Notion databases as backend │ │
175
- │ └─────────────────────────────────────────────┘ │
176
- │ │
177
- │ ┌─────────────────────────────────────────────┐ │
178
- │ │ Option 4: SupabaseProvider │ │
179
- │ │ → PostgreSQL + real-time (pgvector) │ │
180
- │ └─────────────────────────────────────────────┘ │
181
- │ │
182
- │ ┌─────────────────────────────────────────────┐ │
183
- │ │ Option 5: CustomProvider │ │
184
- │ │ → Your own API/database │ │
185
- │ └─────────────────────────────────────────────┘ │
186
- │ │
187
- │ All implement the same DataProvider interface │
188
- └──────────────────────────────────────────────────────────┘
189
- │
190
- ↓ Backend-Specific Implementation
191
- ┌──────────────────────────────────────────────────────────┐
192
- │ ACTUAL BACKENDS (Examples) │
193
- │ │
194
- │ Convex: │
195
- │ 6 tables → organizations, people, things, │
196
- │ connections, events, knowledge │
197
- │ │
198
- │ WordPress: │
199
- │ wp_posts, wp_users, wp_postmeta, wp_terms, etc. │
200
- │ │
201
- │ Notion: │
202
- │ Databases, Pages, Relations │
203
- │ │
204
- │ Supabase: │
205
- │ PostgreSQL tables with pgvector for knowledge │
206
- │ │
207
- │ Custom: │
208
- │ Your own database schema │
209
- └──────────────────────────────────────────────────────────┘
210
- ```
211
-
212
- **Benefits:**
213
-
214
- - ✅ **Backend-Agnostic:** Change backend by editing ONE line in config
215
- - ✅ **Multi-Backend Support:** Organizations can use existing infrastructure (WordPress, Notion, etc.)
216
- - ✅ **No Lock-In:** Not tied to Convex, any backend works
217
- - ✅ **Progressive Migration:** Keep existing WordPress site, add ONE frontend gradually
218
- - ✅ **Frontend Independence:** Rebuild UI without touching backend
219
- - ✅ **6-Dimension Ontology:** Universal data model works with any backend
220
- - ✅ **Effect.ts Services:** Type-safe, composable, testable operations
221
- - ✅ **Multi-Platform:** Same backend serves web, mobile, desktop, CLI
222
- - ✅ **Developer Choice:** Use the best backend for your organization's needs
223
-
224
- ---
225
-
226
- ## Understanding the 6-Dimension Ontology
227
-
228
- **The ONE ontology models reality in six core dimensions:**
229
-
230
- ```
231
- ┌──────────────────────────────────────────────────────┐
232
- │ 1. ORGANIZATIONS → Who owns this space? │
233
- │ Multi-tenant isolation, perfect data boundaries │
234
- └──────────────────────────────────────────────────────┘
235
- ↓
236
- ┌──────────────────────────────────────────────────────┐
237
- │ 2. PEOPLE → Who can do what? │
238
- │ Authorization, governance, human intent │
239
- └──────────────────────────────────────────────────────┘
240
- ↓
241
- ┌──────────────────────────────────────────────────────┐
242
- │ 3. THINGS → What exists? │
243
- │ Domain entities (66 types) │
244
- └──────────────────────────────────────────────────────┘
245
- ↓
246
- ┌──────────────────────────────────────────────────────┐
247
- │ 4. CONNECTIONS → How do things relate? │
248
- │ Relationships (25 types) │
249
- └──────────────────────────────────────────────────────┘
250
- ↓
251
- ┌──────────────────────────────────────────────────────┐
252
- │ 5. EVENTS → What happened? │
253
- │ Audit trail, complete history (67 types) │
254
- └──────────────────────────────────────────────────────┘
255
- ↓
256
- ┌──────────────────────────────────────────────────────┐
257
- │ 6. KNOWLEDGE → What does it mean? │
258
- │ AI intelligence, embeddings, RAG │
259
- └──────────────────────────────────────────────────────┘
260
- ```
261
-
262
- **Key Principle:** Every feature maps to these 6 dimensions. If you can't map it, you're thinking about it wrong.
263
-
264
- ### Example: User Creates a Course
265
-
266
- **Organizations (Dimension 1):**
267
-
268
- ```typescript
269
- organizationId: "fitnesspro_123"; // All operations scoped here
270
- ```
271
-
272
- **People (Dimension 2):**
273
-
274
- ```typescript
275
- // Separate people table (NOT things!)
276
- {
277
- _id: Id<'people'>,
278
- email: "sarah@fitnesspro.com",
279
- role: "org_owner", // Authorization level
280
- organizationId: "fitnesspro_123"
281
- }
282
- ```
283
-
284
- **Things (Dimension 3):**
285
-
286
- ```typescript
287
- // Course is a thing
288
- {
289
- _id: Id<'things'>,
290
- thingType: "course",
291
- name: "Fitness Fundamentals",
292
- organizationId: "fitnesspro_123",
293
- properties: {
294
- description: "...",
295
- price: 99,
296
- duration: "8 weeks"
297
- }
298
- }
299
- ```
300
-
301
- **Connections (Dimension 4):**
302
-
303
- ```typescript
304
- // Sarah owns the course
305
- {
306
- _id: Id<'connections'>,
307
- fromPersonId: sarah_person_id, // Person ID (Dimension 2)!
308
- toThingId: course_thing_id, // Thing ID (Dimension 3)
309
- relationshipType: "owns",
310
- organizationId: "fitnesspro_123"
311
- }
312
- ```
313
-
314
- **Events (Dimension 5):**
315
-
316
- ```typescript
317
- // Log the creation
318
- {
319
- _id: Id<'events'>,
320
- eventType: "course_created",
321
- actorId: sarah_person_id, // Person who did it (REQUIRED)
322
- targetId: course_thing_id, // What was created
323
- organizationId: "fitnesspro_123",
324
- timestamp: Date.now()
325
- }
326
- ```
327
-
328
- **Knowledge (Dimension 6):**
329
-
330
- ```typescript
331
- // Embed course content for AI
332
- {
333
- _id: Id<'knowledge'>,
334
- knowledgeType: "document",
335
- text: "Fitness Fundamentals...",
336
- embedding: [...], // 768-dim vector
337
- sourceThingId: course_thing_id,
338
- organizationId: "fitnesspro_123",
339
- labels: ["course", "fitness", "beginner"]
340
- }
341
- ```
342
-
343
- **Result:** One operation touches all 6 dimensions → complete context for AI agents.
344
-
345
- ---
346
-
347
- ## Effect.ts + DataProvider Pattern
348
-
349
- **The separation uses Effect.ts for type-safety and DataProvider for backend-agnosticism.**
350
-
351
- ### DataProvider Interface (Backend-Agnostic)
352
-
353
- ```typescript
354
- // frontend/src/providers/DataProvider.ts
355
- import { Effect, Context } from "effect";
356
-
357
- // Universal interface ALL backends implement
358
- export interface DataProvider {
359
- // Dimension 1: Organizations
360
- organizations: {
361
- get: (id: string) => Effect.Effect<Organization, OrganizationNotFoundError>;
362
- list: (params?: {
363
- status?: string;
364
- }) => Effect.Effect<Organization[], Error>;
365
- };
366
-
367
- // Dimension 2: People (separate from things!)
368
- people: {
369
- get: (id: string) => Effect.Effect<Person, PersonNotFoundError>;
370
- list: (params: {
371
- organizationId?: string;
372
- role?: string;
373
- }) => Effect.Effect<Person[], Error>;
374
- create: (input: {
375
- email: string;
376
- displayName: string;
377
- role: string;
378
- organizationId: string;
379
- }) => Effect.Effect<string, Error>;
380
- };
381
-
382
- // Dimension 3: Things
383
- things: {
384
- get: (id: string) => Effect.Effect<Thing, ThingNotFoundError>;
385
- list: (params: {
386
- type: ThingType;
387
- organizationId?: string;
388
- }) => Effect.Effect<Thing[], Error>;
389
- create: (input: {
390
- type: ThingType;
391
- name: string;
392
- organizationId: string;
393
- properties: any;
394
- }) => Effect.Effect<string, Error>;
395
- };
396
-
397
- // Dimension 4: Connections
398
- connections: {
399
- create: (input: {
400
- fromPersonId?: string; // Can connect people
401
- fromThingId?: string; // OR things
402
- toThingId: string;
403
- relationshipType: ConnectionType;
404
- organizationId: string;
405
- metadata?: any;
406
- }) => Effect.Effect<string, Error>;
407
- };
408
-
409
- // Dimension 5: Events
410
- events: {
411
- log: (event: {
412
- type: EventType;
413
- actorId: string; // Always a Person ID!
414
- targetId?: string;
415
- organizationId: string;
416
- metadata?: any;
417
- }) => Effect.Effect<void, Error>;
418
- };
419
-
420
- // Dimension 6: Knowledge
421
- knowledge: {
422
- search: (params: {
423
- query: string;
424
- organizationId: string;
425
- k?: number;
426
- }) => Effect.Effect<KnowledgeChunk[], Error>;
427
- };
428
- }
429
-
430
- export const DataProvider = Context.GenericTag<DataProvider>("DataProvider");
431
- ```
432
-
433
- ### Effect.ts Service Example
434
-
435
- ```typescript
436
- // backend/services/CourseService.ts
437
- import { Effect } from "effect";
438
- import { DataProvider } from "@/providers/DataProvider";
439
-
440
- export class CourseService extends Effect.Service<CourseService>()(
441
- "CourseService",
442
- {
443
- effect: Effect.gen(function* () {
444
- const provider = yield* DataProvider;
445
-
446
- return {
447
- // Create course → touches all 6 dimensions
448
- create: (params: {
449
- name: string;
450
- creatorId: string;
451
- organizationId: string;
452
- properties: any;
453
- }) =>
454
- Effect.gen(function* () {
455
- // 3. Create thing (course)
456
- const courseId = yield* provider.things.create({
457
- type: "course",
458
- name: params.name,
459
- organizationId: params.organizationId,
460
- properties: params.properties,
461
- });
462
-
463
- // 4. Create connection (person owns course)
464
- yield* provider.connections.create({
465
- fromPersonId: params.creatorId, // Person ID!
466
- toThingId: courseId,
467
- relationshipType: "owns",
468
- organizationId: params.organizationId,
469
- });
470
-
471
- // 5. Log event (course created)
472
- yield* provider.events.log({
473
- type: "course_created",
474
- actorId: params.creatorId, // Person who did it
475
- targetId: courseId,
476
- organizationId: params.organizationId,
477
- metadata: {
478
- courseName: params.name,
479
- creatorEmail: "sarah@fitnesspro.com",
480
- },
481
- });
482
-
483
- // 6. Embed for knowledge (AI can find it)
484
- // (handled by background job)
485
-
486
- return courseId;
487
- }),
488
- };
489
- }),
490
- dependencies: [DataProvider],
491
- },
492
- ) {}
493
- ```
494
-
495
- ### Frontend Usage (Backend-Agnostic)
496
-
497
- ```tsx
498
- // frontend/src/components/CreateCourse.tsx
499
- import { useEffectRunner } from "@/hooks/useEffectRunner";
500
- import { CourseService } from "@/services/CourseService";
501
- import { Effect } from "effect";
502
-
503
- export function CreateCourseForm() {
504
- const { run, loading } = useEffectRunner();
505
-
506
- const handleSubmit = async (formData: CourseFormData) => {
507
- // Define Effect program using CourseService
508
- const program = Effect.gen(function* () {
509
- const courseService = yield* CourseService;
510
-
511
- // Create course → touches all 6 dimensions automatically
512
- const courseId = yield* courseService.create({
513
- name: formData.name,
514
- creatorId: currentUser.id,
515
- organizationId: currentOrg.id,
516
- properties: {
517
- description: formData.description,
518
- price: formData.price,
519
- },
520
- });
521
-
522
- return courseId;
523
- });
524
-
525
- // Run program (frontend uses DataProvider)
526
- const courseId = await run(program);
527
-
528
- // Redirect to course page
529
- navigate(`/courses/${courseId}`);
530
- };
531
-
532
- return <form onSubmit={handleSubmit}>...</form>;
533
- }
534
- ```
535
-
536
- ### Backend Provider Implementations
537
-
538
- **Convex Provider:**
539
-
540
- ```typescript
541
- // frontend/src/providers/convex/ConvexProvider.ts
542
- import { Effect, Layer } from "effect";
543
- import { ConvexHttpClient } from "convex/browser";
544
- import { DataProvider } from "../DataProvider";
545
-
546
- export class ConvexProvider implements DataProvider {
547
- constructor(private client: ConvexHttpClient) {}
548
-
549
- things = {
550
- create: (input) =>
551
- Effect.tryPromise({
552
- try: () => this.client.mutation(api.things.create, input),
553
- catch: (error) => new Error(String(error)),
554
- }),
555
- };
556
-
557
- people = {
558
- create: (input) =>
559
- Effect.tryPromise({
560
- try: () => this.client.mutation(api.people.create, input),
561
- catch: (error) => new Error(String(error)),
562
- }),
563
- };
564
-
565
- // ... other dimensions
566
- }
567
-
568
- export const convexProvider = (config: { url: string }) =>
569
- Layer.succeed(
570
- DataProvider,
571
- new ConvexProvider(new ConvexHttpClient(config.url)),
572
- );
573
- ```
574
-
575
- **Composite Provider (Multi-Backend):**
576
-
577
- ```typescript
578
- // frontend/src/providers/composite/CompositeProvider.ts
579
- import { Effect, Layer } from "effect";
580
- import { DataProvider } from "../DataProvider";
581
-
582
- export class CompositeProvider implements DataProvider {
583
- constructor(
584
- private defaultProvider: DataProvider,
585
- private routes: Map<ThingType, DataProvider>,
586
- ) {}
587
-
588
- // Route to appropriate provider based on thing type
589
- private getProvider(type?: ThingType): DataProvider {
590
- if (type && this.routes.has(type)) {
591
- return this.routes.get(type)!;
592
- }
593
- return this.defaultProvider;
594
- }
595
-
596
- things = {
597
- get: (id: string) =>
598
- Effect.gen(function* () {
599
- // Fetch thing to determine type
600
- const thing = yield* this.defaultProvider.things.get(id);
601
-
602
- // Route to appropriate provider
603
- const provider = this.getProvider(thing.type);
604
- if (provider !== this.defaultProvider) {
605
- return yield* provider.things.get(id);
606
- }
607
- return thing;
608
- }),
609
-
610
- list: (params: { type: ThingType; organizationId?: string }) =>
611
- Effect.gen(function* () {
612
- // Route based on thing type
613
- const provider = this.getProvider(params.type);
614
- return yield* provider.things.list(params);
615
- }),
616
-
617
- create: (input: {
618
- type: ThingType;
619
- name: string;
620
- organizationId: string;
621
- properties: any;
622
- }) =>
623
- Effect.gen(function* () {
624
- // Route based on thing type
625
- const provider = this.getProvider(input.type);
626
- return yield* provider.things.create(input);
627
- }),
628
- };
629
-
630
- // Organizations, People, Events, Knowledge → always use default provider
631
- organizations = this.defaultProvider.organizations;
632
- people = this.defaultProvider.people;
633
- connections = this.defaultProvider.connections;
634
- events = this.defaultProvider.events;
635
- knowledge = this.defaultProvider.knowledge;
636
- }
637
-
638
- export function compositeProvider(config: {
639
- default: Layer<DataProvider>;
640
- routes: Record<string, Layer<DataProvider> | "default">;
641
- }) {
642
- return Effect.gen(function* () {
643
- // Resolve default provider
644
- const defaultProvider = yield* Effect.provide(DataProvider, config.default);
645
-
646
- // Resolve route providers
647
- const routes = new Map<ThingType, DataProvider>();
648
- for (const [type, providerConfig] of Object.entries(config.routes)) {
649
- if (providerConfig === "default") {
650
- routes.set(type as ThingType, defaultProvider);
651
- } else {
652
- const provider = yield* Effect.provide(DataProvider, providerConfig);
653
- routes.set(type as ThingType, provider);
654
- }
655
- }
656
-
657
- return new CompositeProvider(defaultProvider, routes);
658
- }).pipe(Effect.map((provider) => Layer.succeed(DataProvider, provider)));
659
- }
660
- ```
661
-
662
- **Real-World Example:**
663
-
664
- ```typescript
665
- // Auth & courses in Convex, blog in WordPress, products in Shopify
666
- export default defineConfig({
667
- integrations: [
668
- one({
669
- provider: compositeProvider({
670
- default: convexProvider({ url: env.PUBLIC_CONVEX_URL }),
671
- routes: {
672
- blog_post: wordpressProvider({
673
- url: "https://blog.yoursite.com",
674
- apiKey: env.WP_API_KEY,
675
- }),
676
- product: shopifyProvider({
677
- store: "yourstore.myshopify.com",
678
- accessToken: env.SHOPIFY_ACCESS_TOKEN,
679
- }),
680
- },
681
- }),
682
- }),
683
- ],
684
- });
685
- ```
686
-
687
- **Benefits:**
688
-
689
- - ✅ **Type-safe**: Compiler enforces all dimensions
690
- - ✅ **Composable**: Services build on each other
691
- - ✅ **Testable**: Mock layers, not databases
692
- - ✅ **Backend-agnostic**: Change provider, not code
693
- - ✅ **Multi-backend**: Use best backend for each data type
694
- - ✅ **6-dimension aware**: Every operation properly scoped
695
-
696
- ---
697
-
698
- ## Benefits of Separation
699
-
700
- ### 1. Multi-Tenancy Support
701
-
702
- **Before:**
703
-
704
- ```
705
- Org A → Frontend A → Convex Deployment A
706
- Org B → Frontend B → Convex Deployment B
707
- Org C → Frontend C → Convex Deployment C
708
-
709
- ❌ 3 orgs = 3 Convex deployments (expensive, hard to manage)
710
- ```
711
-
712
- **After:**
713
-
714
- ```
715
- Org A → Frontend A ──┐
716
- ├→ Single Backend API → Single Convex Deployment
717
- Org B → Frontend B ──┤ (with API key isolation)
718
- │
719
- Org C → Frontend C ──┘
720
-
721
- ✅ 3 orgs = 1 Convex deployment (cheap, centralized)
722
- ```
723
-
724
- ### 2. Backend Independence
725
-
726
- **Before:**
727
-
728
- - Frontend tightly coupled to Convex
729
- - Can't switch to WordPress, Notion, Supabase, etc.
730
- - Organizations must use Convex even if they have existing systems
731
- - Must learn Convex SDK for every platform
732
-
733
- ❌ Locked into Convex
734
-
735
- **After (Backend-Agnostic):**
736
-
737
- - Frontend uses DataProvider interface
738
- - Organizations can use:
739
- - **Convex** (real-time, serverless)
740
- - **WordPress** (existing CMS)
741
- - **Notion** (databases as backend)
742
- - **Supabase** (PostgreSQL + real-time)
743
- - **Custom backend** (your own API)
744
- - Change backend by editing ONE line in `astro.config.ts`
745
-
746
- ```typescript
747
- // Swap backends - frontend code unchanged!
748
- provider: convexProvider({ url: "..." });
749
- // OR
750
- provider: wordpressProvider({ url: "...", apiKey: "..." });
751
- // OR
752
- provider: notionProvider({ apiKey: "...", databaseId: "..." });
753
- ```
754
-
755
- ✅ Organizations use their existing infrastructure
756
-
757
- ### 3. Team Organization
758
-
759
- **Before:**
760
-
761
- ```
762
- Full-stack developer needs to know:
763
- - Astro + React
764
- - Convex-specific hooks and patterns
765
- - Convex schema + queries/mutations/actions
766
- - Effect.ts
767
- - Business logic
768
- ```
769
-
770
- **After (Backend-Agnostic):**
771
-
772
- ```
773
- Frontend developer needs to know:
774
- - Astro + React
775
- - DataProvider interface (universal)
776
- - Effect.ts services
777
-
778
- Backend developer needs to know:
779
- - Their chosen backend (WordPress, Convex, Notion, etc.)
780
- - How to implement DataProvider for that backend
781
- - 6-dimension ontology mapping
782
- ```
783
-
784
- ✅ Frontend devs don't learn backend-specific details
785
- ✅ Organizations can hire developers with their existing tech stack
786
- ✅ Clear separation of concerns
787
-
788
- ### 4. Progressive Migration & Flexibility
789
-
790
- **Before:**
791
-
792
- ```
793
- Organization has WordPress site with 10,000 posts
794
- Want to use ONE frontend
795
- Must migrate ALL data to Convex first
796
-
797
- ❌ Big-bang migration required
798
- ❌ Can't test gradually
799
- ❌ Risk losing SEO, existing integrations
800
- ```
801
-
802
- **After (Backend-Agnostic):**
803
-
804
- ```
805
- Organization keeps WordPress backend
806
- Implements WordPressProvider (maps WP → 6-dimension ontology)
807
- Deploys ONE frontend
808
- Frontend talks to WordPress via DataProvider
809
-
810
- ✅ Zero data migration needed
811
- ✅ Keep existing WordPress admin, plugins, integrations
812
- ✅ Progressive: Start with one page, migrate gradually
813
- ✅ Test ONE frontend without touching backend
814
- ```
815
-
816
- **Real-World Example:**
817
-
818
- ```typescript
819
- // Week 1: Deploy ONE frontend with WordPress backend
820
- provider: wordpressProvider({
821
- url: "https://existing-site.com",
822
- apiKey: env.WP_API_KEY,
823
- });
824
-
825
- // Week 50: Migrate to Convex when ready (ONE line change)
826
- provider: convexProvider({
827
- url: env.CONVEX_URL,
828
- });
829
-
830
- // Frontend code? UNCHANGED. No rewrite needed.
831
- ```
832
-
833
- ✅ Organizations control their migration timeline
834
- ✅ No forced backend choice
835
- ✅ Test frontend without backend risk
836
-
837
- ---
838
-
839
- ## Migration Strategy
840
-
841
- ### Phase 1: Create DataProvider Interface (Universal API)
842
-
843
- **Goal:** Define the backend-agnostic interface that ALL providers must implement
844
-
845
- **Tasks:**
846
-
847
- 1. Create `/frontend/src/providers/DataProvider.ts`
848
- 2. Define interfaces for 6 dimensions:
849
- - `organizations: { get, list, update }`
850
- - `people: { get, list, create, update, delete }`
851
- - `things: { get, list, create, update, delete }`
852
- - `connections: { create, getRelated, getCount, delete }`
853
- - `events: { log, query }`
854
- - `knowledge: { embed, search }`
855
- 3. Define error types (ThingNotFoundError, ConnectionCreateError, etc.)
856
- 4. Document interface with TypeScript types
857
-
858
- **Timeline:** 2-3 days
859
-
860
- **Risk:** None (just interface definition)
861
-
862
- **Reference:** See `one/knowledge/ontology-frontend.md` for complete DataProvider interface
863
-
864
- ---
865
-
866
- ### Phase 2: Implement ConvexProvider (Wrap Existing Working Backend)
867
-
868
- **Goal:** Wrap existing **working** Convex backend with DataProvider interface (NO functionality changes)
869
-
870
- **Tasks:**
871
-
872
- 1. Create `/frontend/src/providers/convex/ConvexProvider.ts`
873
- 2. Implement DataProvider interface using Convex client:
874
- ```typescript
875
- things.get(id) => client.query(api.queries.things.get, { id })
876
- things.create(input) => client.mutation(api.mutations.things.create, input)
877
- // etc. for all methods
878
- ```
879
- 3. Wrap Convex calls in Effect.ts for error handling
880
- 4. Create factory function: `convexProvider(config)`
881
- 5. Test provider in isolation
882
- 6. **Critical:** Run `frontend/tests/auth/*` - all tests must pass
883
-
884
- **Timeline:** 3-5 days
885
-
886
- **Risk:** Very Low (just wraps existing working Convex calls, no logic changes)
887
-
888
- **Success Criteria:**
889
-
890
- - ✅ ConvexProvider implements DataProvider interface fully
891
- - ✅ All existing auth tests pass
892
- - ✅ No functionality changes - just adds abstraction layer
893
-
894
- ---
895
-
896
- ### Phase 3: Create Effect.ts Service Layer
897
-
898
- **Goal:** Build generic services that use DataProvider (backend-agnostic)
899
-
900
- **Tasks:**
901
-
902
- 1. Create `/frontend/src/services/ThingService.ts` (generic, handles all 66 types)
903
- 2. Create `/frontend/src/services/ConnectionService.ts`
904
- 3. Create `/frontend/src/services/ClientLayer.ts` (dependency injection)
905
- 4. Services delegate to DataProvider:
906
- ```typescript
907
- export class ThingService extends Effect.Service<ThingService>()({
908
- effect: Effect.gen(function* () {
909
- const provider = yield* DataProvider // Backend-agnostic!
910
- return {
911
- get: (id: string) => provider.things.get(id),
912
- list: (type, orgId) => provider.things.list({ type, organizationId: orgId })
913
- }
914
- })
915
- })
916
- ```
917
- 5. Create `useEffectRunner` hook for React integration
918
-
919
- **Timeline:** 3-5 days
920
-
921
- **Risk:** Low (services just delegate to provider)
922
-
923
- ---
924
-
925
- ### Phase 4: Configure Provider in astro.config.ts
926
-
927
- **Goal:** Wire up ConvexProvider as the active backend
928
-
929
- **Tasks:**
930
-
931
- 1. Update `astro.config.ts`:
932
-
933
- ```typescript
934
- import { convexProvider } from "./src/providers/convex";
935
-
936
- export default defineConfig({
937
- integrations: [
938
- react(),
939
- one({
940
- provider: convexProvider({
941
- url: import.meta.env.PUBLIC_CONVEX_URL,
942
- }),
943
- }),
944
- ],
945
- });
946
- ```
947
-
948
- 2. Test that services can access provider via Effect.ts layers
949
-
950
- **Timeline:** 1 day
951
-
952
- **Risk:** Low (configuration only)
953
-
954
- ---
955
-
956
- ### Phase 5: Migrate Frontend Components Gradually
957
-
958
- **Goal:** Replace Convex hooks with Effect.ts services (page by page)
959
-
960
- **Before:**
961
-
962
- ```tsx
963
- import { useQuery } from "convex/react";
964
- import { api } from "@/convex/_generated/api";
965
-
966
- const courses = useQuery(api.queries.things.list, { type: "course" });
967
- ```
968
-
969
- **After:**
970
-
971
- ```tsx
972
- import { useEffectRunner } from "@/hooks/useEffectRunner";
973
- import { ThingService } from "@/services/ThingService";
974
-
975
- const { run, loading } = useEffectRunner();
976
- const [courses, setCourses] = useState([]);
977
-
978
- useEffect(() => {
979
- const program = Effect.gen(function* () {
980
- const thingService = yield* ThingService;
981
- return yield* thingService.list("course", orgId);
982
- });
983
- run(program, { onSuccess: setCourses });
984
- }, []);
985
- ```
986
-
987
- **Migration Order:**
988
-
989
- 1. Low-traffic pages first (`/about`, `/blog`)
990
- 2. Medium-traffic pages (`/courses`, `/products`)
991
- 3. High-traffic pages (`/`, `/dashboard`)
992
- 4. Authentication pages last (highest risk)
993
-
994
- **Critical - Auth Test Validation:**
995
-
996
- ```bash
997
- # After migrating ANY page that touches auth
998
- npm test frontend/tests/auth/
999
-
1000
- # If tests fail:
1001
- # 1. STOP migration
1002
- # 2. Debug the issue
1003
- # 3. Fix before continuing
1004
- # 4. Re-run tests until all pass
1005
- ```
1006
-
1007
- **Timeline:** 2-4 weeks (gradual, page by page)
1008
-
1009
- **Risk:** Medium (test each page thoroughly before deploying)
1010
-
1011
- **Safety Net:** Existing auth tests catch regressions immediately
1012
-
1013
- ---
1014
-
1015
- ### Phase 6: Remove Convex Dependencies from Frontend
1016
-
1017
- **Goal:** Clean up frontend - no more direct Convex imports
1018
-
1019
- **Tasks:**
1020
-
1021
- 1. Verify all pages use Effect.ts services (no direct Convex hooks)
1022
- 2. Remove `convex` from `frontend/package.json`
1023
- 3. Delete `frontend/convex/` directory (no longer needed)
1024
- 4. Update build process (no Convex codegen)
1025
- 5. Frontend is now backend-agnostic!
1026
-
1027
- **Timeline:** 1-2 days
1028
-
1029
- **Risk:** Low (if Phase 5 complete)
1030
-
1031
- ---
1032
-
1033
- ### Phase 7 (Optional): Add Alternative Backend Providers
1034
-
1035
- **Goal:** Demonstrate backend flexibility - add WordPress, Notion, Supabase providers
1036
-
1037
- **Example - WordPress Provider:**
1038
-
1039
- ```typescript
1040
- // /frontend/src/providers/wordpress/WordPressProvider.ts
1041
- export class WordPressProvider implements DataProvider {
1042
- things = {
1043
- get: (id) =>
1044
- Effect.gen(function* () {
1045
- const response = yield* Effect.tryPromise({
1046
- try: () => fetch(`${this.baseUrl}/wp-json/wp/v2/posts/${id}`),
1047
- catch: (error) => new Error(String(error)),
1048
- });
1049
- const post = yield* Effect.tryPromise({
1050
- try: () => response.json(),
1051
- catch: (error) => new Error(String(error)),
1052
- });
1053
- // Transform WordPress post → ONE thing
1054
- return {
1055
- _id: post.id.toString(),
1056
- type: "post",
1057
- name: post.title.rendered,
1058
- properties: {
1059
- content: post.content.rendered,
1060
- publishedAt: post.date,
1061
- },
1062
- status: post.status,
1063
- createdAt: new Date(post.date).getTime(),
1064
- updatedAt: new Date(post.modified).getTime(),
1065
- };
1066
- }),
1067
- };
1068
- // ... implement other methods
1069
- }
1070
- ```
1071
-
1072
- **Swap backends in config:**
1073
-
1074
- ```typescript
1075
- // Change from Convex to WordPress - ONE line!
1076
- export default defineConfig({
1077
- integrations: [
1078
- one({
1079
- // provider: convexProvider({ url: "..." }) // OLD
1080
- provider: wordpressProvider({
1081
- // NEW
1082
- url: "https://existing-site.com",
1083
- apiKey: env.WP_API_KEY,
1084
- }),
1085
- }),
1086
- ],
1087
- });
1088
- ```
1089
-
1090
- **Timeline:** 1-2 weeks per provider
1091
-
1092
- **Risk:** Low (doesn't affect existing Convex setup)
1093
-
1094
- **Value:** Demonstrates TRUE backend-agnosticism
1095
-
1096
- ---
1097
-
1098
- ## Authentication (Provider-Specific)
1099
-
1100
- **Key Concept:** Authentication is handled by each backend provider, not by the frontend.
1101
-
1102
- ### Authentication by Provider
1103
-
1104
- **1. Convex Provider**
1105
-
1106
- ```typescript
1107
- // Frontend reads from environment
1108
- provider: convexProvider({
1109
- url: import.meta.env.PUBLIC_CONVEX_URL,
1110
- });
1111
-
1112
- // Backend: Better Auth handles sessions
1113
- // Convex mutations check ctx.auth for user identity
1114
- // No API keys needed (sessions + WebSocket auth)
1115
- ```
1116
-
1117
- **2. WordPress Provider**
1118
-
1119
- ```typescript
1120
- // Frontend configured with WordPress API key
1121
- provider: wordpressProvider({
1122
- url: "https://yoursite.com",
1123
- apiKey: import.meta.env.WP_API_KEY, // WordPress Application Password
1124
- });
1125
-
1126
- // Backend: WordPress REST API validates the key
1127
- // Provider adds Authorization header to all requests
1128
- ```
1129
-
1130
- **3. Notion Provider**
1131
-
1132
- ```typescript
1133
- // Frontend configured with Notion integration token
1134
- provider: notionProvider({
1135
- apiKey: import.meta.env.NOTION_API_KEY, // Notion integration token
1136
- databaseId: import.meta.env.NOTION_DB_ID,
1137
- });
1138
-
1139
- // Backend: Notion API validates the integration token
1140
- ```
1141
-
1142
- **4. Supabase Provider**
1143
-
1144
- ```typescript
1145
- // Frontend uses Supabase anon key + RLS
1146
- provider: supabaseProvider({
1147
- url: import.meta.env.PUBLIC_SUPABASE_URL,
1148
- apiKey: import.meta.env.PUBLIC_SUPABASE_ANON_KEY,
1149
- });
1150
-
1151
- // Backend: Supabase Row Level Security (RLS) enforces access control
1152
- // User sessions managed by Supabase Auth
1153
- ```
1154
-
1155
- ### Security Model
1156
-
1157
- **Frontend:**
1158
-
1159
- - Frontend stores provider config (URLs, public/anon keys)
1160
- - NO secret keys in frontend
1161
- - Authentication state managed by provider (sessions, tokens, etc.)
1162
-
1163
- **Backend (Provider-Specific):**
1164
-
1165
- - **Convex:** Better Auth sessions + JWT validation
1166
- - **WordPress:** Application Passwords or OAuth
1167
- - **Notion:** Integration tokens (server-side only)
1168
- - **Supabase:** Row Level Security (RLS) + Auth
1169
-
1170
- ### Multi-Tenancy & Authorization
1171
-
1172
- Each provider implements organization isolation differently:
1173
-
1174
- **Convex:**
1175
-
1176
- ```typescript
1177
- // Convex mutations enforce org scoping
1178
- const courses = await ctx.db
1179
- .query("things")
1180
- .withIndex("by_type", (q) => q.eq("type", "course"))
1181
- .filter((q) => q.eq(q.field("organizationId"), userOrgId))
1182
- .collect();
1183
- ```
1184
-
1185
- **WordPress:**
1186
-
1187
- ```typescript
1188
- // WordPress categories/taxonomies for org isolation
1189
- // Or use multi-site for complete separation
1190
- ```
1191
-
1192
- **Notion:**
1193
-
1194
- ```typescript
1195
- // Separate Notion databases per organization
1196
- // Or use Notion's built-in sharing/permissions
1197
- ```
1198
-
1199
- **Supabase:**
1200
-
1201
- ```typescript
1202
- // Row Level Security (RLS) policies
1203
- CREATE POLICY "Users can only see their org's data"
1204
- ON things FOR SELECT
1205
- USING (organizationId = auth.uid());
1206
- ```
1207
-
1208
- **Key Point:** Authorization logic lives in the BACKEND (provider implementation), not the frontend
1209
-
1210
- ---
1211
-
1212
- ## File Structure Changes
1213
-
1214
- ### Before (Coupled)
1215
-
1216
- ```
1217
- frontend/
1218
- ├── convex/ # ❌ Tightly coupled to Convex
1219
- │ ├── _generated/
1220
- │ ├── mutations/
1221
- │ ├── queries/
1222
- │ ├── schema.ts
1223
- │ └── http.ts
1224
- ├── src/
1225
- │ ├── components/
1226
- │ │ └── CourseCard.tsx # Uses useQuery(api.things.list)
1227
- │ └── pages/
1228
- │ └── courses/[id].astro # Uses ConvexHttpClient
1229
- └── package.json # Includes "convex": "^1.x.x"
1230
-
1231
- ❌ Can't swap to WordPress, Notion, Supabase, etc.
1232
- ```
1233
-
1234
- ### After (Backend-Agnostic)
1235
-
1236
- ```
1237
- frontend/
1238
- ├── src/
1239
- │ ├── providers/ # ✅ Backend provider implementations
1240
- │ │ ├── DataProvider.ts # Universal interface (6 dimensions)
1241
- │ │ ├── convex/
1242
- │ │ │ ├── ConvexProvider.ts # Convex implementation
1243
- │ │ │ └── index.ts
1244
- │ │ ├── wordpress/ # Optional: WordPress implementation
1245
- │ │ │ ├── WordPressProvider.ts
1246
- │ │ │ └── index.ts
1247
- │ │ ├── notion/ # Optional: Notion implementation
1248
- │ │ │ ├── NotionProvider.ts
1249
- │ │ │ └── index.ts
1250
- │ │ └── supabase/ # Optional: Supabase implementation
1251
- │ │ ├── SupabaseProvider.ts
1252
- │ │ └── index.ts
1253
- │ ├── services/ # ✅ Backend-agnostic services
1254
- │ │ ├── ThingService.ts # Generic (handles all 66 types)
1255
- │ │ ├── ConnectionService.ts # Generic connections
1256
- │ │ └── ClientLayer.ts # Dependency injection
1257
- │ ├── hooks/
1258
- │ │ └── useEffectRunner.ts # ✅ Run Effect.ts in React
1259
- │ ├── components/
1260
- │ │ └── CourseCard.tsx # ✅ Uses ThingService (backend-agnostic)
1261
- │ └── pages/
1262
- │ └── courses/[id].astro # ✅ Uses ThingService (backend-agnostic)
1263
- ├── astro.config.ts # ✅ Configure provider (ONE line to swap!)
1264
- ├── .env # PUBLIC_CONVEX_URL or WP_API_KEY, etc.
1265
- └── package.json # ✅ No Convex dependency (if using other backend)
1266
-
1267
- ✅ Swap backends by changing ONE line in astro.config.ts!
1268
- ✅ Organizations can use their existing infrastructure
1269
- ```
1270
-
1271
- ### Configuration Example (Single Provider)
1272
-
1273
- ```typescript
1274
- // frontend/astro.config.ts
1275
-
1276
- // Option 1: Use Convex for everything
1277
- import { convexProvider } from "./src/providers/convex";
1278
- export default defineConfig({
1279
- integrations: [
1280
- one({
1281
- provider: convexProvider({ url: env.PUBLIC_CONVEX_URL }),
1282
- }),
1283
- ],
1284
- });
1285
-
1286
- // Option 2: Use WordPress for everything (change ONE line!)
1287
- import { wordpressProvider } from "./src/providers/wordpress";
1288
- export default defineConfig({
1289
- integrations: [
1290
- one({
1291
- provider: wordpressProvider({
1292
- url: "https://yoursite.com",
1293
- apiKey: env.WP_API_KEY,
1294
- }),
1295
- }),
1296
- ],
1297
- });
1298
-
1299
- // Option 3: Use Notion for everything (change ONE line!)
1300
- import { notionProvider } from "./src/providers/notion";
1301
- export default defineConfig({
1302
- integrations: [
1303
- one({
1304
- provider: notionProvider({
1305
- apiKey: env.NOTION_API_KEY,
1306
- databaseId: env.NOTION_DB_ID,
1307
- }),
1308
- }),
1309
- ],
1310
- });
1311
- ```
1312
-
1313
- ### Configuration Example (Multi-Provider - Federated Data)
1314
-
1315
- **Use case:** Auth from Convex, blog posts from WordPress, products from Shopify
1316
-
1317
- ```typescript
1318
- // frontend/astro.config.ts
1319
- import { compositeProvider } from "./src/providers/composite";
1320
- import { convexProvider } from "./src/providers/convex";
1321
- import { wordpressProvider } from "./src/providers/wordpress";
1322
- import { shopifyProvider } from "./src/providers/shopify";
1323
-
1324
- export default defineConfig({
1325
- integrations: [
1326
- one({
1327
- provider: compositeProvider({
1328
- // Default provider (fallback)
1329
- default: convexProvider({
1330
- url: env.PUBLIC_CONVEX_URL,
1331
- }),
1332
-
1333
- // Route specific thing types to specific providers
1334
- routes: {
1335
- // Auth & core data → Convex
1336
- organizations: "default",
1337
- people: "default",
1338
- sessions: "default",
1339
-
1340
- // Blog content → WordPress
1341
- blog_post: wordpressProvider({
1342
- url: "https://blog.yoursite.com",
1343
- apiKey: env.WP_API_KEY,
1344
- }),
1345
-
1346
- // Products → Shopify
1347
- product: shopifyProvider({
1348
- store: "yourstore.myshopify.com",
1349
- accessToken: env.SHOPIFY_ACCESS_TOKEN,
1350
- }),
1351
- digital_product: "product", // Use same as product
1352
-
1353
- // Courses → Convex (default)
1354
- course: "default",
1355
- lesson: "default",
1356
- },
1357
- }),
1358
- }),
1359
- ],
1360
- });
1361
- ```
1362
-
1363
- **How it works:**
1364
-
1365
- ```typescript
1366
- // Frontend calls generic service
1367
- const thingService = yield * ThingService;
1368
-
1369
- // Service calls DataProvider
1370
- const blogPost = yield * thingService.get(postId); // → WordPress
1371
- const product = yield * thingService.get(productId); // → Shopify
1372
- const course = yield * thingService.get(courseId); // → Convex
1373
-
1374
- // CompositeProvider routes based on thing type
1375
- // Frontend code doesn't change!
1376
- ```
1377
-
1378
- **Benefits:**
1379
-
1380
- - ✅ Use best backend for each data type
1381
- - ✅ Keep existing WordPress blog - no migration
1382
- - ✅ Pull products from Shopify in real-time
1383
- - ✅ Auth/sessions in Convex (fast, real-time)
1384
- - ✅ Frontend code unchanged - just reads things
1385
- - ✅ Add/remove providers without touching components
1386
-
1387
- ### Advanced: Data Sync Strategies
1388
-
1389
- **Strategy 1: Real-Time (Live Queries)**
1390
-
1391
- ```typescript
1392
- // Products pulled live from Shopify on every request
1393
- product: shopifyProvider({
1394
- store: "yourstore.myshopify.com",
1395
- accessToken: env.SHOPIFY_ACCESS_TOKEN,
1396
- // No caching - always fresh
1397
- });
1398
- ```
1399
-
1400
- **Strategy 2: Import & Cache (Better Performance)**
1401
-
1402
- ```typescript
1403
- // Import WordPress posts to Convex, sync periodically
1404
- import { syncedProvider } from "./src/providers/synced";
1405
-
1406
- provider: compositeProvider({
1407
- default: convexProvider({ url: env.PUBLIC_CONVEX_URL }),
1408
- routes: {
1409
- // Blog posts synced from WordPress → stored in Convex
1410
- blog_post: syncedProvider({
1411
- source: wordpressProvider({
1412
- url: "https://blog.yoursite.com",
1413
- apiKey: env.WP_API_KEY,
1414
- }),
1415
- destination: "default", // Store in Convex
1416
- syncInterval: "1 hour", // Sync every hour
1417
- strategy: "incremental", // Only sync new/changed posts
1418
- }),
1419
- },
1420
- });
1421
- ```
1422
-
1423
- **Strategy 3: Federation (Query Multiple Backends)**
1424
-
1425
- ```typescript
1426
- // Search across blog posts (WordPress) AND courses (Convex)
1427
- const searchResults =
1428
- yield *
1429
- Effect.all(
1430
- [
1431
- thingService.list("blog_post", { filters: { query: "fitness" } }),
1432
- thingService.list("course", { filters: { query: "fitness" } }),
1433
- ],
1434
- { concurrency: "unbounded" },
1435
- );
1436
-
1437
- // CompositeProvider queries both backends in parallel
1438
- // Frontend merges results
1439
- ```
1440
-
1441
- **Strategy 4: Hybrid (Auth + Import)**
1442
-
1443
- ```typescript
1444
- // Common pattern: Auth in Convex, content from external sources
1445
- provider: compositeProvider({
1446
- default: convexProvider({ url: env.PUBLIC_CONVEX_URL }),
1447
- routes: {
1448
- // WordPress posts imported to Convex (fast reads)
1449
- blog_post: syncedProvider({
1450
- source: wordpressProvider({ url: "...", apiKey: "..." }),
1451
- destination: "default",
1452
- syncInterval: "15 minutes",
1453
- }),
1454
-
1455
- // Shopify products live (always current pricing)
1456
- product: shopifyProvider({
1457
- store: "yourstore.myshopify.com",
1458
- accessToken: env.SHOPIFY_ACCESS_TOKEN,
1459
- }),
1460
-
1461
- // Everything else (auth, courses, etc.) in Convex
1462
- // Uses 'default' provider
1463
- },
1464
- });
1465
- ```
1466
-
1467
- **Real-World Example: E-commerce Platform**
1468
-
1469
- ```typescript
1470
- export default defineConfig({
1471
- integrations: [
1472
- one({
1473
- provider: compositeProvider({
1474
- // Core platform data in Convex
1475
- default: convexProvider({ url: env.PUBLIC_CONVEX_URL }),
1476
-
1477
- routes: {
1478
- // Auth & users → Convex (real-time, fast)
1479
- organizations: "default",
1480
- people: "default",
1481
-
1482
- // Products → Shopify (live pricing, inventory)
1483
- product: shopifyProvider({
1484
- store: env.SHOPIFY_STORE,
1485
- accessToken: env.SHOPIFY_ACCESS_TOKEN,
1486
- }),
1487
-
1488
- // Blog → WordPress (existing content, no migration)
1489
- blog_post: syncedProvider({
1490
- source: wordpressProvider({
1491
- url: env.WP_URL,
1492
- apiKey: env.WP_API_KEY,
1493
- }),
1494
- destination: "default",
1495
- syncInterval: "30 minutes",
1496
- }),
1497
-
1498
- // Courses → Convex (real-time progress tracking)
1499
- course: "default",
1500
- lesson: "default",
1501
-
1502
- // Customer reviews → Import from Trustpilot/Google
1503
- review: syncedProvider({
1504
- source: trustpilotProvider({ businessId: env.TRUSTPILOT_ID }),
1505
- destination: "default",
1506
- syncInterval: "24 hours",
1507
- }),
1508
- },
1509
- }),
1510
- }),
1511
- ],
1512
- });
1513
- ```
1514
-
1515
- **Frontend Code (Unchanged!):**
1516
-
1517
- ```tsx
1518
- // Component doesn't know or care about backend routing
1519
- export function HomePage() {
1520
- const { run } = useEffectRunner();
1521
- const [data, setData] = useState(null);
1522
-
1523
- useEffect(() => {
1524
- const program = Effect.gen(function* () {
1525
- const thingService = yield* ThingService;
1526
-
1527
- // Fetches from multiple backends automatically
1528
- const [products, posts, courses] = yield* Effect.all(
1529
- [
1530
- thingService.list("product", orgId), // → Shopify (live)
1531
- thingService.list("blog_post", orgId), // → WordPress (cached)
1532
- thingService.list("course", orgId), // → Convex (default)
1533
- ],
1534
- { concurrency: "unbounded" },
1535
- );
1536
-
1537
- return { products, posts, courses };
1538
- });
1539
-
1540
- run(program, { onSuccess: setData });
1541
- }, []);
1542
-
1543
- // Render federated data
1544
- return (
1545
- <div>
1546
- <ProductGrid products={data?.products} />
1547
- <BlogFeed posts={data?.posts} />
1548
- <CourseList courses={data?.courses} />
1549
- </div>
1550
- );
1551
- }
1552
- ```
1553
-
1554
- **Key Insights:**
1555
-
1556
- - ✅ Frontend components don't change when adding/removing backends
1557
- - ✅ Mix real-time and cached data based on needs
1558
- - ✅ Organizations keep existing content management systems
1559
- - ✅ Import external data (reviews, social proof) without manual copying
1560
- - ✅ Route based on performance/cost tradeoffs (Shopify API calls vs Convex reads)
1561
-
1562
- ### Backend Stays Separate (No Changes Needed)
1563
-
1564
- ```
1565
- backend/
1566
- └── convex/ # Backend unchanged!
1567
- ├── queries/
1568
- ├── mutations/
1569
- ├── schema.ts # 6-dimension ontology
1570
- └── http.ts
1571
-
1572
- # OR use WordPress, Notion, Supabase - frontend doesn't care!
1573
- ```
1574
-
1575
- ---
1576
-
1577
- ## Implementation Steps
1578
-
1579
- ### Step 1: Create API Key Entity Type
1580
-
1581
- **File: `backend/convex/schema.ts`**
1582
-
1583
- Add to existing schema:
1584
-
1585
- ```typescript
1586
- export default defineSchema({
1587
- // ... existing entities table
1588
-
1589
- entities: defineTable({
1590
- type: v.string(), // Add "api_key" as new type
1591
- name: v.string(),
1592
- properties: v.any(),
1593
- status: v.optional(
1594
- v.union(
1595
- v.literal("active"),
1596
- v.literal("inactive"),
1597
- v.literal("draft"),
1598
- v.literal("published"),
1599
- v.literal("archived"),
1600
- v.literal("revoked"), // ✅ Add for API keys
1601
- ),
1602
- ),
1603
- createdAt: v.number(),
1604
- updatedAt: v.number(),
1605
- deletedAt: v.optional(v.number()),
1606
- })
1607
- .index("by_type", ["type"])
1608
- .index("by_status", ["status"])
1609
- .index("by_key_hash", ["properties.keyHash"]), // ✅ Add for fast lookup
1610
-
1611
- // ... rest of schema
1612
- });
1613
- ```
1614
-
1615
- ### Step 2: Create API Key Queries
1616
-
1617
- **File: `backend/convex/queries/apiKeys.ts`**
1618
-
1619
- ```typescript
1620
- import { query } from "../_generated/server";
1621
- import { v } from "convex/values";
1622
-
1623
- export const validate = query({
1624
- args: { keyHash: v.string() },
1625
- handler: async (ctx, args) => {
1626
- const apiKey = await ctx.db
1627
- .query("entities")
1628
- .withIndex("by_key_hash", (q) => q.eq("properties.keyHash", args.keyHash))
1629
- .filter((q) => q.eq(q.field("type"), "api_key"))
1630
- .first();
1631
-
1632
- return apiKey;
1633
- },
1634
- });
1635
-
1636
- export const listByOrg = query({
1637
- args: { orgId: v.string() },
1638
- handler: async (ctx, args) => {
1639
- const keys = await ctx.db
1640
- .query("entities")
1641
- .withIndex("by_type", (q) => q.eq("type", "api_key"))
1642
- .filter((q) => q.eq(q.field("properties.orgId"), args.orgId))
1643
- .collect();
1644
-
1645
- // Don't return keyHash (security)
1646
- return keys.map((key) => ({
1647
- ...key,
1648
- properties: {
1649
- ...key.properties,
1650
- keyHash: undefined, // Remove sensitive data
1651
- },
1652
- }));
1653
- },
1654
- });
1655
- ```
1656
-
1657
- ### Step 3: Create API Key Mutations
1658
-
1659
- **File: `backend/convex/mutations/apiKeys.ts`**
1660
-
1661
- ```typescript
1662
- import { mutation } from "../_generated/server";
1663
- import { v } from "convex/values";
1664
- import { createHash, randomBytes } from "crypto";
1665
-
1666
- export const create = mutation({
1667
- args: {
1668
- orgId: v.string(),
1669
- name: v.string(),
1670
- scopes: v.array(v.string()),
1671
- environment: v.union(v.literal("production"), v.literal("development")),
1672
- },
1673
- handler: async (ctx, args) => {
1674
- // Generate random API key
1675
- const prefix = args.environment === "production" ? "sk_live" : "sk_test";
1676
- const random = randomBytes(18).toString("base64url");
1677
- const apiKey = `${prefix}_${random}`;
1678
-
1679
- // Hash the key for storage
1680
- const keyHash = createHash("sha256").update(apiKey).digest("hex");
1681
- const keyHint = apiKey.slice(-3);
1682
-
1683
- // Create entity
1684
- const keyId = await ctx.db.insert("entities", {
1685
- type: "api_key",
1686
- name: args.name,
1687
- properties: {
1688
- keyPrefix: prefix,
1689
- keyHash,
1690
- keyHint,
1691
- orgId: args.orgId,
1692
- scopes: args.scopes,
1693
- rateLimit: {
1694
- requests: 1000,
1695
- period: 60,
1696
- },
1697
- environment: args.environment,
1698
- lastUsedAt: null,
1699
- },
1700
- status: "active",
1701
- createdAt: Date.now(),
1702
- updatedAt: Date.now(),
1703
- });
1704
-
1705
- // Return plaintext key ONLY this once
1706
- return {
1707
- id: keyId,
1708
- apiKey, // ⚠️ Show user - never shown again!
1709
- keyHint,
1710
- };
1711
- },
1712
- });
1713
-
1714
- export const revoke = mutation({
1715
- args: { keyId: v.id("entities") },
1716
- handler: async (ctx, args) => {
1717
- await ctx.db.patch(args.keyId, {
1718
- status: "revoked",
1719
- updatedAt: Date.now(),
1720
- });
1721
- },
1722
- });
1723
-
1724
- export const updateLastUsed = mutation({
1725
- args: { keyId: v.id("entities") },
1726
- handler: async (ctx, args) => {
1727
- const key = await ctx.db.get(args.keyId);
1728
- if (!key) return;
1729
-
1730
- await ctx.db.patch(args.keyId, {
1731
- properties: {
1732
- ...key.properties,
1733
- lastUsedAt: Date.now(),
1734
- },
1735
- updatedAt: Date.now(),
1736
- });
1737
- },
1738
- });
1739
- ```
1740
-
1741
- ### Step 4: Create Hono API Backend
1742
-
1743
- **File: `backend/api/index.ts`**
1744
-
1745
- ```typescript
1746
- import { Hono } from "hono";
1747
- import { cors } from "hono/cors";
1748
- import { logger } from "hono/logger";
1749
- import { validateApiKey } from "./middleware/auth";
1750
- import tokensRoutes from "./routes/tokens";
1751
- import agentsRoutes from "./routes/agents";
1752
- import authRoutes from "./routes/auth";
1753
-
1754
- const app = new Hono();
1755
-
1756
- // Middleware
1757
- app.use("*", logger());
1758
- app.use(
1759
- "/api/*",
1760
- cors({
1761
- origin: [
1762
- "http://localhost:4321",
1763
- "https://*.pages.dev",
1764
- process.env.FRONTEND_URL || "",
1765
- ].filter(Boolean),
1766
- credentials: true,
1767
- }),
1768
- );
1769
-
1770
- // Health check (no auth required)
1771
- app.get("/health", (c) => c.json({ status: "ok" }));
1772
-
1773
- // API routes (auth required)
1774
- app.use("/api/*", validateApiKey);
1775
- app.route("/api/v1/tokens", tokensRoutes);
1776
- app.route("/api/v1/agents", agentsRoutes);
1777
- app.route("/api/v1/auth", authRoutes);
1778
-
1779
- // 404 handler
1780
- app.notFound((c) => c.json({ error: "Not found" }, 404));
1781
-
1782
- // Error handler
1783
- app.onError((err, c) => {
1784
- console.error(err);
1785
- return c.json({ error: "Internal server error" }, 500);
1786
- });
1787
-
1788
- export default app;
1789
- ```
1790
-
1791
- **File: `backend/api/routes/tokens.ts`**
1792
-
1793
- ```typescript
1794
- import { Hono } from "hono";
1795
- import { ConvexHttpClient } from "convex/browser";
1796
- import { api } from "../../convex/_generated/api";
1797
-
1798
- const app = new Hono();
1799
- const convex = new ConvexHttpClient(process.env.CONVEX_URL!);
1800
-
1801
- // GET /api/v1/tokens/:id
1802
- app.get("/:id", async (c) => {
1803
- const tokenId = c.req.param("id");
1804
- const orgId = c.get("orgId"); // From API key middleware
1805
-
1806
- const token = await convex.query(api.queries.entities.get, { id: tokenId });
1807
-
1808
- if (!token || token.type !== "token") {
1809
- return c.json({ error: "Token not found" }, 404);
1810
- }
1811
-
1812
- // Check ownership
1813
- if (token.properties.orgId !== orgId) {
1814
- return c.json({ error: "Unauthorized" }, 403);
1815
- }
1816
-
1817
- return c.json(token);
1818
- });
1819
-
1820
- // POST /api/v1/tokens/:id/purchase
1821
- app.post("/:id/purchase", async (c) => {
1822
- const tokenId = c.req.param("id");
1823
- const { amount } = await c.req.json();
1824
- const orgId = c.get("orgId");
1825
-
1826
- // Call Convex mutation
1827
- const result = await convex.mutation(api.mutations.tokens.purchase, {
1828
- tokenId,
1829
- amount,
1830
- orgId,
1831
- });
1832
-
1833
- return c.json(result);
1834
- });
1835
-
1836
- // Add more routes...
1837
-
1838
- export default app;
1839
- ```
1840
-
1841
- ### Step 5: Create Frontend API Client
1842
-
1843
- **File: `frontend/src/lib/api/client.ts`**
1844
-
1845
- ```typescript
1846
- export class ApiError extends Error {
1847
- constructor(
1848
- message: string,
1849
- public status: number,
1850
- ) {
1851
- super(message);
1852
- this.name = "ApiError";
1853
- }
1854
- }
1855
-
1856
- export class ApiClient {
1857
- private baseUrl: string;
1858
- private apiKey: string;
1859
-
1860
- constructor(apiKey: string, baseUrl?: string) {
1861
- this.apiKey = apiKey;
1862
- this.baseUrl = baseUrl || import.meta.env.PUBLIC_API_URL;
1863
- }
1864
-
1865
- private async request<T>(
1866
- endpoint: string,
1867
- options: RequestInit = {},
1868
- ): Promise<T> {
1869
- const url = `${this.baseUrl}${endpoint}`;
1870
-
1871
- const response = await fetch(url, {
1872
- ...options,
1873
- headers: {
1874
- "Content-Type": "application/json",
1875
- Authorization: `Bearer ${this.apiKey}`,
1876
- ...options.headers,
1877
- },
1878
- });
1879
-
1880
- if (!response.ok) {
1881
- const error = await response.json();
1882
- throw new ApiError(error.error, response.status);
1883
- }
1884
-
1885
- return response.json();
1886
- }
1887
-
1888
- tokens = {
1889
- get: (id: string) => this.request<Token>(`/api/v1/tokens/${id}`),
1890
-
1891
- purchase: (id: string, amount: number) =>
1892
- this.request<PurchaseResult>(`/api/v1/tokens/${id}/purchase`, {
1893
- method: "POST",
1894
- body: JSON.stringify({ amount }),
1895
- }),
1896
- };
1897
-
1898
- agents = {
1899
- get: (id: string) => this.request<Agent>(`/api/v1/agents/${id}`),
1900
-
1901
- list: () => this.request<Agent[]>("/api/v1/agents"),
1902
- };
1903
- }
1904
-
1905
- // Singleton instance
1906
- export const api = new ApiClient(import.meta.env.PUBLIC_API_KEY || "");
1907
- ```
1908
-
1909
- ### Step 6: Update Frontend Pages
1910
-
1911
- **Before:**
1912
-
1913
- ```astro
1914
- ---
1915
- // frontend/src/pages/tokens/[id].astro
1916
- import { ConvexHttpClient } from "convex/browser";
1917
- import { api as convexApi } from "@/convex/_generated/api";
1918
-
1919
- const convex = new ConvexHttpClient(import.meta.env.PUBLIC_CONVEX_URL);
1920
- const token = await convex.query(convexApi.entities.get, { id: Astro.params.id });
1921
- ---
1922
- ```
1923
-
1924
- **After:**
1925
-
1926
- ```astro
1927
- ---
1928
- // frontend/src/pages/tokens/[id].astro
1929
- import { api } from "@/lib/api/client";
1930
-
1931
- const token = await api.tokens.get(Astro.params.id);
1932
- ---
1933
- ```
1934
-
1935
- ### Step 7: Remove Convex from Frontend
1936
-
1937
- **Delete:**
1938
-
1939
- ```bash
1940
- rm -rf frontend/convex/
1941
- rm frontend/convex.config.ts
1942
- ```
1943
-
1944
- **Update `package.json`:**
1945
-
1946
- ```diff
1947
- {
1948
- "dependencies": {
1949
- - "convex": "^1.x.x",
1950
- - "@convex-dev/resend": "^x.x.x",
1951
- "astro": "^5.14.0"
1952
- }
1953
- }
1954
- ```
1955
-
1956
- ---
1957
-
1958
- ## Testing Strategy
1959
-
1960
- ### 0. Preserve Existing Auth Tests (Critical)
1961
-
1962
- **REQUIREMENT:** All tests in `frontend/tests/auth/*` must continue to pass throughout migration.
1963
-
1964
- **Strategy:**
1965
-
1966
- ```typescript
1967
- // Run existing auth tests after each phase
1968
- npm test frontend/tests/auth/
1969
-
1970
- // Tests must pass:
1971
- // ✅ Signup flow
1972
- // ✅ Signin flow
1973
- // ✅ Session management
1974
- // ✅ Password reset
1975
- // ✅ Email verification
1976
- // ✅ Role-based authorization
1977
- ```
1978
-
1979
- **Migration Safety:**
1980
-
1981
- 1. **Phase 2 (ConvexProvider):** Run auth tests - should pass unchanged
1982
- 2. **Phase 3 (Service Layer):** Run auth tests - should pass with new services
1983
- 3. **Phase 5 (Component Migration):** Run auth tests after each page migration
1984
- 4. **Phase 6 (Remove Convex):** Run auth tests - final verification
1985
-
1986
- **If auth tests fail at any phase:** STOP, investigate, fix before continuing.
1987
-
1988
- ---
1989
-
1990
- ### 1. Backend API Tests
1991
-
1992
- ```typescript
1993
- // backend/api/__tests__/tokens.test.ts
1994
- import { describe, it, expect } from "vitest";
1995
- import app from "../index";
1996
-
1997
- describe("Tokens API", () => {
1998
- it("should require API key", async () => {
1999
- const res = await app.request("/api/v1/tokens/123");
2000
- expect(res.status).toBe(401);
2001
- });
2002
-
2003
- it("should fetch token with valid key", async () => {
2004
- const res = await app.request("/api/v1/tokens/123", {
2005
- headers: {
2006
- Authorization: `Bearer ${process.env.TEST_API_KEY}`,
2007
- },
2008
- });
2009
- expect(res.status).toBe(200);
2010
- });
2011
-
2012
- it("should enforce org isolation", async () => {
2013
- const res = await app.request("/api/v1/tokens/org-b-token", {
2014
- headers: {
2015
- Authorization: `Bearer ${process.env.ORG_A_API_KEY}`,
2016
- },
2017
- });
2018
- expect(res.status).toBe(403);
2019
- });
2020
- });
2021
- ```
2022
-
2023
- ### 2. Frontend Integration Tests
2024
-
2025
- ```typescript
2026
- // frontend/src/lib/api/__tests__/client.test.ts
2027
- import { describe, it, expect, vi } from "vitest";
2028
- import { ApiClient } from "../client";
2029
-
2030
- describe("ApiClient", () => {
2031
- it("should add Authorization header", async () => {
2032
- const fetchMock = vi.fn().mockResolvedValue({
2033
- ok: true,
2034
- json: async () => ({ id: "123" }),
2035
- });
2036
- global.fetch = fetchMock;
2037
-
2038
- const client = new ApiClient("sk_test_123");
2039
- await client.tokens.get("123");
2040
-
2041
- expect(fetchMock).toHaveBeenCalledWith(
2042
- expect.any(String),
2043
- expect.objectContaining({
2044
- headers: expect.objectContaining({
2045
- Authorization: "Bearer sk_test_123",
2046
- }),
2047
- }),
2048
- );
2049
- });
2050
-
2051
- it("should throw ApiError on failure", async () => {
2052
- global.fetch = vi.fn().mockResolvedValue({
2053
- ok: false,
2054
- status: 404,
2055
- json: async () => ({ error: "Not found" }),
2056
- });
2057
-
2058
- const client = new ApiClient("sk_test_123");
2059
- await expect(client.tokens.get("999")).rejects.toThrow("Not found");
2060
- });
2061
- });
2062
- ```
2063
-
2064
- ---
2065
-
2066
- ## Deployment Changes
2067
-
2068
- ### Before (Coupled)
2069
-
2070
- ```
2071
- 1. Deploy frontend to Cloudflare Pages
2072
- - Includes Convex SDK
2073
- - WebSocket connection to Convex
2074
-
2075
- 2. Deploy Convex backend
2076
- - convex deploy
2077
- ```
2078
-
2079
- ### After (Separated)
2080
-
2081
- ```
2082
- 1. Deploy backend API to Cloudflare Workers
2083
- - cd backend/api
2084
- - wrangler deploy
2085
- - Output: https://api.yourdomain.com
2086
-
2087
- 2. Deploy Convex backend
2088
- - cd backend/convex
2089
- - convex deploy
2090
- - Output: https://your-deployment.convex.cloud
2091
-
2092
- 3. Deploy frontend to Cloudflare Pages
2093
- - cd frontend
2094
- - Set env: PUBLIC_API_URL=https://api.yourdomain.com
2095
- - Set env: PUBLIC_API_KEY=pk_live_xxx
2096
- - Build and deploy
2097
- ```
2098
-
2099
- ### Environment Variables
2100
-
2101
- **Backend (`backend/api/.env`):**
2102
-
2103
- ```bash
2104
- CONVEX_URL=https://your-deployment.convex.cloud
2105
- FRONTEND_URL=https://yourdomain.com
2106
- ```
2107
-
2108
- **Frontend (`frontend/.env`):**
2109
-
2110
- ```bash
2111
- PUBLIC_API_URL=https://api.yourdomain.com
2112
- PUBLIC_API_KEY=pk_live_1234567890abcdef
2113
- ```
2114
-
2115
- ---
2116
-
2117
- ## Security Considerations
2118
-
2119
- ### 1. API Key Storage
2120
-
2121
- **❌ Never:**
2122
-
2123
- - Store API keys in git
2124
- - Use secret keys (`sk_*`) in frontend
2125
- - Log API keys in console
2126
- - Return key hash in API responses
2127
-
2128
- **✅ Always:**
2129
-
2130
- - Use publishable keys (`pk_*`) in frontend
2131
- - Use secret keys (`sk_*`) only in backend
2132
- - Hash keys before storing (SHA-256)
2133
- - Show plaintext key only once at creation
2134
- - Rotate keys regularly
2135
-
2136
- ### 2. Rate Limiting
2137
-
2138
- **Implementation:**
2139
-
2140
- ```typescript
2141
- // backend/api/middleware/rateLimit.ts
2142
- import { Context, Next } from "hono";
2143
-
2144
- const rateLimitMap = new Map<string, { count: number; resetAt: number }>();
2145
-
2146
- export async function rateLimit(c: Context, next: Next) {
2147
- const keyId = c.get("apiKeyId");
2148
- const limit = c.get("keyRateLimit");
2149
-
2150
- const now = Date.now();
2151
- const key = `rate_limit:${keyId}`;
2152
- const current = rateLimitMap.get(key);
2153
-
2154
- if (current && now < current.resetAt) {
2155
- if (current.count >= limit.requests) {
2156
- return c.json(
2157
- {
2158
- error: "Rate limit exceeded",
2159
- resetAt: new Date(current.resetAt).toISOString(),
2160
- },
2161
- 429,
2162
- );
2163
- }
2164
- current.count++;
2165
- } else {
2166
- rateLimitMap.set(key, {
2167
- count: 1,
2168
- resetAt: now + limit.period * 1000,
2169
- });
2170
- }
2171
-
2172
- await next();
2173
- }
2174
- ```
2175
-
2176
- ### 3. CORS Configuration
2177
-
2178
- **Backend:**
2179
-
2180
- ```typescript
2181
- app.use(
2182
- "/api/*",
2183
- cors({
2184
- origin: (origin) => {
2185
- // Allow specific domains
2186
- const allowed = [
2187
- "http://localhost:4321",
2188
- "https://yourdomain.com",
2189
- "https://*.pages.dev",
2190
- ];
2191
-
2192
- return allowed.some((pattern) =>
2193
- new RegExp(pattern.replace("*", ".*")).test(origin),
2194
- )
2195
- ? origin
2196
- : null;
2197
- },
2198
- credentials: true,
2199
- }),
2200
- );
2201
- ```
2202
-
2203
- ---
2204
-
2205
- ## Migration Checklist
2206
-
2207
- ### Backend Setup
2208
-
2209
- - [ ] Add `api_key` entity type to schema
2210
- - [ ] Create API key queries in `backend/convex/queries/apiKeys.ts`
2211
- - [ ] Create API key mutations in `backend/convex/mutations/apiKeys.ts`
2212
- - [ ] Deploy schema changes to Convex
2213
- - [ ] Create test API key via mutation
2214
- - [ ] Create `backend/api/` directory structure
2215
- - [ ] Implement Hono routes for all resources
2216
- - [ ] Add API key validation middleware
2217
- - [ ] Add rate limiting middleware
2218
- - [ ] Add CORS middleware
2219
- - [ ] Deploy API to Cloudflare Workers
2220
- - [ ] Test all endpoints with Postman/curl
2221
- - [ ] Set up monitoring and logging
2222
-
2223
- ### Frontend Setup
2224
-
2225
- - [ ] Create `frontend/src/lib/api/client.ts`
2226
- - [ ] Create `frontend/src/lib/api/types.ts`
2227
- - [ ] Create `frontend/src/lib/api/errors.ts`
2228
- - [ ] Add `PUBLIC_API_URL` to `.env`
2229
- - [ ] Add `PUBLIC_API_KEY` to `.env`
2230
- - [ ] Update 1 page to test API client
2231
- - [ ] Verify API client works in development
2232
- - [ ] Migrate all pages to use API client
2233
- - [ ] Remove all Convex imports from components
2234
- - [ ] Delete `frontend/convex/` directory
2235
- - [ ] Remove Convex from `package.json`
2236
- - [ ] Update build process
2237
- - [ ] Test full frontend in production
2238
-
2239
- ### Documentation
2240
-
2241
- - [ ] Update `CLAUDE.md` with new architecture
2242
- - [ ] Document API endpoints (OpenAPI/Swagger)
2243
- - [ ] Create API key management guide
2244
- - [ ] Update deployment instructions
2245
- - [ ] Create troubleshooting guide
2246
-
2247
- ---
2248
-
2249
- ## Rollback Plan
2250
-
2251
- **Key Safety:** We're wrapping a working system, so rollback just means removing the wrapper.
2252
-
2253
- If migration encounters issues, rollback is straightforward:
2254
-
2255
- **Option 1: Gradual Rollback (Keep Both)**
2256
-
2257
- ```typescript
2258
- // Keep both Convex hooks and Effect.ts services temporarily
2259
- // Migrate page by page, test thoroughly
2260
-
2261
- // Old page (still works)
2262
- const courses = useQuery(api.queries.things.list, { type: "course" });
2263
-
2264
- // New page (backend-agnostic)
2265
- const program = Effect.gen(function* () {
2266
- const thingService = yield* ThingService;
2267
- return yield* thingService.list("course", orgId);
2268
- });
2269
- ```
2270
-
2271
- **Option 2: Quick Rollback (Revert Provider)**
2272
-
2273
- ```typescript
2274
- // Change provider back to direct Convex hooks if needed
2275
- // In astro.config.ts:
2276
- provider: convexProvider({ url: env.PUBLIC_CONVEX_URL }); // Keep this working
2277
-
2278
- // Frontend components still work with ConvexProvider
2279
- // Just wraps the same Convex queries/mutations
2280
- ```
2281
-
2282
- **Key Safety:**
2283
-
2284
- - ConvexProvider just wraps existing Convex backend
2285
- - No data migration needed
2286
- - No backend changes required
2287
- - Worst case: remove DataProvider layer, use Convex directly again
2288
-
2289
- ---
2290
-
2291
- ## Success Metrics
2292
-
2293
- **Critical Requirements (Must Pass):**
2294
-
2295
- - [ ] All existing auth tests in `frontend/tests/auth/*` pass
2296
- - [ ] Auth functionality unchanged (signup, signin, sessions, password reset, etc.)
2297
- - [ ] No regressions in user-facing features
2298
- - [ ] Zero downtime during migration
2299
-
2300
- **Technical Goals:**
2301
-
2302
- - [ ] Frontend uses DataProvider interface (backend-agnostic)
2303
- - [ ] Can swap from Convex → WordPress by changing ONE line
2304
- - [ ] Can swap from WordPress → Notion by changing ONE line
2305
- - [ ] Effect.ts services handle all 66 thing types generically
2306
- - [ ] No direct backend imports in frontend components
2307
- - [ ] Full type safety maintained with Effect.ts
2308
-
2309
- **Backend Flexibility:**
2310
-
2311
- - [ ] ConvexProvider fully implements DataProvider interface
2312
- - [ ] Organizations can choose their preferred backend
2313
- - [ ] At least 2 provider implementations working (e.g., Convex + WordPress)
2314
- - [ ] Multi-tenancy works across all providers
2315
- - [ ] Authorization enforced by backend (not frontend)
2316
-
2317
- **Developer Experience:**
2318
-
2319
- - [ ] Frontend developers don't need backend-specific knowledge
2320
- - [ ] Adding new provider takes 1-2 weeks (not months)
2321
- - [ ] Frontend components work unchanged when backend swaps
2322
- - [ ] Clear documentation for implementing new providers
2323
- - [ ] Effect.ts patterns are consistent and learnable
2324
-
2325
- ---
2326
-
2327
- ## Timeline
2328
-
2329
- **Total Duration:** 4-6 weeks (Backend-Agnostic Approach)
2330
-
2331
- **Week 1:** Define DataProvider interface + Implement ConvexProvider wrapper
2332
- **Week 2:** Create Effect.ts service layer + useEffectRunner hook
2333
- **Week 3-4:** Migrate frontend components to use services (page by page)
2334
- **Week 5:** Remove direct Convex imports + Test thoroughly
2335
- **Week 6 (Optional):** Add alternative provider (WordPress, Notion, etc.) to prove flexibility
2336
-
2337
- **Comparison to Old Plan:**
2338
-
2339
- - ✅ Faster (4-6 weeks vs 6-8 weeks)
2340
- - ✅ Less risky (no REST API to build)
2341
- - ✅ More value (true backend flexibility, not just REST)
2342
- - ✅ Organizations can use existing infrastructure immediately
2343
-
2344
- ---
2345
-
2346
- ## Next Steps
2347
-
2348
- 1. **Review this plan** with team - focus on DataProvider pattern benefits
2349
- 2. **Study references:**
2350
- - Read `one/knowledge/ontology-frontend.md` (DataProvider architecture)
2351
- - Review Astro's content layer pattern (inspiration for DataProvider)
2352
- - Understand Effect.ts basics (type-safe composable services)
2353
- 3. **Begin Phase 1:** Create DataProvider interface
2354
- - Define the 6-dimension interface
2355
- - Document expected behavior for each method
2356
- - Define error types (ThingNotFoundError, etc.)
2357
- 4. **Begin Phase 2:** Implement ConvexProvider
2358
- - Wrap existing Convex queries/mutations
2359
- - Test provider in isolation
2360
- - Verify no functionality lost
2361
-
2362
- ---
2363
-
2364
- ## When to Implement This Plan
2365
-
2366
- **DO migrate when:**
2367
-
2368
- - ✅ You need to support organizations with existing WordPress/Notion/Supabase infrastructure
2369
- - ✅ You want to enable multi-backend federation (e.g., auth in Convex + blog in WordPress)
2370
- - ✅ You're building mobile/desktop apps and want backend flexibility
2371
- - ✅ You want to reduce Convex lock-in for customer acquisition
2372
- - ✅ You have 4-6 weeks for strategic enhancement work
2373
-
2374
- **DON'T migrate yet if:**
2375
-
2376
- - ❌ You need to ship urgent features (migration is strategic, not urgent)
2377
- - ❌ Current Convex integration is causing actual problems (it's not - it works)
2378
- - ❌ You have less than 4 weeks available (rushed migration = bugs)
2379
- - ❌ Auth tests aren't stable yet (fix tests first, then migrate)
2380
-
2381
- **Current Recommendation:** Keep existing Convex integration until you have:
2382
-
2383
- 1. A concrete customer requesting WordPress/Notion/Supabase support
2384
- 2. 4-6 weeks of uninterrupted development time
2385
- 3. All existing auth tests passing reliably
2386
- 4. Clear business value from backend flexibility
2387
-
2388
- **The current system works. Don't fix what isn't broken unless the strategic value justifies the effort.**
2389
-
2390
- ---
2391
-
2392
- ## Questions to Resolve
2393
-
2394
- 1. **Real-Time Support:** Should DataProvider interface include `subscriptions` methods? (Optional - not all backends support it)
2395
- 2. **Provider Discovery:** Should providers register themselves, or explicit imports?
2396
- 3. **Error Handling:** Standardize error types across all providers, or allow provider-specific errors?
2397
- 4. **Provider Versioning:** How to handle breaking changes in provider implementations?
2398
- 5. **Performance:** Should DataProvider support caching/batching at interface level?
2399
-
2400
- ---
2401
-
2402
- ## Conclusion
2403
-
2404
- ### Starting Point: Working System
2405
-
2406
- **What we have today:**
2407
-
2408
- - ✅ Frontend connected to Convex backend (working)
2409
- - ✅ Auth fully functional with passing tests
2410
- - ✅ Real-time updates via Convex WebSockets
2411
- - ✅ 6-dimension ontology implemented
2412
- - ✅ All features operational
2413
-
2414
- **This is a solid foundation.** We're not fixing broken code - we're adding strategic capabilities.
2415
-
2416
- ### The Transformation
2417
-
2418
- This **backend-agnostic separation** transforms ONE from a tightly-coupled (but working) monolith into a truly flexible platform where:
2419
-
2420
- ### Key Wins
2421
-
2422
- **🎯 For Organizations:**
2423
-
2424
- - ✅ Use your existing infrastructure (WordPress, Notion, Supabase, etc.)
2425
- - ✅ No forced migration to Convex
2426
- - ✅ Keep your existing admin tools, plugins, workflows
2427
- - ✅ Test ONE frontend without backend risk
2428
- - ✅ Migrate backend later if/when you want
2429
-
2430
- **🎯 For Developers:**
2431
-
2432
- - ✅ Frontend devs learn DataProvider interface once, work with any backend
2433
- - ✅ Backend devs can use their preferred stack
2434
- - ✅ No vendor lock-in
2435
- - ✅ Effect.ts provides type-safe, composable operations
2436
- - ✅ Clear separation: frontend renders, backend manages data
2437
-
2438
- **🎯 For ONE Platform:**
2439
-
2440
- - ✅ Serve organizations with diverse infrastructure needs
2441
- - ✅ Prove the 6-dimension ontology is universal (works with ANY backend)
2442
- - ✅ Attract organizations who would never adopt Convex
2443
- - ✅ Position as frontend layer, not full-stack lock-in
2444
-
2445
- ### The Breakthrough
2446
-
2447
- Instead of building a **REST API** (still Convex-specific), we built a **universal data interface**:
2448
-
2449
- ```
2450
- OLD PLAN: Convex → Hono REST API → Frontend
2451
- ❌ Still coupled to Convex backend
2452
- ❌ REST API is just another layer to maintain
2453
-
2454
- NEW PLAN: ANY Backend → DataProvider → Frontend
2455
- ✅ True backend flexibility
2456
- ✅ Organizations use existing infrastructure
2457
- ✅ Swap backends with ONE line change
2458
- ```
2459
-
2460
- ### Implementation Strategy
2461
-
2462
- The key is **gradual migration** with **zero risk**:
2463
-
2464
- 1. **Week 1-2:** Create abstraction layer (DataProvider + ConvexProvider)
2465
- 2. **Week 3-4:** Migrate frontend page by page to use services
2466
- 3. **Week 5:** Remove direct backend imports
2467
- 4. **Week 6+:** Add alternative providers to prove flexibility
2468
-
2469
- At every step, frontend still works. At every step, we can rollback. At every step, we add value.
2470
-
2471
- ### Read More
2472
-
2473
- - **Full Architecture:** See `one/knowledge/ontology-frontend.md`
2474
- - **6-Dimension Ontology:** See `one/knowledge/ontology.md`
2475
- - **Effect.ts Integration:** Frontend guide shows complete patterns
2476
-
2477
- ---
2478
-
2479
- **This is how you build a platform that serves everyone, not just one tech stack.**