oneie 2.0.2 → 2.0.5

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 (459) hide show
  1. package/AGENTS.md +245 -0
  2. package/CLAUDE.md +725 -0
  3. package/LICENSE.md +84 -0
  4. package/README.md +489 -931
  5. package/folders.yaml +78 -17
  6. package/one/.obsidian/app.json +1 -0
  7. package/one/.obsidian/appearance.json +1 -0
  8. package/one/.obsidian/core-plugins.json +33 -0
  9. package/one/.obsidian/workspace.json +211 -0
  10. package/one/connections/a2a.md +551 -0
  11. package/one/connections/acp.md +761 -0
  12. package/one/connections/acps.md +731 -0
  13. package/one/connections/agentkit.md +349 -0
  14. package/one/connections/agui.md +767 -0
  15. package/one/connections/any-backend.md +1702 -0
  16. package/one/connections/ap2.md +998 -0
  17. package/one/connections/api-docs.md +1891 -0
  18. package/one/connections/api.md +2190 -0
  19. package/one/connections/architecture-diagram.md +94 -0
  20. package/one/connections/communications.md +449 -0
  21. package/one/connections/connections.md +339 -0
  22. package/one/connections/copilotkit.md +1559 -0
  23. package/one/connections/cryptonetworks.md +781 -0
  24. package/one/connections/documentation.md +1120 -0
  25. package/one/connections/effect.md +279 -0
  26. package/one/connections/elizaos.md +1290 -0
  27. package/one/connections/inference.md +58 -0
  28. package/one/connections/kyc.md +632 -0
  29. package/one/connections/mcp.md +842 -0
  30. package/one/connections/membership.md +1152 -0
  31. package/one/connections/middleware.md +1067 -0
  32. package/one/connections/multitenant.md +1341 -0
  33. package/one/connections/n8n.md +1015 -0
  34. package/one/connections/patterns.md +89 -0
  35. package/one/connections/protocols.md +279 -0
  36. package/one/connections/relationships.md +107 -0
  37. package/one/connections/schema.md +587 -0
  38. package/one/connections/service-layer.md +550 -0
  39. package/one/connections/structure.md +0 -0
  40. package/one/connections/vectors.md +207 -0
  41. package/one/connections/wordpress.md +1302 -0
  42. package/one/connections/workflow-copy.md +905 -0
  43. package/one/connections/workflow-examples.md +741 -0
  44. package/one/connections/workflow.md +905 -0
  45. package/one/connections/workflows/delegation.md +885 -0
  46. package/one/connections/workflows/frontend.md +1037 -0
  47. package/one/connections/workflows/strategy.md +903 -0
  48. package/one/connections/workflows/tasks.md +698 -0
  49. package/one/connections/x402.md +1249 -0
  50. package/one/events/CASCADE-2-BACKEND-AGNOSTIC.md +412 -0
  51. package/one/events/FEATURE-2-4-COMPLETE.md +302 -0
  52. package/one/events/FEATURE_2_3_COMPLETE.md +575 -0
  53. package/one/events/GROUPS-MIGRATION.md +625 -0
  54. package/one/events/INSTALL-TESTS.md +293 -0
  55. package/one/events/INTEGRATION-ARCHITECTURE.md +561 -0
  56. package/one/events/INTEGRATION-CHECKLIST.md +1234 -0
  57. package/one/events/INTEGRATION-ORCHESTRATION.md +2623 -0
  58. package/one/events/INTEGRATION-SUMMARY.md +653 -0
  59. package/one/events/MIGRATION-REPORT.md +435 -0
  60. package/one/events/MIGRATION.md +69 -0
  61. package/one/events/README-archived.md +519 -0
  62. package/one/events/TEST-SUMMARY.md +393 -0
  63. package/one/events/TESTS-QUICK-REF.md +262 -0
  64. package/one/events/events.md +545 -0
  65. package/one/groups/groups.md +543 -0
  66. package/one/groups/one.md +599 -0
  67. package/one/groups/revenue.md +673 -0
  68. package/one/groups/strategy.md +869 -0
  69. package/one/groups/vision.md +98 -0
  70. package/one/knowledge/CLOUDFLARE_ENV_SETUP.md +49 -0
  71. package/one/knowledge/ai-platform.md +305 -0
  72. package/one/knowledge/architecture-any-backend.md +1366 -0
  73. package/one/knowledge/architecture-diagram.md +94 -0
  74. package/one/knowledge/architecture-frontend.md +930 -0
  75. package/one/knowledge/architecture.md +2077 -0
  76. package/one/knowledge/crypto.md +960 -0
  77. package/one/knowledge/docs/flow.md +0 -0
  78. package/one/knowledge/dsl.md +1660 -0
  79. package/one/knowledge/files.md +2471 -0
  80. package/one/knowledge/frontend.md +1038 -0
  81. package/one/knowledge/hono.md +2109 -0
  82. package/one/knowledge/implementation-examples.md +2536 -0
  83. package/one/knowledge/inference-score.md +159 -0
  84. package/one/knowledge/knowledge.md +642 -0
  85. package/one/knowledge/language.md +980 -0
  86. package/one/knowledge/lessons-learned.md +70 -0
  87. package/one/knowledge/ontology-6-dimensions.md +0 -0
  88. package/one/knowledge/ontology-documentation.md +356 -0
  89. package/one/knowledge/ontology-engineering-specification.md +1292 -0
  90. package/one/knowledge/ontology-engineering.md +1652 -0
  91. package/one/knowledge/ontology-frontend-copy-2.md +1492 -0
  92. package/one/knowledge/ontology-frontend-copy.md +753 -0
  93. package/one/knowledge/ontology-frontend-specifications.md +2188 -0
  94. package/one/knowledge/ontology-frontend.md +2427 -0
  95. package/one/knowledge/ontology-minimal.yaml +299 -0
  96. package/one/knowledge/ontology.md +2830 -0
  97. package/one/knowledge/ontology.md.backup +2822 -0
  98. package/one/knowledge/ontology.yaml +1165 -0
  99. package/one/knowledge/patterns/backend/convex-mutation-pattern.md +100 -0
  100. package/one/knowledge/patterns/backend/convex-query-pattern.md +88 -0
  101. package/one/knowledge/patterns/backend/mutation-template.md +231 -0
  102. package/one/knowledge/patterns/backend/query-template.md +267 -0
  103. package/one/knowledge/patterns/backend/service-template.md +237 -0
  104. package/one/knowledge/patterns/design/component-architecture.md +399 -0
  105. package/one/knowledge/patterns/design/test-driven-design-pattern.md +162 -0
  106. package/one/knowledge/patterns/design/wireframe-template.md +216 -0
  107. package/one/knowledge/patterns/frontend/component-template.md +195 -0
  108. package/one/knowledge/patterns/frontend/form-template.md +276 -0
  109. package/one/knowledge/patterns/frontend/page-template.md +178 -0
  110. package/one/knowledge/patterns/frontend/react-component-pattern.md +128 -0
  111. package/one/knowledge/patterns/test/acceptance-criteria-template.md +378 -0
  112. package/one/knowledge/patterns/test/technical-test-template.md +544 -0
  113. package/one/knowledge/patterns/test/test-driven-pattern.md +140 -0
  114. package/one/knowledge/patterns/test/user-flow-template.md +254 -0
  115. package/one/knowledge/provider-creation-guide.md +1064 -0
  116. package/one/knowledge/quality-loop.md +401 -0
  117. package/one/knowledge/readme.md +131 -0
  118. package/one/knowledge/rules.md +626 -0
  119. package/one/knowledge/score.md +67 -0
  120. package/one/knowledge/specifications.md +855 -0
  121. package/one/knowledge/tags.md +130 -0
  122. package/one/knowledge/todo.md +251 -0
  123. package/one/license.md +84 -0
  124. package/one/people/anthony-o-connell.md +440 -0
  125. package/one/people/people.md +567 -0
  126. package/one/things/CHECKLIST.md +356 -0
  127. package/one/things/ONE.md +510 -0
  128. package/one/things/agents/agent-backend.md +1401 -0
  129. package/one/things/agents/agent-builder.md +955 -0
  130. package/one/things/agents/agent-clean.md +709 -0
  131. package/one/things/agents/agent-clone.md +1341 -0
  132. package/one/things/agents/agent-designer.md +2177 -0
  133. package/one/things/agents/agent-director.md +1508 -0
  134. package/one/things/agents/agent-documenter.md +1049 -0
  135. package/one/things/agents/agent-frontend.md +1119 -0
  136. package/one/things/agents/agent-integrator.md +1192 -0
  137. package/one/things/agents/agent-problem-solver.md +1379 -0
  138. package/one/things/agents/agent-quality.md +1353 -0
  139. package/one/things/agents/agent-sales.md +986 -0
  140. package/one/things/cascade/cascade.yaml +464 -0
  141. package/one/things/cascade/docs/examples/1-1-agent-prompts/design.md +470 -0
  142. package/one/things/cascade/docs/examples/1-1-agent-prompts/tests.md +264 -0
  143. package/one/things/cascade/docs/examples/1-1-agent-prompts.md +486 -0
  144. package/one/things/cascade/docs/examples/1-2-yaml-orchestrator/design.md +497 -0
  145. package/one/things/cascade/docs/examples/1-2-yaml-orchestrator/tests.md +227 -0
  146. package/one/things/cascade/docs/examples/1-2-yaml-orchestrator.md +516 -0
  147. package/one/things/cascade/docs/examples/1-3-event-coordination/design.md +544 -0
  148. package/one/things/cascade/docs/examples/1-3-event-coordination/tests.md +223 -0
  149. package/one/things/cascade/docs/examples/1-3-event-coordination.md +508 -0
  150. package/one/things/cascade/docs/examples/1-4-knowledge-management/design.md +609 -0
  151. package/one/things/cascade/docs/examples/1-4-knowledge-management/tests.md +195 -0
  152. package/one/things/cascade/docs/examples/1-4-knowledge-management.md +577 -0
  153. package/one/things/cascade/docs/examples/1-5-quality-loops/design.md +797 -0
  154. package/one/things/cascade/docs/examples/1-5-quality-loops/tests.md +212 -0
  155. package/one/things/cascade/docs/examples/1-5-quality-loops.md +641 -0
  156. package/one/things/cascade/docs/examples/1-6-numbering-structure/design.md +610 -0
  157. package/one/things/cascade/docs/examples/1-6-numbering-structure/tests.md +213 -0
  158. package/one/things/cascade/docs/examples/1-6-numbering-structure.md +575 -0
  159. package/one/things/cascade/docs/examples/readme.md +222 -0
  160. package/one/things/cascade/docs/getting-started.md +515 -0
  161. package/one/things/cascade/docs/workflow.md +1372 -0
  162. package/one/things/cascade/readme.md +336 -0
  163. package/one/things/cascade/templates/feature-template.md +267 -0
  164. package/one/things/claude/agents/advocacy-activation-manager.md +685 -0
  165. package/one/things/claude/agents/advocacy-campaign-designer.md +663 -0
  166. package/one/things/claude/agents/analyst.md +483 -0
  167. package/one/things/claude/agents/architect.md +480 -0
  168. package/one/things/claude/agents/brand-identity-specialist.md +513 -0
  169. package/one/things/claude/agents/bstp-token-strategist.md +667 -0
  170. package/one/things/claude/agents/builder-repo.md +489 -0
  171. package/one/things/claude/agents/bullstamp-community-builder.md +574 -0
  172. package/one/things/claude/agents/bullstamp-marketing-orchestrator.md +506 -0
  173. package/one/things/claude/agents/bulltilt-platform-growth.md +567 -0
  174. package/one/things/claude/agents/company-bullstamp-character.md +587 -0
  175. package/one/things/claude/agents/company-bullstamp-community.md +292 -0
  176. package/one/things/claude/agents/company-bullstamp-marketing.md +292 -0
  177. package/one/things/claude/agents/company-bullstamp-token.md +292 -0
  178. package/one/things/claude/agents/company-bulltilt-growth.md +292 -0
  179. package/one/things/claude/agents/content-bibliography-formatter.md +381 -0
  180. package/one/things/claude/agents/content-calendar-planner.md +448 -0
  181. package/one/things/claude/agents/content-chapter-formatter.md +488 -0
  182. package/one/things/claude/agents/content-formatter.md +546 -0
  183. package/one/things/claude/agents/content-hook-specialist.md +462 -0
  184. package/one/things/claude/agents/content-image-formatter.md +535 -0
  185. package/one/things/claude/agents/content-introduction-formatter.md +485 -0
  186. package/one/things/claude/agents/content-multiplication-engine.md +556 -0
  187. package/one/things/claude/agents/content-playbook-writer.md +448 -0
  188. package/one/things/claude/agents/content-team-manager.md +622 -0
  189. package/one/things/claude/agents/content-toc-formatter.md +522 -0
  190. package/one/things/claude/agents/convex-backend-specialist.md +2561 -0
  191. package/one/things/claude/agents/core-manager.md +582 -0
  192. package/one/things/claude/agents/core-master.md +403 -0
  193. package/one/things/claude/agents/cross-functional-manager.md +471 -0
  194. package/one/things/claude/agents/crypto-airdrop-strategist.md +602 -0
  195. package/one/things/claude/agents/crypto-analytics-educator.md +553 -0
  196. package/one/things/claude/agents/crypto-architecture-specialist.md +466 -0
  197. package/one/things/claude/agents/crypto-community-analyst.md +298 -0
  198. package/one/things/claude/agents/crypto-community-psychologist.md +509 -0
  199. package/one/things/claude/agents/crypto-dex-optimization-expert.md +538 -0
  200. package/one/things/claude/agents/crypto-dex-optimizer.md +292 -0
  201. package/one/things/claude/agents/crypto-diamond-formation-specialist.md +513 -0
  202. package/one/things/claude/agents/crypto-diamond-hands.md +292 -0
  203. package/one/things/claude/agents/crypto-ecosystem-expansion-manager.md +554 -0
  204. package/one/things/claude/agents/crypto-engagement-specialist.md +540 -0
  205. package/one/things/claude/agents/crypto-market-researcher.md +292 -0
  206. package/one/things/claude/agents/crypto-marketing-orchestrator.md +523 -0
  207. package/one/things/claude/agents/crypto-network-effect-amplifier.md +569 -0
  208. package/one/things/claude/agents/crypto-optimization-analyst.md +554 -0
  209. package/one/things/claude/agents/crypto-strategic-synthesizer.md +517 -0
  210. package/one/things/claude/agents/crypto-team-manager.md +387 -0
  211. package/one/things/claude/agents/crypto-token-analyst.md +278 -0
  212. package/one/things/claude/agents/crypto-viral-content-creator.md +546 -0
  213. package/one/things/claude/agents/crypto-wallet-identification-expert.md +517 -0
  214. package/one/things/claude/agents/crypto-wallet-identifier.md +292 -0
  215. package/one/things/claude/agents/customer-journey-designer.md +481 -0
  216. package/one/things/claude/agents/customer-success-manager.md +581 -0
  217. package/one/things/claude/agents/dev.md +413 -0
  218. package/one/things/claude/agents/documenter.md +546 -0
  219. package/one/things/claude/agents/elevate-marketing-orchestrator.md +410 -0
  220. package/one/things/claude/agents/engagement-specialist.md +509 -0
  221. package/one/things/claude/agents/engineering-architect.md +387 -0
  222. package/one/things/claude/agents/engineering-business-analyst.md +537 -0
  223. package/one/things/claude/agents/engineering-developer.md +387 -0
  224. package/one/things/claude/agents/engineering-director.md +282 -0
  225. package/one/things/claude/agents/engineering-ingestor.md +649 -0
  226. package/one/things/claude/agents/engineering-product-manager.md +537 -0
  227. package/one/things/claude/agents/engineering-product-owner.md +537 -0
  228. package/one/things/claude/agents/engineering-project-coordinator.md +537 -0
  229. package/one/things/claude/agents/engineering-quality-assurance.md +393 -0
  230. package/one/things/claude/agents/engineering-team-manager.md +512 -0
  231. package/one/things/claude/agents/engineering-user-experience.md +387 -0
  232. package/one/things/claude/agents/framework-elevate-manager.md +294 -0
  233. package/one/things/claude/agents/improver.md +763 -0
  234. package/one/things/claude/agents/intelligence-team-manager.md +385 -0
  235. package/one/things/claude/agents/lead-capture-expert.md +466 -0
  236. package/one/things/claude/agents/lead-magnet-creator.md +453 -0
  237. package/one/things/claude/agents/market-research-analyst.md +412 -0
  238. package/one/things/claude/agents/marketing-brand-identity.md +314 -0
  239. package/one/things/claude/agents/marketing-content-hooks.md +450 -0
  240. package/one/things/claude/agents/marketing-content-multiplier.md +326 -0
  241. package/one/things/claude/agents/marketing-content-poster.md +361 -0
  242. package/one/things/claude/agents/marketing-customer-journey.md +326 -0
  243. package/one/things/claude/agents/marketing-director.md +397 -0
  244. package/one/things/claude/agents/marketing-engagement.md +326 -0
  245. package/one/things/claude/agents/marketing-lead-capture.md +326 -0
  246. package/one/things/claude/agents/marketing-lead-magnet.md +326 -0
  247. package/one/things/claude/agents/marketing-network-effects.md +326 -0
  248. package/one/things/claude/agents/marketing-nurture-campaigns.md +326 -0
  249. package/one/things/claude/agents/marketing-share-optimizer.md +326 -0
  250. package/one/things/claude/agents/marketing-team-manager.md +446 -0
  251. package/one/things/claude/agents/marketing-viral-growth.md +201 -0
  252. package/one/things/claude/agents/mission-commander.md +373 -0
  253. package/one/things/claude/agents/network-effect-analyst.md +587 -0
  254. package/one/things/claude/agents/nextjs-15-specialist.md +1547 -0
  255. package/one/things/claude/agents/npx.md +890 -0
  256. package/one/things/claude/agents/nurture-campaign-manager.md +531 -0
  257. package/one/things/claude/agents/one-master.md +355 -0
  258. package/one/things/claude/agents/one-orchestrator.md +315 -0
  259. package/one/things/claude/agents/one.md +601 -0
  260. package/one/things/claude/agents/playbook-generator.md +503 -0
  261. package/one/things/claude/agents/pm.md +326 -0
  262. package/one/things/claude/agents/po.md +345 -0
  263. package/one/things/claude/agents/qa.md +336 -0
  264. package/one/things/claude/agents/research-foundation-analyst.md +307 -0
  265. package/one/things/claude/agents/research-intelligence-gatherer.md +408 -0
  266. package/one/things/claude/agents/research-market-analyst.md +307 -0
  267. package/one/things/claude/agents/research-team-manager.md +482 -0
  268. package/one/things/claude/agents/sales-environment-optimizer.md +494 -0
  269. package/one/things/claude/agents/sales-team-manager.md +400 -0
  270. package/one/things/claude/agents/sales-upsell-strategist.md +307 -0
  271. package/one/things/claude/agents/service-advocacy-campaigns.md +307 -0
  272. package/one/things/claude/agents/service-advocacy-manager.md +307 -0
  273. package/one/things/claude/agents/service-success-manager.md +307 -0
  274. package/one/things/claude/agents/service-team-manager.md +400 -0
  275. package/one/things/claude/agents/shadcn-ui-design-system-specialist.md +2302 -0
  276. package/one/things/claude/agents/share-optimization-specialist.md +551 -0
  277. package/one/things/claude/agents/sm.md +327 -0
  278. package/one/things/claude/agents/story-teller.md +473 -0
  279. package/one/things/claude/agents/task-master.md +596 -0
  280. package/one/things/claude/agents/tauri-cross-platform-specialist.md +1827 -0
  281. package/one/things/claude/agents/tester.md +556 -0
  282. package/one/things/claude/agents/the-bull-character-manager.md +580 -0
  283. package/one/things/claude/agents/tools-playbook-generator.md +489 -0
  284. package/one/things/claude/agents/turbo-repo-builder.md +316 -0
  285. package/one/things/claude/agents/upsell-strategist.md +480 -0
  286. package/one/things/claude/agents/ux-expert.md +335 -0
  287. package/one/things/claude/agents/viral-growth-orchestrator.md +497 -0
  288. package/one/things/claude/claude-code-hooks-development.json +21 -0
  289. package/one/things/claude/claude-code-hooks-production.json +21 -0
  290. package/one/things/claude/claude-code-hooks.json +25 -0
  291. package/one/things/claude/commands/agent.md +104 -0
  292. package/one/things/claude/commands/cascade-status.md +128 -0
  293. package/one/things/claude/commands/ingest.md +290 -0
  294. package/one/things/claude/commands/ingestor.md +136 -0
  295. package/one/things/claude/commands/mission.md +83 -0
  296. package/one/things/claude/commands/npx.md +133 -0
  297. package/one/things/claude/commands/one.md +440 -0
  298. package/one/things/claude/commands/quality-check.md +204 -0
  299. package/one/things/claude/commands/smart-route.md +220 -0
  300. package/one/things/claude/commands/start.md +121 -0
  301. package/one/things/claude/commands/story.md +83 -0
  302. package/one/things/claude/commands/task.md +173 -0
  303. package/one/things/claude/hook-bypass.json +32 -0
  304. package/one/things/claude/hooks/agent-hook-config.json +427 -0
  305. package/one/things/claude/hooks/agent-hook-manager.js +525 -0
  306. package/one/things/claude/hooks/agent-load-balancer.js +271 -0
  307. package/one/things/claude/hooks/agent-request-interceptor.js +70 -0
  308. package/one/things/claude/hooks/build-hook.sh +156 -0
  309. package/one/things/claude/hooks/cascade-feedback.js +297 -0
  310. package/one/things/claude/hooks/cascade-integration-hooks.js +648 -0
  311. package/one/things/claude/hooks/cleanup-hook.sh +201 -0
  312. package/one/things/claude/hooks/continuous-improvement-monitor.js +510 -0
  313. package/one/things/claude/hooks/file-organization-engine.js +427 -0
  314. package/one/things/claude/hooks/file-organization-hook.sh +80 -0
  315. package/one/things/claude/hooks/file-organization-monitor.js +269 -0
  316. package/one/things/claude/hooks/format-hook.sh +43 -0
  317. package/one/things/claude/hooks/hook-bypass.sh +293 -0
  318. package/one/things/claude/hooks/hook-config-manager.js +202 -0
  319. package/one/things/claude/hooks/hook-debouncer.sh +62 -0
  320. package/one/things/claude/hooks/hook-logger.sh +89 -0
  321. package/one/things/claude/hooks/hook-orchestrator.js +662 -0
  322. package/one/things/claude/hooks/hook-performance-report.js +120 -0
  323. package/one/things/claude/hooks/lint-hook.sh +140 -0
  324. package/one/things/claude/hooks/mcp-cascade-integration.js +816 -0
  325. package/one/things/claude/hooks/memory-optimizer.js +510 -0
  326. package/one/things/claude/hooks/notification-hook.sh +204 -0
  327. package/one/things/claude/hooks/ontology-compliance.js +394 -0
  328. package/one/things/claude/hooks/ontology-hook-manager.js +316 -0
  329. package/one/things/claude/hooks/ontology-validation-engine.js +317 -0
  330. package/one/things/claude/hooks/ontology-validation-hook.sh +86 -0
  331. package/one/things/claude/hooks/performance-metrics.json +25 -0
  332. package/one/things/claude/hooks/performance-monitoring-hook.js +422 -0
  333. package/one/things/claude/hooks/quality-scoring-engine.js +834 -0
  334. package/one/things/claude/hooks/security-hook.sh +256 -0
  335. package/one/things/claude/hooks/simple-load-balancer.js +238 -0
  336. package/one/things/claude/hooks/startup-optimizer.js +625 -0
  337. package/one/things/claude/hooks/story-scoring-system.js +445 -0
  338. package/one/things/claude/hooks/story-validation-engine.js +473 -0
  339. package/one/things/claude/hooks/story-validation-hook-enhanced.sh +210 -0
  340. package/one/things/claude/hooks/story-validation-hook.sh +145 -0
  341. package/one/things/claude/hooks/structure-synchronizer.js +194 -0
  342. package/one/things/claude/hooks/sub-agent-output-validator.js +647 -0
  343. package/one/things/claude/hooks/sub-agent-validation-hook.js +343 -0
  344. package/one/things/claude/hooks/test-hook.sh +145 -0
  345. package/one/things/claude/hooks/test-story-validation.sh +170 -0
  346. package/one/things/claude/hooks/trinity-validation-system.js +392 -0
  347. package/one/things/claude/settings-local.json +86 -0
  348. package/one/things/cli/cli-code.md +652 -0
  349. package/one/things/cli/cli-compiler-code.md +652 -0
  350. package/one/things/cli/cli.md +1068 -0
  351. package/one/things/components/card-shadcn.md +929 -0
  352. package/one/things/components/card.md +1050 -0
  353. package/one/things/components.md +1669 -0
  354. package/one/things/componets.md +4 -0
  355. package/one/things/creator-diagram.md +166 -0
  356. package/one/things/examples/children/lemonade-stand.md +366 -0
  357. package/one/things/examples/enterprise/crm-saas.md +1429 -0
  358. package/one/things/features/1-1-agent-prompts/design.md +470 -0
  359. package/one/things/features/1-1-agent-prompts/tests.md +264 -0
  360. package/one/things/features/1-1-agent-prompts.md +486 -0
  361. package/one/things/features/1-2-yaml-orchestrator/design.md +497 -0
  362. package/one/things/features/1-2-yaml-orchestrator/tests.md +227 -0
  363. package/one/things/features/1-2-yaml-orchestrator.md +516 -0
  364. package/one/things/features/1-3-event-coordination/design.md +544 -0
  365. package/one/things/features/1-3-event-coordination/tests.md +223 -0
  366. package/one/things/features/1-3-event-coordination.md +508 -0
  367. package/one/things/features/1-4-knowledge-management/design.md +609 -0
  368. package/one/things/features/1-4-knowledge-management/tests.md +195 -0
  369. package/one/things/features/1-4-knowledge-management.md +577 -0
  370. package/one/things/features/1-5-quality-loops/design.md +797 -0
  371. package/one/things/features/1-5-quality-loops/tests.md +212 -0
  372. package/one/things/features/1-5-quality-loops.md +641 -0
  373. package/one/things/features/1-6-numbering-structure/design.md +610 -0
  374. package/one/things/features/1-6-numbering-structure/tests.md +213 -0
  375. package/one/things/features/1-6-numbering-structure.md +575 -0
  376. package/one/things/features/2-1-dataprovider-interface.md +2358 -0
  377. package/one/things/features/2-2-config-system.md +3075 -0
  378. package/one/things/features/2-3-effectts-services.md +1498 -0
  379. package/one/things/features/2-4-react-hooks.md +2120 -0
  380. package/one/things/features/2-5-auth-migration.md +2046 -0
  381. package/one/things/features/2-6-dashboard-migration.md +1985 -0
  382. package/one/things/features/2-7-alternative-providers.md +2505 -0
  383. package/one/things/features/2-7-implementation-report.md +680 -0
  384. package/one/things/features/2-cli.md +1235 -0
  385. package/one/things/features/2-design.md +1738 -0
  386. package/one/things/features/2-tests.md +520 -0
  387. package/one/things/features/AUTH_HOOKS_IMPLEMENTATION.md +521 -0
  388. package/one/things/features/DECOUPLING.md +272 -0
  389. package/one/things/features/DEPLOYMENT.md +452 -0
  390. package/one/things/features/IMPLEMENTATION_SUMMARY.md +316 -0
  391. package/one/things/features/dataprovider-interface/1-tests.md +1522 -0
  392. package/one/things/features/improve.md +843 -0
  393. package/one/things/features/remove-convex-deps.md +45 -0
  394. package/one/things/features/top-features.md +79 -0
  395. package/one/things/features/use-one-backend.md +1180 -0
  396. package/one/things/ideas/1-create-workflow.md +189 -0
  397. package/one/things/ideas/2-backend-agnostic-frontend.md +384 -0
  398. package/one/things/plans/1-create-workflow-status.md +555 -0
  399. package/one/things/plans/1-create-workflow.md +713 -0
  400. package/one/things/plans/2-backend-agnostic-frontend.md +543 -0
  401. package/one/things/plans/3-groups.md +502 -0
  402. package/one/things/plans/app.md +761 -0
  403. package/one/things/plans/backend-agnostic-frontend.md +323 -0
  404. package/one/things/plans/better-auth-any-backend-revised.md +1065 -0
  405. package/one/things/plans/better-auth-any-backend.md +1852 -0
  406. package/one/things/plans/better-auth-available-features.md +235 -0
  407. package/one/things/plans/big-plan.md +38 -0
  408. package/one/things/plans/convex-better-auth.md +1109 -0
  409. package/one/things/plans/convex-on-off.md +389 -0
  410. package/one/things/plans/deploy-to-cloudflare.md +581 -0
  411. package/one/things/plans/desktop.md +1121 -0
  412. package/one/things/plans/effect-components.md +1669 -0
  413. package/one/things/plans/effect.md +973 -0
  414. package/one/things/plans/email.md +953 -0
  415. package/one/things/plans/enhance-auth.md +1669 -0
  416. package/one/things/plans/install-components.md +198 -0
  417. package/one/things/plans/landing.md +728 -0
  418. package/one/things/plans/layout.md +205 -0
  419. package/one/things/plans/mail-backend.md +1308 -0
  420. package/one/things/plans/mail.md +2624 -0
  421. package/one/things/plans/next-features.md +83 -0
  422. package/one/things/plans/one.md +658 -0
  423. package/one/things/plans/ontology-6-dimensions.md +2216 -0
  424. package/one/things/plans/ontology-driven-strategy.md +866 -0
  425. package/one/things/plans/ontology-ui-approach.md +357 -0
  426. package/one/things/plans/open-agent.md +785 -0
  427. package/one/things/plans/organizations-to-groups.md +705 -0
  428. package/one/things/plans/performace.md +90 -0
  429. package/one/things/plans/release.md +432 -0
  430. package/one/things/plans/releases.md +809 -0
  431. package/one/things/plans/repos.md +76 -0
  432. package/one/things/plans/separate-copy-2.md +1293 -0
  433. package/one/things/plans/separate-copy-3.md +2458 -0
  434. package/one/things/plans/separate-copy.md +1293 -0
  435. package/one/things/plans/separate.md +1983 -0
  436. package/one/things/plans/shadcn-integration-summary.md +450 -0
  437. package/one/things/plans/sidebar.md +172 -0
  438. package/one/things/plans/small-fixes.md +5 -0
  439. package/one/things/plans/test-backend-connection.md +476 -0
  440. package/one/things/plans/workflow-files.md +1196 -0
  441. package/one/things/plans/workflow.md +1372 -0
  442. package/one/things/products/cascade-landing-page.md +737 -0
  443. package/one/things/products/cascade.md +1518 -0
  444. package/one/things/products/context-engineering.md +1427 -0
  445. package/one/things/products/onthology.md +0 -0
  446. package/one/things/products/ontology-ui-shadcn.md +1280 -0
  447. package/one/things/products/ontology-ui.md +1387 -0
  448. package/one/things/products/ontology.md +717 -0
  449. package/one/things/products/sdk.md +557 -0
  450. package/one/things/promptkit.md +903 -0
  451. package/one/things/service-providers-new.md +982 -0
  452. package/one/things/service-providers.md +1092 -0
  453. package/one/things/system.md +600 -0
  454. package/one/things/tests/2-1-dataprovider-interface.md +1144 -0
  455. package/one/things/tests/2-1-test-analysis.md +496 -0
  456. package/one/things/things.md +349 -0
  457. package/one/things/todo.md +1248 -0
  458. package/one/things/vision/elegant-interface.md +214 -0
  459. package/package.json +5 -2
@@ -0,0 +1,1302 @@
1
+ # Connecting ONE to WordPress Backend
2
+
3
+ **Using WordPress + WooCommerce as your ONE backend**
4
+
5
+ ---
6
+
7
+ ## Executive Summary
8
+
9
+ This guide shows you how to connect the ONE platform frontend to a **WordPress + WooCommerce backend**, turning WordPress into a full-featured backend for the ONE ontology.
10
+
11
+ **What You Get:**
12
+ - ✅ Use existing WordPress infrastructure
13
+ - ✅ Leverage WordPress posts, pages, users, custom post types
14
+ - ✅ WooCommerce for products and e-commerce
15
+ - ✅ WordPress plugins ecosystem
16
+ - ✅ Familiar WordPress admin interface
17
+ - ✅ WordPress REST API as backend
18
+
19
+ **Architecture:**
20
+ ```
21
+ ┌────────────────────────────────────────────────┐
22
+ │ ONE Frontend (Astro + React) │
23
+ │ - Renders UI │
24
+ │ - Calls DataProvider interface │
25
+ │ - Backend-agnostic │
26
+ └────────────────┬───────────────────────────────┘
27
+ │ DataProvider Interface
28
+ ↓
29
+ ┌────────────────────────────────────────────────┐
30
+ │ WordPressProvider │
31
+ │ - Implements DataProvider interface │
32
+ │ - Translates ONE ontology → WordPress API │
33
+ │ - Maps things → posts/pages/products │
34
+ │ - Maps connections → relationships │
35
+ └────────────────┬───────────────────────────────┘
36
+ │ WordPress REST API
37
+ ↓
38
+ ┌────────────────────────────────────────────────┐
39
+ │ WordPress Backend │
40
+ │ - wp_posts (posts, pages, products) │
41
+ │ - wp_postmeta (properties) │
42
+ │ - wp_users (people) │
43
+ │ - wp_term_relationships (connections) │
44
+ │ - wp_comments (events) │
45
+ │ - WooCommerce tables (orders, products) │
46
+ └────────────────────────────────────────────────┘
47
+ ```
48
+
49
+ ---
50
+
51
+ ## Table of Contents
52
+
53
+ 1. [Prerequisites](#prerequisites)
54
+ 2. [WordPress Setup](#wordpress-setup)
55
+ 3. [Authentication](#authentication)
56
+ 4. [Ontology Mapping](#ontology-mapping)
57
+ 5. [WordPressProvider Implementation](#wordpressprovider-implementation)
58
+ 6. [Configuration](#configuration)
59
+ 7. [Usage Examples](#usage-examples)
60
+ 8. [WooCommerce Integration](#woocommerce-integration)
61
+ 9. [Custom Post Types](#custom-post-types)
62
+ 10. [Limitations and Workarounds](#limitations-and-workarounds)
63
+ 11. [Deployment](#deployment)
64
+
65
+ ---
66
+
67
+ ## Prerequisites
68
+
69
+ **WordPress Requirements:**
70
+ - WordPress 5.0+ (REST API built-in)
71
+ - PHP 7.4+
72
+ - WooCommerce 5.0+ (optional, for e-commerce)
73
+ - Application Passwords enabled (WP 5.6+)
74
+
75
+ **Recommended Plugins:**
76
+ - **WooCommerce** - E-commerce functionality
77
+ - **Advanced Custom Fields (ACF)** - Extend post meta (optional)
78
+ - **Custom Post Type UI** - Create custom post types (optional)
79
+ - **JWT Authentication for WP REST API** - Better auth (optional)
80
+
81
+ **Frontend Requirements:**
82
+ - Node.js 18+
83
+ - ONE frontend setup (see ontology-frontend.md)
84
+
85
+ ---
86
+
87
+ ## WordPress Setup
88
+
89
+ ### 1. Enable REST API
90
+
91
+ WordPress REST API is enabled by default in WordPress 5.0+. Test it:
92
+
93
+ ```bash
94
+ # Test your WordPress REST API
95
+ curl https://yoursite.com/wp-json/wp/v2/posts
96
+ ```
97
+
98
+ ### 2. Enable Application Passwords
99
+
100
+ **In WordPress Admin:**
101
+ 1. Go to **Users → Your Profile**
102
+ 2. Scroll to **Application Passwords**
103
+ 3. Enter name: "ONE Platform"
104
+ 4. Click **Add New Application Password**
105
+ 5. **Copy the generated password** (save it securely)
106
+
107
+ ### 3. Install WooCommerce (Optional)
108
+
109
+ ```bash
110
+ # Via WordPress Admin
111
+ Plugins → Add New → Search "WooCommerce" → Install → Activate
112
+
113
+ # Or via WP-CLI
114
+ wp plugin install woocommerce --activate
115
+ ```
116
+
117
+ ### 4. Configure Permalinks
118
+
119
+ **Ensure pretty permalinks are enabled:**
120
+
121
+ WordPress Admin → Settings → Permalinks → Select **Post name**
122
+
123
+ ---
124
+
125
+ ## Authentication
126
+
127
+ ### Method 1: Application Passwords (Recommended)
128
+
129
+ ```typescript
130
+ // frontend/.env
131
+ WORDPRESS_URL=https://yoursite.com
132
+ WORDPRESS_USERNAME=your_username
133
+ WORDPRESS_APP_PASSWORD=xxxx xxxx xxxx xxxx xxxx xxxx
134
+ ```
135
+
136
+ ```typescript
137
+ // frontend/src/providers/wordpress/auth.ts
138
+ export function createAuthHeaders(username: string, password: string) {
139
+ const credentials = btoa(`${username}:${password}`)
140
+ return {
141
+ 'Authorization': `Basic ${credentials}`,
142
+ 'Content-Type': 'application/json'
143
+ }
144
+ }
145
+ ```
146
+
147
+ ### Method 2: JWT Authentication (More Secure)
148
+
149
+ **Install JWT Plugin:**
150
+ ```bash
151
+ wp plugin install jwt-authentication-for-wp-rest-api --activate
152
+ ```
153
+
154
+ **Configure wp-config.php:**
155
+ ```php
156
+ // wp-config.php
157
+ define('JWT_AUTH_SECRET_KEY', 'your-secret-key-here');
158
+ define('JWT_AUTH_CORS_ENABLE', true);
159
+ ```
160
+
161
+ **.htaccess:**
162
+ ```apache
163
+ # Add to .htaccess
164
+ RewriteEngine on
165
+ RewriteCond %{HTTP:Authorization} ^(.*)
166
+ RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1]
167
+ ```
168
+
169
+ **Get JWT Token:**
170
+ ```typescript
171
+ // frontend/src/providers/wordpress/auth.ts
172
+ import { Effect } from 'effect'
173
+
174
+ export function getJWTToken(username: string, password: string) {
175
+ return Effect.tryPromise({
176
+ try: async () => {
177
+ const response = await fetch('https://yoursite.com/wp-json/jwt-auth/v1/token', {
178
+ method: 'POST',
179
+ headers: { 'Content-Type': 'application/json' },
180
+ body: JSON.stringify({ username, password })
181
+ })
182
+
183
+ const data = await response.json()
184
+ return data.token
185
+ },
186
+ catch: (error) => new Error(String(error))
187
+ })
188
+ }
189
+
190
+ export function createJWTHeaders(token: string) {
191
+ return {
192
+ 'Authorization': `Bearer ${token}`,
193
+ 'Content-Type': 'application/json'
194
+ }
195
+ }
196
+ ```
197
+
198
+ ---
199
+
200
+ ## Ontology Mapping
201
+
202
+ **How ONE ontology maps to WordPress:**
203
+
204
+ ### Things → WordPress Content Types
205
+
206
+ | ONE Thing Type | WordPress Type | REST Endpoint | Notes |
207
+ |----------------|----------------|---------------|-------|
208
+ | `post` | Post | `/wp/v2/posts` | Blog posts |
209
+ | `page` | Page | `/wp/v2/pages` | Static pages |
210
+ | `person` | User | `/wp/v2/users` | WordPress users |
211
+ | `product` | WooCommerce Product | `/wc/v3/products` | Requires WooCommerce |
212
+ | `course` | Custom Post Type | `/wp/v2/course` | Create custom type |
213
+ | `lesson` | Custom Post Type | `/wp/v2/lesson` | Create custom type |
214
+ | `event` | Custom Post Type | `/wp/v2/event` | Create custom type |
215
+ | `organization` | Custom Post Type | `/wp/v2/organization` | Create custom type |
216
+
217
+ ### Connections → WordPress Relationships
218
+
219
+ | ONE Connection | WordPress Implementation | Notes |
220
+ |----------------|-------------------------|-------|
221
+ | `created_by` | Post author | `post.author` field |
222
+ | `part_of` | Post parent | `post.parent` field |
223
+ | `tagged_with` | Tags | `post.tags` array |
224
+ | `categorized_as` | Categories | `post.categories` array |
225
+ | `enrolled_in` | User meta | Custom meta: `user_meta.enrolled_courses` |
226
+ | `purchased` | WooCommerce orders | `order.line_items` |
227
+
228
+ ### Events → WordPress Activity
229
+
230
+ | ONE Event Type | WordPress Implementation | Notes |
231
+ |----------------|-------------------------|-------|
232
+ | `thing_created` | Post published | Hook: `publish_post` |
233
+ | `thing_updated` | Post modified | Hook: `save_post` |
234
+ | `thing_viewed` | WP Statistics | Plugin or custom table |
235
+ | `comment_added` | Comments | `wp_comments` table |
236
+ | `user_login` | User login | Hook: `wp_login` |
237
+
238
+ ### Knowledge → WordPress Search
239
+
240
+ | ONE Feature | WordPress Implementation | Notes |
241
+ |-------------|-------------------------|-------|
242
+ | Embeddings | External service | Use Pinecone/Weaviate |
243
+ | Search | WordPress search | `/wp/v2/search` endpoint |
244
+ | Vector search | ElasticSearch | Plugin integration |
245
+
246
+ ---
247
+
248
+ ## WordPressProvider Implementation
249
+
250
+ ### Core Provider Class
251
+
252
+ ```typescript
253
+ // frontend/src/providers/wordpress/WordPressProvider.ts
254
+ import { Effect, Layer } from 'effect'
255
+ import { DataProvider, ThingNotFoundError, ConnectionCreateError } from '../DataProvider'
256
+ import { createAuthHeaders } from './auth'
257
+
258
+ export class WordPressProvider implements DataProvider {
259
+ private headers: Record<string, string>
260
+
261
+ constructor(
262
+ private baseUrl: string,
263
+ private username: string,
264
+ private password: string
265
+ ) {
266
+ this.headers = createAuthHeaders(username, password)
267
+ }
268
+
269
+ things = {
270
+ get: (id: string) =>
271
+ Effect.gen(this, function* () {
272
+ // Determine post type from ID or fetch generically
273
+ const response = yield* Effect.tryPromise({
274
+ try: () =>
275
+ fetch(`${this.baseUrl}/wp-json/wp/v2/posts/${id}`, {
276
+ headers: this.headers
277
+ }),
278
+ catch: (error) => new Error(String(error))
279
+ })
280
+
281
+ if (!response.ok) {
282
+ if (response.status === 404) {
283
+ return yield* Effect.fail(new ThingNotFoundError(id))
284
+ }
285
+ return yield* Effect.fail(new Error(`HTTP ${response.status}`))
286
+ }
287
+
288
+ const post = yield* Effect.tryPromise({
289
+ try: () => response.json(),
290
+ catch: (error) => new Error(String(error))
291
+ })
292
+
293
+ // Transform WordPress post → ONE thing
294
+ return {
295
+ _id: post.id.toString(),
296
+ type: this.mapPostTypeToThingType(post.type),
297
+ name: post.title.rendered,
298
+ properties: {
299
+ content: post.content.rendered,
300
+ excerpt: post.excerpt.rendered,
301
+ slug: post.slug,
302
+ status: post.status,
303
+ author: post.author.toString(),
304
+ featuredImage: post.featured_media,
305
+ categories: post.categories,
306
+ tags: post.tags,
307
+ // Custom fields from ACF or post meta
308
+ ...post.meta
309
+ },
310
+ status: post.status === 'publish' ? 'active' : 'inactive',
311
+ createdAt: new Date(post.date).getTime(),
312
+ updatedAt: new Date(post.modified).getTime(),
313
+ createdBy: post.author.toString()
314
+ }
315
+ }),
316
+
317
+ list: (params) =>
318
+ Effect.gen(this, function* () {
319
+ const endpoint = this.getEndpointForType(params.type)
320
+
321
+ const query = new URLSearchParams({
322
+ per_page: String(params.limit || 10),
323
+ page: String(params.page || 1),
324
+ status: 'publish'
325
+ })
326
+
327
+ // Add filters
328
+ if (params.filters?.author) {
329
+ query.append('author', params.filters.author)
330
+ }
331
+ if (params.filters?.category) {
332
+ query.append('categories', params.filters.category)
333
+ }
334
+ if (params.filters?.search) {
335
+ query.append('search', params.filters.search)
336
+ }
337
+
338
+ const response = yield* Effect.tryPromise({
339
+ try: () =>
340
+ fetch(`${this.baseUrl}/wp-json/${endpoint}?${query}`, {
341
+ headers: this.headers
342
+ }),
343
+ catch: (error) => new Error(String(error))
344
+ })
345
+
346
+ const posts = yield* Effect.tryPromise({
347
+ try: () => response.json(),
348
+ catch: (error) => new Error(String(error))
349
+ })
350
+
351
+ // Transform WordPress posts → ONE things
352
+ return posts.map((post: any) => ({
353
+ _id: post.id.toString(),
354
+ type: params.type,
355
+ name: post.title.rendered,
356
+ properties: {
357
+ excerpt: post.excerpt.rendered,
358
+ slug: post.slug,
359
+ featuredImage: post.featured_media
360
+ },
361
+ status: post.status === 'publish' ? 'active' : 'inactive',
362
+ createdAt: new Date(post.date).getTime(),
363
+ updatedAt: new Date(post.modified).getTime()
364
+ }))
365
+ }),
366
+
367
+ create: (input) =>
368
+ Effect.gen(this, function* () {
369
+ const endpoint = this.getEndpointForType(input.type)
370
+
371
+ const response = yield* Effect.tryPromise({
372
+ try: () =>
373
+ fetch(`${this.baseUrl}/wp-json/${endpoint}`, {
374
+ method: 'POST',
375
+ headers: this.headers,
376
+ body: JSON.stringify({
377
+ title: input.name,
378
+ content: input.properties.content || '',
379
+ excerpt: input.properties.excerpt || '',
380
+ status: 'draft',
381
+ meta: input.properties
382
+ })
383
+ }),
384
+ catch: (error) => new ConnectionCreateError(String(error))
385
+ })
386
+
387
+ if (!response.ok) {
388
+ return yield* Effect.fail(
389
+ new ConnectionCreateError(`Failed to create: ${response.status}`)
390
+ )
391
+ }
392
+
393
+ const post = yield* Effect.tryPromise({
394
+ try: () => response.json(),
395
+ catch: (error) => new ConnectionCreateError(String(error))
396
+ })
397
+
398
+ return post.id.toString()
399
+ }),
400
+
401
+ update: (id, updates) =>
402
+ Effect.gen(this, function* () {
403
+ const endpoint = this.getEndpointForType(updates.type || 'post')
404
+
405
+ yield* Effect.tryPromise({
406
+ try: () =>
407
+ fetch(`${this.baseUrl}/wp-json/${endpoint}/${id}`, {
408
+ method: 'POST',
409
+ headers: this.headers,
410
+ body: JSON.stringify({
411
+ title: updates.name,
412
+ content: updates.properties?.content,
413
+ status: updates.status === 'active' ? 'publish' : 'draft',
414
+ meta: updates.properties
415
+ })
416
+ }),
417
+ catch: (error) => new Error(String(error))
418
+ })
419
+ }),
420
+
421
+ delete: (id) =>
422
+ Effect.gen(this, function* () {
423
+ yield* Effect.tryPromise({
424
+ try: () =>
425
+ fetch(`${this.baseUrl}/wp-json/wp/v2/posts/${id}`, {
426
+ method: 'DELETE',
427
+ headers: this.headers,
428
+ body: JSON.stringify({ force: true })
429
+ }),
430
+ catch: (error) => new Error(String(error))
431
+ })
432
+ })
433
+ }
434
+
435
+ connections = {
436
+ create: (input) =>
437
+ Effect.gen(this, function* () {
438
+ // WordPress connections via relationships
439
+ switch (input.relationshipType) {
440
+ case 'part_of':
441
+ // Use post parent
442
+ yield* Effect.tryPromise({
443
+ try: () =>
444
+ fetch(`${this.baseUrl}/wp-json/wp/v2/posts/${input.fromThingId}`, {
445
+ method: 'POST',
446
+ headers: this.headers,
447
+ body: JSON.stringify({
448
+ parent: parseInt(input.toThingId)
449
+ })
450
+ }),
451
+ catch: (error) => new ConnectionCreateError(String(error))
452
+ })
453
+ return `${input.fromThingId}-${input.toThingId}-parent`
454
+
455
+ case 'tagged_with':
456
+ // Use tags
457
+ const post = yield* this.things.get(input.fromThingId)
458
+ const currentTags = post.properties.tags || []
459
+ yield* Effect.tryPromise({
460
+ try: () =>
461
+ fetch(`${this.baseUrl}/wp-json/wp/v2/posts/${input.fromThingId}`, {
462
+ method: 'POST',
463
+ headers: this.headers,
464
+ body: JSON.stringify({
465
+ tags: [...currentTags, parseInt(input.toThingId)]
466
+ })
467
+ }),
468
+ catch: (error) => new ConnectionCreateError(String(error))
469
+ })
470
+ return `${input.fromThingId}-${input.toThingId}-tag`
471
+
472
+ case 'enrolled_in':
473
+ // Use user meta
474
+ yield* Effect.tryPromise({
475
+ try: () =>
476
+ fetch(`${this.baseUrl}/wp-json/wp/v2/users/${input.fromThingId}`, {
477
+ method: 'POST',
478
+ headers: this.headers,
479
+ body: JSON.stringify({
480
+ meta: {
481
+ enrolled_courses: [input.toThingId]
482
+ }
483
+ })
484
+ }),
485
+ catch: (error) => new ConnectionCreateError(String(error))
486
+ })
487
+ return `${input.fromThingId}-${input.toThingId}-enrollment`
488
+
489
+ default:
490
+ // Store in custom table or post meta
491
+ return yield* this.createCustomConnection(input)
492
+ }
493
+ }),
494
+
495
+ getRelated: (params) =>
496
+ Effect.gen(this, function* () {
497
+ switch (params.relationshipType) {
498
+ case 'part_of':
499
+ // Get children via parent query
500
+ const response = yield* Effect.tryPromise({
501
+ try: () =>
502
+ fetch(
503
+ `${this.baseUrl}/wp-json/wp/v2/posts?parent=${params.thingId}`,
504
+ { headers: this.headers }
505
+ ),
506
+ catch: (error) => new Error(String(error))
507
+ })
508
+ const children = yield* Effect.tryPromise({
509
+ try: () => response.json(),
510
+ catch: (error) => new Error(String(error))
511
+ })
512
+ return children.map((post: any) => this.transformPostToThing(post))
513
+
514
+ case 'tagged_with':
515
+ // Get posts by tag
516
+ const tagResponse = yield* Effect.tryPromise({
517
+ try: () =>
518
+ fetch(
519
+ `${this.baseUrl}/wp-json/wp/v2/posts?tags=${params.thingId}`,
520
+ { headers: this.headers }
521
+ ),
522
+ catch: (error) => new Error(String(error))
523
+ })
524
+ const posts = yield* Effect.tryPromise({
525
+ try: () => tagResponse.json(),
526
+ catch: (error) => new Error(String(error))
527
+ })
528
+ return posts.map((post: any) => this.transformPostToThing(post))
529
+
530
+ default:
531
+ // Query custom connections table
532
+ return []
533
+ }
534
+ }),
535
+
536
+ getCount: (thingId, relationshipType) =>
537
+ Effect.gen(this, function* () {
538
+ const related = yield* this.connections.getRelated({
539
+ thingId,
540
+ relationshipType,
541
+ direction: 'both'
542
+ })
543
+ return related.length
544
+ }),
545
+
546
+ delete: (id) =>
547
+ Effect.gen(this, function* () {
548
+ // Delete connection (implementation depends on storage method)
549
+ // For parent: update post to remove parent
550
+ // For tags: remove tag from post
551
+ // For user meta: remove from meta array
552
+ })
553
+ }
554
+
555
+ events = {
556
+ log: (event) =>
557
+ Effect.gen(this, function* () {
558
+ // Option 1: Use WordPress comments as event log
559
+ yield* Effect.tryPromise({
560
+ try: () =>
561
+ fetch(`${this.baseUrl}/wp-json/wp/v2/comments`, {
562
+ method: 'POST',
563
+ headers: this.headers,
564
+ body: JSON.stringify({
565
+ post: event.targetId,
566
+ author: event.actorId,
567
+ content: JSON.stringify({
568
+ type: event.type,
569
+ metadata: event.metadata
570
+ }),
571
+ meta: {
572
+ event_type: event.type,
573
+ event_metadata: event.metadata
574
+ }
575
+ })
576
+ }),
577
+ catch: (error) => new Error(String(error))
578
+ })
579
+
580
+ // Option 2: Custom REST endpoint with custom table
581
+ // Option 3: External logging service
582
+ }),
583
+
584
+ query: (params) =>
585
+ Effect.gen(this, function* () {
586
+ // Query comments table or custom events table
587
+ const query = new URLSearchParams()
588
+ if (params.actorId) query.append('author', params.actorId)
589
+ if (params.targetId) query.append('post', params.targetId)
590
+
591
+ const response = yield* Effect.tryPromise({
592
+ try: () =>
593
+ fetch(`${this.baseUrl}/wp-json/wp/v2/comments?${query}`, {
594
+ headers: this.headers
595
+ }),
596
+ catch: (error) => new Error(String(error))
597
+ })
598
+
599
+ const comments = yield* Effect.tryPromise({
600
+ try: () => response.json(),
601
+ catch: (error) => new Error(String(error))
602
+ })
603
+
604
+ return comments.map((comment: any) => ({
605
+ _id: comment.id.toString(),
606
+ type: comment.meta.event_type || 'comment_added',
607
+ actorId: comment.author.toString(),
608
+ targetId: comment.post?.toString(),
609
+ metadata: comment.meta.event_metadata || {},
610
+ timestamp: new Date(comment.date).getTime()
611
+ }))
612
+ })
613
+ }
614
+
615
+ knowledge = {
616
+ embed: (params) =>
617
+ Effect.gen(this, function* () {
618
+ // WordPress doesn't have native vector embeddings
619
+ // Option 1: Use external service (Pinecone, Weaviate)
620
+ // Option 2: ElasticSearch plugin
621
+ // Option 3: Store embeddings in post meta, search externally
622
+
623
+ // Example: Store in post meta for later external processing
624
+ yield* Effect.tryPromise({
625
+ try: () =>
626
+ fetch(`${this.baseUrl}/wp-json/wp/v2/posts/${params.sourceThingId}`, {
627
+ method: 'POST',
628
+ headers: this.headers,
629
+ body: JSON.stringify({
630
+ meta: {
631
+ embedding_text: params.text,
632
+ embedding_labels: params.labels
633
+ }
634
+ })
635
+ }),
636
+ catch: (error) => new Error(String(error))
637
+ })
638
+
639
+ return params.sourceThingId
640
+ }),
641
+
642
+ search: (query, limit = 10) =>
643
+ Effect.gen(this, function* () {
644
+ // Use WordPress built-in search
645
+ const response = yield* Effect.tryPromise({
646
+ try: () =>
647
+ fetch(
648
+ `${this.baseUrl}/wp-json/wp/v2/search?search=${encodeURIComponent(query)}&per_page=${limit}`,
649
+ { headers: this.headers }
650
+ ),
651
+ catch: (error) => new Error(String(error))
652
+ })
653
+
654
+ const results = yield* Effect.tryPromise({
655
+ try: () => response.json(),
656
+ catch: (error) => new Error(String(error))
657
+ })
658
+
659
+ return results.map((result: any) => ({
660
+ thingId: result.id.toString(),
661
+ score: 0.9, // WordPress doesn't return relevance scores
662
+ text: result.title,
663
+ metadata: {
664
+ type: result.subtype,
665
+ url: result.url
666
+ }
667
+ }))
668
+ })
669
+ }
670
+
671
+ // Helper methods
672
+ private mapPostTypeToThingType(postType: string): string {
673
+ const mapping: Record<string, string> = {
674
+ 'post': 'post',
675
+ 'page': 'page',
676
+ 'product': 'product',
677
+ 'course': 'course',
678
+ 'lesson': 'lesson'
679
+ }
680
+ return mapping[postType] || 'post'
681
+ }
682
+
683
+ private getEndpointForType(type: string): string {
684
+ const endpoints: Record<string, string> = {
685
+ 'post': 'wp/v2/posts',
686
+ 'page': 'wp/v2/pages',
687
+ 'person': 'wp/v2/users',
688
+ 'product': 'wc/v3/products',
689
+ 'course': 'wp/v2/course',
690
+ 'lesson': 'wp/v2/lesson'
691
+ }
692
+ return endpoints[type] || 'wp/v2/posts'
693
+ }
694
+
695
+ private transformPostToThing(post: any) {
696
+ return {
697
+ _id: post.id.toString(),
698
+ type: this.mapPostTypeToThingType(post.type),
699
+ name: post.title.rendered,
700
+ properties: {
701
+ content: post.content.rendered,
702
+ excerpt: post.excerpt.rendered
703
+ },
704
+ status: 'active',
705
+ createdAt: new Date(post.date).getTime(),
706
+ updatedAt: new Date(post.modified).getTime()
707
+ }
708
+ }
709
+
710
+ private createCustomConnection(input: any) {
711
+ // Implement custom connection storage
712
+ // Option 1: Post meta array
713
+ // Option 2: Custom database table
714
+ // Option 3: Taxonomy terms
715
+ return Effect.succeed(`${input.fromThingId}-${input.toThingId}`)
716
+ }
717
+ }
718
+
719
+ // Factory function
720
+ export function wordpressProvider(config: {
721
+ url: string
722
+ username: string
723
+ password: string
724
+ }) {
725
+ return Layer.succeed(
726
+ DataProvider,
727
+ new WordPressProvider(config.url, config.username, config.password)
728
+ )
729
+ }
730
+ ```
731
+
732
+ ---
733
+
734
+ ## Configuration
735
+
736
+ ### Astro Config
737
+
738
+ ```typescript
739
+ // frontend/astro.config.ts
740
+ import { defineConfig } from 'astro/config'
741
+ import react from '@astrojs/react'
742
+ import { one } from '@one/astro-integration'
743
+ import { wordpressProvider } from './src/providers/wordpress'
744
+
745
+ export default defineConfig({
746
+ integrations: [
747
+ react(),
748
+ one({
749
+ // ✅ Use WordPress as backend
750
+ provider: wordpressProvider({
751
+ url: import.meta.env.WORDPRESS_URL,
752
+ username: import.meta.env.WORDPRESS_USERNAME,
753
+ password: import.meta.env.WORDPRESS_APP_PASSWORD
754
+ })
755
+ })
756
+ ]
757
+ })
758
+ ```
759
+
760
+ ### Environment Variables
761
+
762
+ ```bash
763
+ # frontend/.env
764
+ WORDPRESS_URL=https://yoursite.com
765
+ WORDPRESS_USERNAME=your_username
766
+ WORDPRESS_APP_PASSWORD=xxxx xxxx xxxx xxxx xxxx xxxx
767
+
768
+ # Or with JWT
769
+ WORDPRESS_JWT_TOKEN=your_jwt_token_here
770
+ ```
771
+
772
+ ---
773
+
774
+ ## Usage Examples
775
+
776
+ ### Example 1: List WordPress Posts
777
+
778
+ ```tsx
779
+ // frontend/src/components/BlogList.tsx
780
+ import { useEffectRunner } from '@/hooks/useEffectRunner'
781
+ import { ThingClientService } from '@/services/ThingClientService'
782
+ import { Effect } from 'effect'
783
+ import { useEffect, useState } from 'react'
784
+
785
+ export function BlogList() {
786
+ const { run, loading } = useEffectRunner()
787
+ const [posts, setPosts] = useState([])
788
+
789
+ useEffect(() => {
790
+ const program = Effect.gen(function* () {
791
+ const thingService = yield* ThingClientService
792
+
793
+ // Fetch posts from WordPress
794
+ return yield* thingService.list('post')
795
+ })
796
+
797
+ run(program, {
798
+ onSuccess: setPosts
799
+ })
800
+ }, [])
801
+
802
+ if (loading) return <div>Loading posts...</div>
803
+
804
+ return (
805
+ <div>
806
+ {posts.map(post => (
807
+ <article key={post._id}>
808
+ <h2>{post.name}</h2>
809
+ <div dangerouslySetInnerHTML={{ __html: post.properties.excerpt }} />
810
+ <a href={`/posts/${post._id}`}>Read more</a>
811
+ </article>
812
+ ))}
813
+ </div>
814
+ )
815
+ }
816
+ ```
817
+
818
+ ### Example 2: Create WordPress Post
819
+
820
+ ```tsx
821
+ // frontend/src/components/PostForm.tsx
822
+ import { useEffectRunner } from '@/hooks/useEffectRunner'
823
+ import { ThingClientService } from '@/services/ThingClientService'
824
+ import { Effect } from 'effect'
825
+ import { useState } from 'react'
826
+
827
+ export function PostForm() {
828
+ const { run, loading, error } = useEffectRunner()
829
+ const [title, setTitle] = useState('')
830
+ const [content, setContent] = useState('')
831
+
832
+ const handleSubmit = (e: React.FormEvent) => {
833
+ e.preventDefault()
834
+
835
+ const program = Effect.gen(function* () {
836
+ const thingService = yield* ThingClientService
837
+
838
+ // Create post in WordPress
839
+ const postId = yield* thingService.create({
840
+ type: 'post',
841
+ name: title,
842
+ properties: {
843
+ content,
844
+ excerpt: content.substring(0, 150)
845
+ }
846
+ })
847
+
848
+ return postId
849
+ })
850
+
851
+ run(program, {
852
+ onSuccess: (id) => {
853
+ console.log('Post created:', id)
854
+ window.location.href = `/posts/${id}`
855
+ }
856
+ })
857
+ }
858
+
859
+ return (
860
+ <form onSubmit={handleSubmit}>
861
+ <input
862
+ type="text"
863
+ value={title}
864
+ onChange={(e) => setTitle(e.target.value)}
865
+ placeholder="Post Title"
866
+ required
867
+ />
868
+
869
+ <textarea
870
+ value={content}
871
+ onChange={(e) => setContent(e.target.value)}
872
+ placeholder="Post Content"
873
+ rows={10}
874
+ required
875
+ />
876
+
877
+ <button type="submit" disabled={loading}>
878
+ {loading ? 'Creating...' : 'Create Post'}
879
+ </button>
880
+
881
+ {error && <div className="error">{error}</div>}
882
+ </form>
883
+ )
884
+ }
885
+ ```
886
+
887
+ ---
888
+
889
+ ## WooCommerce Integration
890
+
891
+ ### WooCommerce Provider Extension
892
+
893
+ ```typescript
894
+ // frontend/src/providers/wordpress/WooCommerceExtension.ts
895
+ import { Effect } from 'effect'
896
+
897
+ export class WooCommerceExtension {
898
+ constructor(
899
+ private baseUrl: string,
900
+ private consumerKey: string,
901
+ private consumerSecret: string
902
+ ) {}
903
+
904
+ private get authParams() {
905
+ return `consumer_key=${this.consumerKey}&consumer_secret=${this.consumerSecret}`
906
+ }
907
+
908
+ products = {
909
+ list: (params: { limit?: number; category?: string }) =>
910
+ Effect.gen(this, function* () {
911
+ const query = new URLSearchParams({
912
+ per_page: String(params.limit || 10),
913
+ ...(params.category && { category: params.category })
914
+ })
915
+
916
+ const response = yield* Effect.tryPromise({
917
+ try: () =>
918
+ fetch(
919
+ `${this.baseUrl}/wp-json/wc/v3/products?${query}&${this.authParams}`
920
+ ),
921
+ catch: (error) => new Error(String(error))
922
+ })
923
+
924
+ const products = yield* Effect.tryPromise({
925
+ try: () => response.json(),
926
+ catch: (error) => new Error(String(error))
927
+ })
928
+
929
+ return products.map((product: any) => ({
930
+ _id: product.id.toString(),
931
+ type: 'product',
932
+ name: product.name,
933
+ properties: {
934
+ description: product.description,
935
+ price: product.price,
936
+ regularPrice: product.regular_price,
937
+ salePrice: product.sale_price,
938
+ sku: product.sku,
939
+ stock: product.stock_quantity,
940
+ images: product.images.map((img: any) => img.src),
941
+ categories: product.categories.map((cat: any) => cat.name)
942
+ },
943
+ status: product.status === 'publish' ? 'active' : 'inactive',
944
+ createdAt: new Date(product.date_created).getTime(),
945
+ updatedAt: new Date(product.date_modified).getTime()
946
+ }))
947
+ }),
948
+
949
+ create: (input: {
950
+ name: string
951
+ price: number
952
+ description: string
953
+ sku?: string
954
+ }) =>
955
+ Effect.gen(this, function* () {
956
+ const response = yield* Effect.tryPromise({
957
+ try: () =>
958
+ fetch(`${this.baseUrl}/wp-json/wc/v3/products?${this.authParams}`, {
959
+ method: 'POST',
960
+ headers: { 'Content-Type': 'application/json' },
961
+ body: JSON.stringify({
962
+ name: input.name,
963
+ type: 'simple',
964
+ regular_price: input.price.toString(),
965
+ description: input.description,
966
+ sku: input.sku
967
+ })
968
+ }),
969
+ catch: (error) => new Error(String(error))
970
+ })
971
+
972
+ const product = yield* Effect.tryPromise({
973
+ try: () => response.json(),
974
+ catch: (error) => new Error(String(error))
975
+ })
976
+
977
+ return product.id.toString()
978
+ })
979
+ }
980
+
981
+ orders = {
982
+ list: (customerId?: string) =>
983
+ Effect.gen(this, function* () {
984
+ const query = customerId ? `customer=${customerId}&` : ''
985
+
986
+ const response = yield* Effect.tryPromise({
987
+ try: () =>
988
+ fetch(
989
+ `${this.baseUrl}/wp-json/wc/v3/orders?${query}${this.authParams}`
990
+ ),
991
+ catch: (error) => new Error(String(error))
992
+ })
993
+
994
+ const orders = yield* Effect.tryPromise({
995
+ try: () => response.json(),
996
+ catch: (error) => new Error(String(error))
997
+ })
998
+
999
+ return orders.map((order: any) => ({
1000
+ _id: order.id.toString(),
1001
+ type: 'order',
1002
+ customerId: order.customer_id.toString(),
1003
+ items: order.line_items.map((item: any) => ({
1004
+ productId: item.product_id.toString(),
1005
+ quantity: item.quantity,
1006
+ price: item.price
1007
+ })),
1008
+ total: order.total,
1009
+ status: order.status,
1010
+ createdAt: new Date(order.date_created).getTime()
1011
+ }))
1012
+ }),
1013
+
1014
+ create: (input: {
1015
+ customerId: string
1016
+ items: Array<{ productId: string; quantity: number }>
1017
+ }) =>
1018
+ Effect.gen(this, function* () {
1019
+ const response = yield* Effect.tryPromise({
1020
+ try: () =>
1021
+ fetch(`${this.baseUrl}/wp-json/wc/v3/orders?${this.authParams}`, {
1022
+ method: 'POST',
1023
+ headers: { 'Content-Type': 'application/json' },
1024
+ body: JSON.stringify({
1025
+ customer_id: parseInt(input.customerId),
1026
+ line_items: input.items.map(item => ({
1027
+ product_id: parseInt(item.productId),
1028
+ quantity: item.quantity
1029
+ }))
1030
+ })
1031
+ }),
1032
+ catch: (error) => new Error(String(error))
1033
+ })
1034
+
1035
+ const order = yield* Effect.tryPromise({
1036
+ try: () => response.json(),
1037
+ catch: (error) => new Error(String(error))
1038
+ })
1039
+
1040
+ return order.id.toString()
1041
+ })
1042
+ }
1043
+ }
1044
+ ```
1045
+
1046
+ ---
1047
+
1048
+ ## Custom Post Types
1049
+
1050
+ ### Create Custom Post Types for ONE
1051
+
1052
+ ```php
1053
+ // wp-content/themes/your-theme/functions.php
1054
+ // Or create a custom plugin
1055
+
1056
+ function one_register_custom_post_types() {
1057
+ // Course post type
1058
+ register_post_type('course', [
1059
+ 'label' => 'Courses',
1060
+ 'public' => true,
1061
+ 'show_in_rest' => true, // ✅ REQUIRED for REST API
1062
+ 'rest_base' => 'course',
1063
+ 'supports' => ['title', 'editor', 'thumbnail', 'custom-fields'],
1064
+ 'has_archive' => true,
1065
+ 'rewrite' => ['slug' => 'courses']
1066
+ ]);
1067
+
1068
+ // Lesson post type
1069
+ register_post_type('lesson', [
1070
+ 'label' => 'Lessons',
1071
+ 'public' => true,
1072
+ 'show_in_rest' => true,
1073
+ 'rest_base' => 'lesson',
1074
+ 'supports' => ['title', 'editor', 'custom-fields'],
1075
+ 'hierarchical' => true, // Allows parent/child
1076
+ 'rewrite' => ['slug' => 'lessons']
1077
+ ]);
1078
+
1079
+ // Event post type
1080
+ register_post_type('event', [
1081
+ 'label' => 'Events',
1082
+ 'public' => true,
1083
+ 'show_in_rest' => true,
1084
+ 'rest_base' => 'event',
1085
+ 'supports' => ['title', 'editor', 'thumbnail', 'custom-fields'],
1086
+ 'rewrite' => ['slug' => 'events']
1087
+ ]);
1088
+
1089
+ // Organization post type
1090
+ register_post_type('organization', [
1091
+ 'label' => 'Organizations',
1092
+ 'public' => true,
1093
+ 'show_in_rest' => true,
1094
+ 'rest_base' => 'organization',
1095
+ 'supports' => ['title', 'editor', 'thumbnail', 'custom-fields'],
1096
+ 'rewrite' => ['slug' => 'organizations']
1097
+ ]);
1098
+ }
1099
+ add_action('init', 'one_register_custom_post_types');
1100
+
1101
+ // Add custom fields support to REST API
1102
+ function one_register_custom_fields() {
1103
+ register_post_meta('course', 'price', [
1104
+ 'show_in_rest' => true,
1105
+ 'single' => true,
1106
+ 'type' => 'number'
1107
+ ]);
1108
+
1109
+ register_post_meta('course', 'duration', [
1110
+ 'show_in_rest' => true,
1111
+ 'single' => true,
1112
+ 'type' => 'string'
1113
+ ]);
1114
+
1115
+ register_post_meta('lesson', 'video_url', [
1116
+ 'show_in_rest' => true,
1117
+ 'single' => true,
1118
+ 'type' => 'string'
1119
+ ]);
1120
+ }
1121
+ add_action('init', 'one_register_custom_fields');
1122
+ ```
1123
+
1124
+ ---
1125
+
1126
+ ## Limitations and Workarounds
1127
+
1128
+ ### WordPress Limitations
1129
+
1130
+ | Limitation | Workaround |
1131
+ |------------|-----------|
1132
+ | **No native graph relationships** | Use post parent, taxonomies, or custom tables |
1133
+ | **No vector embeddings** | Integrate external service (Pinecone, Weaviate) |
1134
+ | **No real-time subscriptions** | Poll API or use WordPress webhooks |
1135
+ | **Limited query flexibility** | Create custom REST endpoints |
1136
+ | **No multi-tenancy** | Use WordPress Multisite or organization taxonomy |
1137
+
1138
+ ### Custom REST Endpoints
1139
+
1140
+ ```php
1141
+ // Add custom endpoint for complex queries
1142
+ function one_register_custom_endpoints() {
1143
+ register_rest_route('one/v1', '/courses/(?P<id>\d+)/lessons', [
1144
+ 'methods' => 'GET',
1145
+ 'callback' => 'one_get_course_lessons',
1146
+ 'permission_callback' => '__return_true'
1147
+ ]);
1148
+ }
1149
+ add_action('rest_api_init', 'one_register_custom_endpoints');
1150
+
1151
+ function one_get_course_lessons($request) {
1152
+ $course_id = $request['id'];
1153
+
1154
+ $lessons = get_posts([
1155
+ 'post_type' => 'lesson',
1156
+ 'post_parent' => $course_id,
1157
+ 'posts_per_page' => -1
1158
+ ]);
1159
+
1160
+ return array_map(function($lesson) {
1161
+ return [
1162
+ 'id' => $lesson->ID,
1163
+ 'title' => $lesson->post_title,
1164
+ 'content' => $lesson->post_content,
1165
+ 'video_url' => get_post_meta($lesson->ID, 'video_url', true)
1166
+ ];
1167
+ }, $lessons);
1168
+ }
1169
+ ```
1170
+
1171
+ ---
1172
+
1173
+ ## Deployment
1174
+
1175
+ ### 1. Deploy WordPress
1176
+
1177
+ **Recommended Hosting:**
1178
+ - **WP Engine** - Managed WordPress (premium)
1179
+ - **Kinsta** - Managed WordPress (premium)
1180
+ - **SiteGround** - Affordable, good performance
1181
+ - **Digital Ocean** - VPS with WordPress droplet
1182
+ - **AWS Lightsail** - WordPress instance ($10/mo)
1183
+
1184
+ ### 2. Configure WordPress
1185
+
1186
+ ```bash
1187
+ # Install WordPress via WP-CLI
1188
+ wp core install \
1189
+ --url="https://yoursite.com" \
1190
+ --title="ONE Backend" \
1191
+ --admin_user="admin" \
1192
+ --admin_email="admin@yoursite.com"
1193
+
1194
+ # Install required plugins
1195
+ wp plugin install woocommerce --activate
1196
+ wp plugin install jwt-authentication-for-wp-rest-api --activate
1197
+
1198
+ # Set up permalinks
1199
+ wp rewrite structure '/%postname%/' --hard
1200
+
1201
+ # Create application password
1202
+ wp user application-password create admin "ONE Platform"
1203
+ ```
1204
+
1205
+ ### 3. Deploy Frontend
1206
+
1207
+ ```bash
1208
+ # Frontend (separate deployment)
1209
+ cd frontend
1210
+ npm run build
1211
+ # Deploy to Cloudflare Pages / Vercel / Netlify
1212
+
1213
+ # Set environment variables in hosting platform
1214
+ WORDPRESS_URL=https://yoursite.com
1215
+ WORDPRESS_USERNAME=admin
1216
+ WORDPRESS_APP_PASSWORD=xxxx xxxx xxxx xxxx
1217
+ ```
1218
+
1219
+ ### 4. Configure CORS (if needed)
1220
+
1221
+ ```php
1222
+ // wp-content/themes/your-theme/functions.php
1223
+ function one_add_cors_headers() {
1224
+ header('Access-Control-Allow-Origin: https://your-frontend.com');
1225
+ header('Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS');
1226
+ header('Access-Control-Allow-Headers: Authorization, Content-Type');
1227
+ }
1228
+ add_action('rest_api_init', 'one_add_cors_headers');
1229
+ ```
1230
+
1231
+ ---
1232
+
1233
+ ## Summary
1234
+
1235
+ ### ✅ WordPress as ONE Backend: Pros
1236
+
1237
+ - **Familiar** - Use WordPress admin, existing knowledge
1238
+ - **Plugins** - Thousands of WordPress plugins available
1239
+ - **WooCommerce** - Built-in e-commerce functionality
1240
+ - **Hosting** - Many affordable hosting options
1241
+ - **Content Management** - Mature content editing tools
1242
+ - **SEO** - WordPress SEO plugins (Yoast, Rank Math)
1243
+
1244
+ ### ⚠️ WordPress as ONE Backend: Cons
1245
+
1246
+ - **No Real-Time** - Poll API or use webhooks
1247
+ - **Limited Relationships** - Need workarounds for graph connections
1248
+ - **Performance** - Slower than purpose-built backends (Convex, Supabase)
1249
+ - **No Vector Search** - Requires external integration
1250
+ - **PHP Required** - Need to write PHP for custom endpoints
1251
+ - **Scaling** - WordPress can struggle at very large scale
1252
+
1253
+ ### When to Use WordPress Backend
1254
+
1255
+ ✅ **Good For:**
1256
+ - Existing WordPress sites migrating to ONE
1257
+ - Teams familiar with WordPress
1258
+ - Organizations needing WordPress admin UI
1259
+ - E-commerce sites using WooCommerce
1260
+ - Content-heavy sites (blogs, magazines)
1261
+ - Budget-conscious projects
1262
+
1263
+ ❌ **Not Ideal For:**
1264
+ - Real-time applications (use Convex or Supabase)
1265
+ - Complex graph relationships (use Neo4j or Convex)
1266
+ - High-performance requirements (use Convex)
1267
+ - Vector search/AI features (use Pinecone + Convex)
1268
+
1269
+ ---
1270
+
1271
+ ## Next Steps
1272
+
1273
+ 1. **Set up WordPress** with REST API and Application Passwords
1274
+ 2. **Install WooCommerce** (if doing e-commerce)
1275
+ 3. **Create custom post types** for your ONE thing types
1276
+ 4. **Implement WordPressProvider** in frontend
1277
+ 5. **Configure Astro** to use `wordpressProvider`
1278
+ 6. **Test CRUD operations** with WordPress REST API
1279
+ 7. **Add custom endpoints** for complex queries
1280
+ 8. **Deploy** WordPress backend and ONE frontend
1281
+
1282
+ ---
1283
+
1284
+ ## Resources
1285
+
1286
+ ### WordPress REST API
1287
+ - [WordPress REST API Handbook](https://developer.wordpress.org/rest-api/)
1288
+ - [Authentication](https://developer.wordpress.org/rest-api/using-the-rest-api/authentication/)
1289
+ - [Custom Post Types](https://developer.wordpress.org/plugins/post-types/)
1290
+
1291
+ ### WooCommerce REST API
1292
+ - [WooCommerce REST API Docs](https://woocommerce.github.io/woocommerce-rest-api-docs/)
1293
+ - [Authentication](https://woocommerce.github.io/woocommerce-rest-api-docs/#authentication)
1294
+
1295
+ ### Related ONE Guides
1296
+ - **ontology-frontend.md** - Frontend implementation (this guide references)
1297
+ - **ontology-backend.md** - Backend patterns
1298
+ - **Ontology.md** - Complete ontology specification
1299
+
1300
+ ---
1301
+
1302
+ **WordPress → ONE = Familiar CMS + Modern Frontend Architecture**