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,2084 +0,0 @@
1
- ---
2
- title: 2 6 Dashboard Migration
3
- dimension: things
4
- category: features
5
- tags: ai, backend, frontend
6
- related_dimensions: events, knowledge, people
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 features category.
13
- Location: one/things/features/2-6-dashboard-migration.md
14
- Purpose: Documents feature 2-6: dashboard component migration
15
- Related dimensions: events, knowledge, people
16
- For AI agents: Read this to understand 2 6 dashboard migration.
17
- ---
18
-
19
- # Feature 2-6: Dashboard Component Migration
20
-
21
- **Feature ID:** `feature_2_6_dashboard_migration`
22
- **Plan:** `plan_2_backend_agnostic_frontend`
23
- **Owner:** Frontend Specialist
24
- **Status:** Ready for Implementation
25
- **Priority:** P1 (High - Complete Migration)
26
- **Effort:** 1 week (7 days)
27
- **Dependencies:** Feature 2-5 (Auth Migration Complete)
28
-
29
- ---
30
-
31
- ## 1. Complete Technical Specification
32
-
33
- ### Overview
34
-
35
- Migrate all dashboard components from direct Convex integration to the backend-agnostic DataProvider pattern. This migration enables the dashboard to work with any backend (Convex, Supabase, Firebase) while maintaining all existing functionality, performance, and user experience.
36
-
37
- ### Goals
38
-
39
- 1. **Backend Agnosticism**: Remove all direct Convex imports from dashboard components
40
- 2. **Functional Parity**: Preserve all existing dashboard features and behavior
41
- 3. **Performance Maintenance**: Ensure no performance degradation (within 10% baseline)
42
- 4. **Real-time Updates**: Maintain real-time data subscriptions and updates
43
- 5. **Type Safety**: Maintain full TypeScript type safety through DataProvider
44
- 6. **Test Coverage**: Update all tests to use DataProvider mocks
45
-
46
- ### Dashboard Architecture
47
-
48
- ```
49
- Dashboard Component Tree:
50
- ├── DashboardLayout.tsx # Main layout wrapper
51
- │ ├── Sidebar.tsx # Navigation (org-scoped)
52
- │ ├── Header.tsx # User profile, notifications
53
- │ └── Content Area
54
- │ ├── DashboardOverview.tsx # Main dashboard (multiple hooks)
55
- │ │ ├── StatsCards.tsx # Analytics (aggregated data)
56
- │ │ ├── ActivityCharts.tsx # Charts (time-series data)
57
- │ │ ├── RevenueCharts.tsx # Revenue analytics
58
- │ │ └── RecentTransactions # Transaction list
59
- │ ├── CourseList.tsx # Entity list component
60
- │ ├── CourseDetail.tsx # Entity detail component
61
- │ ├── LessonList.tsx # Entity list component
62
- │ ├── LessonDetail.tsx # Entity detail component
63
- │ ├── StudentList.tsx # Entity list component
64
- │ ├── ActivityFeed.tsx # Event stream component
65
- │ ├── SearchBar.tsx # Search component
66
- │ └── SettingsPanel.tsx # Settings UI
67
- ```
68
-
69
- ### Component Categories and Hook Mapping
70
-
71
- #### 1. Entity List Components (useThings)
72
-
73
- **Components:**
74
-
75
- - `CourseList.tsx` - Display all courses for org
76
- - `LessonList.tsx` - Display lessons for course
77
- - `StudentList.tsx` - Display enrolled students
78
- - `AICloneList.tsx` - Display AI agents
79
-
80
- **Hook Migration:**
81
-
82
- ```typescript
83
- // BEFORE: Direct Convex
84
- const courses = useQuery(api.queries.entities.list, { type: "course" });
85
-
86
- // AFTER: DataProvider
87
- const { data: courses, loading, error } = useThings({ type: "course" });
88
- ```
89
-
90
- **Features to Preserve:**
91
-
92
- - Filtering by status, organization
93
- - Sorting by createdAt, updatedAt, name
94
- - Pagination support
95
- - Real-time updates
96
- - Loading states
97
- - Error handling
98
-
99
- #### 2. Entity Detail Components (useThing, useConnections)
100
-
101
- **Components:**
102
-
103
- - `CourseDetail.tsx` - Display course details + relationships
104
- - `LessonDetail.tsx` - Display lesson details
105
- - `StudentProfile.tsx` - Display student profile
106
-
107
- **Hook Migration:**
108
-
109
- ```typescript
110
- // BEFORE: Direct Convex
111
- const course = useQuery(api.queries.entities.get, { id: courseId });
112
- const students = useQuery(api.queries.connections.getRelated, {
113
- fromThingId: courseId,
114
- relationshipType: "enrolled_in",
115
- });
116
-
117
- // AFTER: DataProvider
118
- const { data: course, loading, error } = useThing({ id: courseId });
119
- const { data: students, loading: studentsLoading } = useConnections({
120
- fromThingId: courseId,
121
- relationshipType: "enrolled_in",
122
- });
123
- ```
124
-
125
- **Features to Preserve:**
126
-
127
- - Display entity properties
128
- - Display related entities (connections)
129
- - Edit entity (useUpdateThing)
130
- - Delete entity (useDeleteThing)
131
- - Real-time updates
132
- - Optimistic updates
133
-
134
- #### 3. Activity Feed Component (useEvents)
135
-
136
- **Component:**
137
-
138
- - `ActivityFeed.tsx` - Display audit trail
139
-
140
- **Hook Migration:**
141
-
142
- ```typescript
143
- // BEFORE: Direct Convex
144
- const events = useQuery(api.queries.events.getRecent, {
145
- actorId: userId,
146
- limit: 20,
147
- });
148
-
149
- // AFTER: DataProvider
150
- const { data: events, loading } = useEvents({
151
- actorId: userId,
152
- limit: 20,
153
- });
154
- ```
155
-
156
- **Features to Preserve:**
157
-
158
- - Filter by actor, target, event type
159
- - Real-time updates
160
- - Pagination (load more)
161
- - Event formatting
162
- - Timestamps
163
-
164
- #### 4. Search Components (useSearch)
165
-
166
- **Component:**
167
-
168
- - `SearchBar.tsx` - Full-text search with autocomplete
169
-
170
- **Hook Migration:**
171
-
172
- ```typescript
173
- // BEFORE: Direct Convex
174
- const results = useQuery(api.queries.search.fullText, {
175
- query: searchQuery,
176
- types: ["course", "lesson"],
177
- });
178
-
179
- // AFTER: DataProvider
180
- const { data: results, loading } = useSearch({
181
- query: searchQuery,
182
- types: ["course", "lesson"],
183
- });
184
- ```
185
-
186
- **Features to Preserve:**
187
-
188
- - Type-ahead suggestions
189
- - Filter by entity type
190
- - Debounced search
191
- - RAG integration
192
- - Highlighting
193
-
194
- #### 5. Analytics Components (Multiple Hooks)
195
-
196
- **Component:**
197
-
198
- - `DashboardOverview.tsx` - Main dashboard with stats
199
- - `StatsCards.tsx` - Aggregate metrics
200
- - `ActivityCharts.tsx` - Time-series charts
201
- - `RevenueCharts.tsx` - Revenue analytics
202
-
203
- **Hook Migration:**
204
-
205
- ```typescript
206
- // BEFORE: Direct Convex
207
- const courseCount = useQuery(api.queries.analytics.countByType, {
208
- type: "course",
209
- });
210
- const studentCount = useQuery(api.queries.analytics.countByType, {
211
- type: "student",
212
- });
213
- const recentActivity = useQuery(api.queries.events.getRecent, { limit: 10 });
214
-
215
- // AFTER: DataProvider
216
- const { data: courses } = useThings({ type: "course" });
217
- const { data: students } = useThings({ type: "student" });
218
- const { data: recentActivity } = useEvents({ limit: 10 });
219
-
220
- // Client-side aggregation
221
- const courseCount = courses?.length || 0;
222
- const studentCount = students?.length || 0;
223
- ```
224
-
225
- **Features to Preserve:**
226
-
227
- - Aggregate counts
228
- - Time-series data
229
- - Real-time updates
230
- - Chart rendering
231
- - Loading skeletons
232
-
233
- ---
234
-
235
- ## 2. Ontology Mapping (All 6 Dimensions)
236
-
237
- ### Organizations Dimension
238
-
239
- **Dashboard Isolation:**
240
-
241
- - All dashboard data is org-scoped
242
- - Queries automatically filter by `organizationId`
243
- - Sidebar shows current organization name/logo
244
- - Org switcher for users with multiple orgs
245
- - Org-level analytics and metrics
246
-
247
- **Implementation:**
248
-
249
- ```typescript
250
- // DataProvider automatically adds organizationId to all queries
251
- const { data: courses } = useThings({
252
- type: "course",
253
- // organizationId: currentOrgId added automatically by DataProvider
254
- });
255
- ```
256
-
257
- **Org-Scoped Components:**
258
-
259
- - `DashboardOverview` - Shows org metrics
260
- - `CourseList` - Shows org courses
261
- - `StudentList` - Shows org students
262
- - `ActivityFeed` - Shows org events
263
- - `SettingsPanel` - Shows org settings
264
-
265
- ### People Dimension
266
-
267
- **Role-Based Dashboard:**
268
-
269
- - `platform_owner` - See all organizations, platform-wide metrics
270
- - `org_owner` - See org dashboard, admin controls
271
- - `org_user` - See limited dashboard, own courses
272
- - `customer` - See marketplace, enrolled courses
273
-
274
- **Permission-Based UI:**
275
-
276
- ```typescript
277
- function DashboardOverview() {
278
- const { user, role } = useAuth();
279
-
280
- return (
281
- <div>
282
- {/* All roles see their own stats */}
283
- <StatsCards />
284
-
285
- {/* Org owners see admin controls */}
286
- {(role === "org_owner" || role === "platform_owner") && (
287
- <AdminPanel />
288
- )}
289
-
290
- {/* Platform owners see platform metrics */}
291
- {role === "platform_owner" && (
292
- <PlatformMetrics />
293
- )}
294
- </div>
295
- );
296
- }
297
- ```
298
-
299
- **People-Scoped Components:**
300
-
301
- - `ActivityFeed` - Filter by actorId (current user)
302
- - `CourseList` - Show courses owned by user
303
- - `StudentList` - Show students enrolled in user's courses
304
-
305
- ### Things Dimension
306
-
307
- **Entity Types Displayed:**
308
-
309
- - `course` - Online courses
310
- - `lesson` - Course lessons
311
- - `ai_clone` - AI agents
312
- - `creator` - Course creators/instructors
313
- - `student` - Enrolled students
314
- - `blog_post` - Content
315
- - `token` - Digital assets
316
- - `organization` - Organizations
317
-
318
- **Entity Status Badges:**
319
-
320
- ```typescript
321
- function EntityStatusBadge({ status }: { status: ThingStatus }) {
322
- const statusStyles = {
323
- draft: "bg-gray-100 text-gray-800",
324
- active: "bg-green-100 text-green-800",
325
- published: "bg-blue-100 text-blue-800",
326
- archived: "bg-red-100 text-red-800"
327
- };
328
-
329
- return (
330
- <span className={`px-2 py-1 rounded ${statusStyles[status]}`}>
331
- {status}
332
- </span>
333
- );
334
- }
335
- ```
336
-
337
- **Thing-Scoped Components:**
338
-
339
- - `CourseList` - Display course entities
340
- - `CourseDetail` - Display single course entity
341
- - `LessonList` - Display lesson entities
342
- - `StudentList` - Display student entities
343
-
344
- ### Connections Dimension
345
-
346
- **Relationships Displayed:**
347
-
348
- - `owns` - Creator owns course
349
- - `enrolled_in` - Student enrolled in course
350
- - `authored` - Creator authored content
351
- - `following` - User following creator
352
- - `holds_tokens` - User holds tokens
353
-
354
- **Connection Display:**
355
-
356
- ```typescript
357
- function CourseStudents({ courseId }: { courseId: Id<"things"> }) {
358
- const { data: enrollments, loading } = useConnections({
359
- toThingId: courseId,
360
- relationshipType: "enrolled_in"
361
- });
362
-
363
- if (loading) return <LoadingSkeleton />;
364
-
365
- return (
366
- <div>
367
- <h3>Enrolled Students ({enrollments?.length})</h3>
368
- {enrollments?.map(enrollment => (
369
- <StudentCard
370
- key={enrollment._id}
371
- studentId={enrollment.fromThingId}
372
- enrolledAt={enrollment.createdAt}
373
- />
374
- ))}
375
- </div>
376
- );
377
- }
378
- ```
379
-
380
- **Connection-Scoped Components:**
381
-
382
- - `CourseDetail` - Show enrolled students (connections)
383
- - `StudentProfile` - Show enrolled courses (connections)
384
- - `ActivityFeed` - Show connection events (follow, enroll)
385
-
386
- ### Events Dimension
387
-
388
- **Event Types Displayed:**
389
-
390
- - `course_created` - Course created
391
- - `course_updated` - Course updated
392
- - `student_enrolled` - Student enrolled
393
- - `lesson_completed` - Lesson completed
394
- - `content_published` - Content published
395
- - `token_transferred` - Token transferred
396
-
397
- **Event Stream:**
398
-
399
- ```typescript
400
- function ActivityFeed({ actorId }: { actorId?: Id<"things"> }) {
401
- const { data: events, loading } = useEvents({
402
- actorId,
403
- limit: 20
404
- });
405
-
406
- if (loading) return <LoadingSkeleton />;
407
-
408
- return (
409
- <div className="space-y-4">
410
- {events?.map(event => (
411
- <EventCard
412
- key={event._id}
413
- event={event}
414
- showActor={!actorId}
415
- showTimestamp
416
- />
417
- ))}
418
- </div>
419
- );
420
- }
421
- ```
422
-
423
- **Event-Scoped Components:**
424
-
425
- - `ActivityFeed` - Display event stream
426
- - `DashboardOverview` - Show recent events
427
- - `CourseDetail` - Show course-specific events
428
-
429
- ### Knowledge Dimension
430
-
431
- **Search and Discovery:**
432
-
433
- - Full-text search across entities
434
- - RAG-powered content suggestions
435
- - Knowledge labels (tags) for categorization
436
- - Vector search for semantic similarity
437
-
438
- **Search Implementation:**
439
-
440
- ```typescript
441
- function SearchBar() {
442
- const [query, setQuery] = useState("");
443
- const { data: results, loading } = useSearch({
444
- query,
445
- types: ["course", "lesson", "blog_post"]
446
- });
447
-
448
- return (
449
- <div>
450
- <input
451
- type="search"
452
- value={query}
453
- onChange={(e) => setQuery(e.target.value)}
454
- placeholder="Search courses, lessons, content..."
455
- />
456
- {loading && <LoadingSpinner />}
457
- {results?.map(result => (
458
- <SearchResult key={result._id} result={result} />
459
- ))}
460
- </div>
461
- );
462
- }
463
- ```
464
-
465
- **Knowledge-Scoped Components:**
466
-
467
- - `SearchBar` - Full-text search
468
- - `ContentRecommendations` - RAG suggestions
469
- - `TagFilter` - Filter by knowledge labels
470
-
471
- ---
472
-
473
- ## 3. User Stories (10 Stories with Acceptance Criteria)
474
-
475
- ### Story 1: Creator Views Course Dashboard
476
-
477
- **As a** course creator
478
- **I want to** see my courses in the dashboard using DataProvider
479
- **So that** the dashboard works with any backend and I can manage my courses
480
-
481
- **Acceptance Criteria:**
482
-
483
- - [ ] CourseList component uses `useThings` hook
484
- - [ ] Loading state displays skeleton
485
- - [ ] Courses display with name, thumbnail, status, student count
486
- - [ ] Courses are org-scoped (only current org)
487
- - [ ] Real-time updates when course is created/updated
488
- - [ ] Error state displays user-friendly message
489
- - [ ] No direct Convex imports in component
490
-
491
- ### Story 2: Org Owner Views Analytics
492
-
493
- **As an** organization owner
494
- **I want to** see aggregated analytics in the dashboard
495
- **So that** I can track org performance and growth
496
-
497
- **Acceptance Criteria:**
498
-
499
- - [ ] StatsCards component uses multiple DataProvider hooks
500
- - [ ] Displays course count, student count, revenue, engagement
501
- - [ ] Loading states for each metric
502
- - [ ] Real-time updates when data changes
503
- - [ ] Charts render with proper data aggregation
504
- - [ ] No direct Convex imports in component
505
-
506
- ### Story 3: Instructor Views Enrolled Students
507
-
508
- **As an** instructor
509
- **I want to** see students enrolled in my course
510
- **So that** I can track enrollment and student progress
511
-
512
- **Acceptance Criteria:**
513
-
514
- - [ ] CourseDetail uses `useThing` and `useConnections` hooks
515
- - [ ] Displays course details and enrolled students
516
- - [ ] Student list shows name, email, enrollment date
517
- - [ ] Loading states for course and students
518
- - [ ] Real-time updates when student enrolls
519
- - [ ] No direct Convex imports in component
520
-
521
- ### Story 4: User Views Activity Feed
522
-
523
- **As a** user
524
- **I want to** see recent activity in my dashboard
525
- **So that** I can stay updated on platform events
526
-
527
- **Acceptance Criteria:**
528
-
529
- - [ ] ActivityFeed component uses `useEvents` hook
530
- - [ ] Displays recent events with actor, action, timestamp
531
- - [ ] Loading state displays skeleton
532
- - [ ] Real-time updates when events occur
533
- - [ ] Pagination support (load more)
534
- - [ ] Filter by event type
535
- - [ ] No direct Convex imports in component
536
-
537
- ### Story 5: Creator Searches Content
538
-
539
- **As a** creator
540
- **I want to** search for courses, lessons, and content
541
- **So that** I can quickly find what I need
542
-
543
- **Acceptance Criteria:**
544
-
545
- - [ ] SearchBar component uses `useSearch` hook
546
- - [ ] Type-ahead suggestions as I type
547
- - [ ] Filter by entity type (course, lesson, blog_post)
548
- - [ ] Debounced search (300ms delay)
549
- - [ ] Loading state during search
550
- - [ ] Highlighting of search terms
551
- - [ ] No direct Convex imports in component
552
-
553
- ### Story 6: Instructor Edits Course
554
-
555
- **As an** instructor
556
- **I want to** edit my course from the dashboard
557
- **So that** I can update course details
558
-
559
- **Acceptance Criteria:**
560
-
561
- - [ ] CourseDetail uses `useUpdateThing` hook
562
- - [ ] Displays course edit form
563
- - [ ] Optimistic update (UI updates immediately)
564
- - [ ] Success/error toast notifications
565
- - [ ] Validation errors display inline
566
- - [ ] Real-time updates reflect in list view
567
- - [ ] No direct Convex imports in component
568
-
569
- ### Story 7: Student Views Enrolled Courses
570
-
571
- **As a** student
572
- **I want to** see my enrolled courses in the dashboard
573
- **So that** I can access my learning materials
574
-
575
- **Acceptance Criteria:**
576
-
577
- - [ ] StudentDashboard uses `useConnections` hook
578
- - [ ] Displays courses student is enrolled in
579
- - [ ] Shows course progress and completion
580
- - [ ] Loading state displays skeleton
581
- - [ ] Real-time updates when enrolled in new course
582
- - [ ] No direct Convex imports in component
583
-
584
- ### Story 8: Org Owner Views Revenue Charts
585
-
586
- **As an** organization owner
587
- **I want to** see revenue charts in the dashboard
588
- **So that** I can track financial performance
589
-
590
- **Acceptance Criteria:**
591
-
592
- - [ ] RevenueCharts uses `useEvents` hook for transaction events
593
- - [ ] Aggregates revenue by day/week/month
594
- - [ ] Displays line chart and bar chart
595
- - [ ] Loading state displays skeleton
596
- - [ ] Real-time updates when transactions occur
597
- - [ ] Export chart data to CSV
598
- - [ ] No direct Convex imports in component
599
-
600
- ### Story 9: Platform Owner Views All Organizations
601
-
602
- **As a** platform owner
603
- **I want to** see all organizations in the dashboard
604
- **So that** I can manage the platform
605
-
606
- **Acceptance Criteria:**
607
-
608
- - [ ] PlatformDashboard uses `useOrganizations` hook
609
- - [ ] Displays all organizations with stats
610
- - [ ] Shows org name, plan, user count, usage
611
- - [ ] Loading state displays skeleton
612
- - [ ] Real-time updates when org is created/updated
613
- - [ ] Filter by plan (starter, pro, enterprise)
614
- - [ ] No direct Convex imports in component
615
-
616
- ### Story 10: User Views Dashboard on Mobile
617
-
618
- **As a** mobile user
619
- **I want to** view the dashboard on my phone
620
- **So that** I can access my data anywhere
621
-
622
- **Acceptance Criteria:**
623
-
624
- - [ ] DashboardLayout is fully responsive
625
- - [ ] Mobile menu works correctly
626
- - [ ] Charts render properly on small screens
627
- - [ ] Touch interactions work (swipe, tap)
628
- - [ ] Loading states display on mobile
629
- - [ ] Performance is acceptable (< 3s load time)
630
- - [ ] No direct Convex imports in component
631
-
632
- ---
633
-
634
- ## 4. Implementation Steps (50 Steps)
635
-
636
- ### Phase 1: Audit and Preparation (Day 1)
637
-
638
- **Step 1-10: Audit Current Implementation**
639
-
640
- 1. **Audit all dashboard components** - List all files in `frontend/src/components/dashboard/`
641
- 2. **Identify Convex imports** - Grep for `import { useQuery, useMutation } from "convex/react"`
642
- 3. **Map components to hooks** - Create mapping table (component → hooks needed)
643
- 4. **Document current functionality** - Screenshot all dashboard pages, document features
644
- 5. **Review tests** - Identify all test files in `frontend/test/components/dashboard/`
645
- 6. **Create migration checklist** - Component-by-component checklist
646
- 7. **Set up feature branch** - `git checkout -b feature/dashboard-migration`
647
- 8. **Create rollback points** - Tag commits for easy rollback
648
- 9. **Review DataProvider hooks** - Ensure all needed hooks exist
649
- 10. **Review performance baseline** - Run Lighthouse, document metrics
650
-
651
- **Step 11-15: Prepare Test Infrastructure**
652
-
653
- 11. **Create DataProvider mocks** - Mock implementations for tests
654
- 12. **Create test utilities** - Helper functions for dashboard tests
655
- 13. **Set up visual regression tests** - Capture baseline screenshots
656
- 14. **Set up performance monitoring** - Add performance markers
657
- 15. **Document test strategy** - Write test plan document
658
-
659
- ### Phase 2: Migrate Entity List Components (Day 2-3)
660
-
661
- **Step 16-20: Migrate CourseList**
662
-
663
- 16. **Read CourseList.tsx** - Understand current implementation
664
- 17. **Replace useQuery with useThings** - Migrate to DataProvider hook
665
- 18. **Update loading state** - Use `loading` from hook
666
- 19. **Update error handling** - Use `error` from hook
667
- 20. **Test CourseList** - Run component tests, verify functionality
668
-
669
- **Step 21-25: Migrate LessonList**
670
-
671
- 21. **Read LessonList.tsx** - Understand current implementation
672
- 22. **Replace useQuery with useThings** - Migrate to DataProvider hook
673
- 23. **Add courseId filter** - Filter lessons by parent course
674
- 24. **Update loading state** - Use `loading` from hook
675
- 25. **Test LessonList** - Run component tests, verify functionality
676
-
677
- **Step 26-30: Migrate StudentList**
678
-
679
- 26. **Read StudentList.tsx** - Understand current implementation
680
- 27. **Replace useQuery with useThings** - Migrate to DataProvider hook
681
- 28. **Update loading state** - Use `loading` from hook
682
- 29. **Add pagination support** - Implement load more functionality
683
- 30. **Test StudentList** - Run component tests, verify functionality
684
-
685
- ### Phase 3: Migrate Entity Detail Components (Day 3-4)
686
-
687
- **Step 31-35: Migrate CourseDetail**
688
-
689
- 31. **Read CourseDetail.tsx** - Understand current implementation
690
- 32. **Replace useQuery with useThing** - Migrate single entity fetch
691
- 33. **Add useConnections for students** - Fetch enrolled students
692
- 34. **Replace useMutation with useUpdateThing** - Migrate update logic
693
- 35. **Test CourseDetail** - Run component tests, verify functionality
694
-
695
- **Step 36-40: Migrate LessonDetail**
696
-
697
- 36. **Read LessonDetail.tsx** - Understand current implementation
698
- 37. **Replace useQuery with useThing** - Migrate single entity fetch
699
- 38. **Add useConnections for parent course** - Fetch parent course
700
- 39. **Replace useMutation with useUpdateThing** - Migrate update logic
701
- 40. **Test LessonDetail** - Run component tests, verify functionality
702
-
703
- ### Phase 4: Migrate Activity & Search (Day 5)
704
-
705
- **Step 41-45: Migrate ActivityFeed and SearchBar**
706
-
707
- 41. **Read ActivityFeed.tsx** - Understand current implementation
708
- 42. **Replace useQuery with useEvents** - Migrate event stream
709
- 43. **Test ActivityFeed** - Run component tests, verify real-time updates
710
- 44. **Read SearchBar.tsx** - Understand current implementation
711
- 45. **Replace useQuery with useSearch** - Migrate search logic
712
-
713
- ### Phase 5: Migrate Analytics Components (Day 5-6)
714
-
715
- **Step 46-50: Migrate DashboardOverview, StatsCards, Charts**
716
-
717
- 46. **Read DashboardOverview.tsx** - Understand current implementation with multiple hooks
718
- 47. **Replace queries with DataProvider hooks** - Migrate all data fetching
719
- 48. **Add client-side aggregation** - Calculate metrics from raw data
720
- 49. **Update chart components** - Ensure charts work with new data format
721
- 50. **Test DashboardOverview** - Run component tests, verify all metrics display
722
-
723
- ### Phase 6: Cleanup and Optimization (Day 6-7)
724
-
725
- **Step 51-60: Remove Dependencies and Optimize**
726
-
727
- 51. **Remove all Convex imports** - Grep and remove `from "convex/react"`
728
- 52. **Remove api imports** - Remove `import { api } from "@/convex/_generated/api"`
729
- 53. **Add error boundaries** - Wrap components with error boundaries
730
- 54. **Optimize performance** - Add memoization, virtualization where needed
731
- 55. **Update all tests** - Ensure all tests use DataProvider mocks
732
- 56. **Run full test suite** - Verify all tests pass
733
- 57. **Run visual regression tests** - Compare screenshots
734
- 58. **Run performance tests** - Verify within 10% of baseline
735
- 59. **Document migration changes** - Update component API docs
736
- 60. **Create pull request** - Submit for review
737
-
738
- ---
739
-
740
- ## 5. Complete Code Examples
741
-
742
- ### Example 1: DashboardOverview Migration
743
-
744
- **BEFORE (Tightly Coupled to Convex):**
745
-
746
- ```typescript
747
- // frontend/src/components/dashboard/DashboardOverview.tsx
748
- import { useQuery } from "convex/react";
749
- import { api } from "@/convex/_generated/api";
750
- import { StatsCards } from "./StatsCards";
751
- import { ActivityCharts } from "./ActivityCharts";
752
- import { RevenueCharts } from "./RevenueCharts";
753
- import { RecentTransactions } from "./RecentTransactions";
754
-
755
- export function DashboardOverview() {
756
- // Multiple Convex queries
757
- const courses = useQuery(api.queries.entities.list, { type: "course" });
758
- const students = useQuery(api.queries.entities.list, { type: "student" });
759
- const recentEvents = useQuery(api.queries.events.getRecent, { limit: 10 });
760
- const transactions = useQuery(api.queries.events.getByType, {
761
- eventType: "token_transferred",
762
- limit: 10
763
- });
764
-
765
- // Loading state
766
- if (courses === undefined || students === undefined) {
767
- return <div>Loading dashboard...</div>;
768
- }
769
-
770
- // Aggregate metrics
771
- const totalCourses = courses.length;
772
- const totalStudents = students.length;
773
- const activeStudents = students.filter(s => s.properties.lastActive > Date.now() - 7 * 24 * 60 * 60 * 1000).length;
774
-
775
- return (
776
- <div className="space-y-6">
777
- <h1 className="text-3xl font-bold">Dashboard</h1>
778
-
779
- <StatsCards
780
- totalCourses={totalCourses}
781
- totalStudents={totalStudents}
782
- activeStudents={activeStudents}
783
- />
784
-
785
- <div className="grid grid-cols-2 gap-6">
786
- <ActivityCharts events={recentEvents || []} />
787
- <RevenueCharts transactions={transactions || []} />
788
- </div>
789
-
790
- <RecentTransactions transactions={transactions || []} />
791
- </div>
792
- );
793
- }
794
- ```
795
-
796
- **AFTER (Backend-Agnostic with DataProvider):**
797
-
798
- ```typescript
799
- // frontend/src/components/dashboard/DashboardOverview.tsx
800
- import { useMemo } from "react";
801
- import { useThings, useEvents } from "@/providers/hooks";
802
- import { StatsCards } from "./StatsCards";
803
- import { ActivityCharts } from "./ActivityCharts";
804
- import { RevenueCharts } from "./RevenueCharts";
805
- import { RecentTransactions } from "./RecentTransactions";
806
- import { LoadingSkeleton } from "@/components/ui/loading-skeleton";
807
- import { ErrorMessage } from "@/components/ui/error-message";
808
-
809
- export function DashboardOverview() {
810
- // DataProvider hooks (backend-agnostic)
811
- const { data: courses, loading: coursesLoading, error: coursesError } = useThings({ type: "course" });
812
- const { data: students, loading: studentsLoading, error: studentsError } = useThings({ type: "student" });
813
- const { data: recentEvents, loading: eventsLoading } = useEvents({ limit: 10 });
814
- const { data: transactions, loading: transactionsLoading } = useEvents({
815
- eventType: "token_transferred",
816
- limit: 10
817
- });
818
-
819
- // Aggregate loading state
820
- const loading = coursesLoading || studentsLoading;
821
-
822
- // Handle errors
823
- if (coursesError || studentsError) {
824
- return <ErrorMessage error={coursesError || studentsError} />;
825
- }
826
-
827
- // Loading state with skeleton
828
- if (loading) {
829
- return <LoadingSkeleton layout="dashboard" />;
830
- }
831
-
832
- // Memoized metrics (only recalculate when data changes)
833
- const metrics = useMemo(() => {
834
- const totalCourses = courses?.length || 0;
835
- const totalStudents = students?.length || 0;
836
- const activeStudents = students?.filter(
837
- s => s.properties.lastActive > Date.now() - 7 * 24 * 60 * 60 * 1000
838
- ).length || 0;
839
-
840
- return { totalCourses, totalStudents, activeStudents };
841
- }, [courses, students]);
842
-
843
- return (
844
- <div className="space-y-6">
845
- <h1 className="text-3xl font-bold">Dashboard</h1>
846
-
847
- <StatsCards
848
- totalCourses={metrics.totalCourses}
849
- totalStudents={metrics.totalStudents}
850
- activeStudents={metrics.activeStudents}
851
- />
852
-
853
- <div className="grid grid-cols-1 lg:grid-cols-2 gap-6">
854
- {eventsLoading ? (
855
- <LoadingSkeleton layout="chart" />
856
- ) : (
857
- <ActivityCharts events={recentEvents || []} />
858
- )}
859
-
860
- {transactionsLoading ? (
861
- <LoadingSkeleton layout="chart" />
862
- ) : (
863
- <RevenueCharts transactions={transactions || []} />
864
- )}
865
- </div>
866
-
867
- {transactionsLoading ? (
868
- <LoadingSkeleton layout="table" />
869
- ) : (
870
- <RecentTransactions transactions={transactions || []} />
871
- )}
872
- </div>
873
- );
874
- }
875
- ```
876
-
877
- **Key Changes:**
878
-
879
- 1. Replaced `useQuery` with `useThings` and `useEvents`
880
- 2. Added granular loading states for each data source
881
- 3. Added error handling with ErrorMessage component
882
- 4. Added memoization for expensive calculations
883
- 5. Added responsive grid layout
884
- 6. Added proper loading skeletons
885
-
886
- ---
887
-
888
- ### Example 2: ActivityCharts Migration
889
-
890
- **BEFORE (Receives Pre-Aggregated Data):**
891
-
892
- ```typescript
893
- // frontend/src/components/dashboard/ActivityCharts.tsx
894
- import { LineChart, Line, XAxis, YAxis, Tooltip, ResponsiveContainer } from "recharts";
895
- import type { Event } from "@/convex/_generated/dataModel";
896
-
897
- interface ActivityChartsProps {
898
- events: Event[];
899
- }
900
-
901
- export function ActivityCharts({ events }: ActivityChartsProps) {
902
- // Simple data transformation
903
- const chartData = events.map(event => ({
904
- timestamp: new Date(event.timestamp).toLocaleDateString(),
905
- count: 1
906
- }));
907
-
908
- return (
909
- <div className="bg-white p-6 rounded-lg shadow">
910
- <h3 className="text-lg font-semibold mb-4">Recent Activity</h3>
911
- <ResponsiveContainer width="100%" height={300}>
912
- <LineChart data={chartData}>
913
- <XAxis dataKey="timestamp" />
914
- <YAxis />
915
- <Tooltip />
916
- <Line type="monotone" dataKey="count" stroke="#8884d8" />
917
- </LineChart>
918
- </ResponsiveContainer>
919
- </div>
920
- );
921
- }
922
- ```
923
-
924
- **AFTER (With Client-Side Aggregation and Optimization):**
925
-
926
- ```typescript
927
- // frontend/src/components/dashboard/ActivityCharts.tsx
928
- import { useMemo } from "react";
929
- import { LineChart, Line, XAxis, YAxis, Tooltip, ResponsiveContainer } from "recharts";
930
- import type { Event } from "@/types/ontology";
931
-
932
- interface ActivityChartsProps {
933
- events: Event[];
934
- }
935
-
936
- export function ActivityCharts({ events }: ActivityChartsProps) {
937
- // Memoized data aggregation
938
- const chartData = useMemo(() => {
939
- // Group events by day
940
- const eventsByDay = events.reduce((acc, event) => {
941
- const day = new Date(event.timestamp).toLocaleDateString();
942
- acc[day] = (acc[day] || 0) + 1;
943
- return acc;
944
- }, {} as Record<string, number>);
945
-
946
- // Convert to array sorted by date
947
- return Object.entries(eventsByDay)
948
- .map(([date, count]) => ({
949
- date,
950
- count,
951
- timestamp: new Date(date).getTime()
952
- }))
953
- .sort((a, b) => a.timestamp - b.timestamp)
954
- .map(({ date, count }) => ({ date, count }));
955
- }, [events]);
956
-
957
- // Event type breakdown
958
- const eventTypeData = useMemo(() => {
959
- const typeCount = events.reduce((acc, event) => {
960
- acc[event.type] = (acc[event.type] || 0) + 1;
961
- return acc;
962
- }, {} as Record<string, number>);
963
-
964
- return Object.entries(typeCount)
965
- .map(([type, count]) => ({ type, count }))
966
- .sort((a, b) => b.count - a.count)
967
- .slice(0, 5); // Top 5 event types
968
- }, [events]);
969
-
970
- return (
971
- <div className="bg-white dark:bg-gray-800 p-6 rounded-lg shadow">
972
- <h3 className="text-lg font-semibold mb-4">Recent Activity</h3>
973
-
974
- {/* Timeline Chart */}
975
- <div className="mb-6">
976
- <h4 className="text-sm font-medium text-gray-600 dark:text-gray-400 mb-2">
977
- Activity Over Time
978
- </h4>
979
- <ResponsiveContainer width="100%" height={250}>
980
- <LineChart data={chartData}>
981
- <XAxis
982
- dataKey="date"
983
- tick={{ fontSize: 12 }}
984
- tickFormatter={(value) => new Date(value).toLocaleDateString(undefined, { month: 'short', day: 'numeric' })}
985
- />
986
- <YAxis tick={{ fontSize: 12 }} />
987
- <Tooltip
988
- contentStyle={{
989
- backgroundColor: 'hsl(var(--color-background))',
990
- border: '1px solid hsl(var(--color-border))',
991
- borderRadius: '8px'
992
- }}
993
- />
994
- <Line
995
- type="monotone"
996
- dataKey="count"
997
- stroke="hsl(var(--color-primary))"
998
- strokeWidth={2}
999
- dot={{ r: 4 }}
1000
- activeDot={{ r: 6 }}
1001
- />
1002
- </LineChart>
1003
- </ResponsiveContainer>
1004
- </div>
1005
-
1006
- {/* Event Type Breakdown */}
1007
- <div>
1008
- <h4 className="text-sm font-medium text-gray-600 dark:text-gray-400 mb-2">
1009
- Top Event Types
1010
- </h4>
1011
- <div className="space-y-2">
1012
- {eventTypeData.map(({ type, count }) => (
1013
- <div key={type} className="flex justify-between items-center">
1014
- <span className="text-sm">{type.replace(/_/g, ' ')}</span>
1015
- <span className="text-sm font-semibold">{count}</span>
1016
- </div>
1017
- ))}
1018
- </div>
1019
- </div>
1020
- </div>
1021
- );
1022
- }
1023
- ```
1024
-
1025
- **Key Changes:**
1026
-
1027
- 1. Added memoization for expensive aggregation operations
1028
- 2. Added event type breakdown visualization
1029
- 3. Improved chart styling with theme colors
1030
- 4. Added dark mode support
1031
- 5. Improved date formatting
1032
- 6. Removed dependency on Convex types
1033
-
1034
- ---
1035
-
1036
- ### Example 3: RevenueCharts Migration
1037
-
1038
- **BEFORE:**
1039
-
1040
- ```typescript
1041
- // frontend/src/components/dashboard/RevenueCharts.tsx
1042
- import { BarChart, Bar, XAxis, YAxis, Tooltip, ResponsiveContainer } from "recharts";
1043
- import type { Event } from "@/convex/_generated/dataModel";
1044
-
1045
- interface RevenueChartsProps {
1046
- transactions: Event[];
1047
- }
1048
-
1049
- export function RevenueCharts({ transactions }: RevenueChartsProps) {
1050
- const revenueData = transactions.map(tx => ({
1051
- date: new Date(tx.timestamp).toLocaleDateString(),
1052
- revenue: tx.metadata.amount || 0
1053
- }));
1054
-
1055
- return (
1056
- <div className="bg-white p-6 rounded-lg shadow">
1057
- <h3 className="text-lg font-semibold mb-4">Revenue</h3>
1058
- <ResponsiveContainer width="100%" height={300}>
1059
- <BarChart data={revenueData}>
1060
- <XAxis dataKey="date" />
1061
- <YAxis />
1062
- <Tooltip />
1063
- <Bar dataKey="revenue" fill="#82ca9d" />
1064
- </BarChart>
1065
- </ResponsiveContainer>
1066
- </div>
1067
- );
1068
- }
1069
- ```
1070
-
1071
- **AFTER:**
1072
-
1073
- ```typescript
1074
- // frontend/src/components/dashboard/RevenueCharts.tsx
1075
- import { useMemo, useState } from "react";
1076
- import { BarChart, Bar, XAxis, YAxis, Tooltip, ResponsiveContainer, Cell } from "recharts";
1077
- import type { Event } from "@/types/ontology";
1078
-
1079
- interface RevenueChartsProps {
1080
- transactions: Event[];
1081
- }
1082
-
1083
- type TimeRange = "day" | "week" | "month";
1084
-
1085
- export function RevenueCharts({ transactions }: RevenueChartsProps) {
1086
- const [timeRange, setTimeRange] = useState<TimeRange>("week");
1087
-
1088
- // Memoized revenue aggregation by time range
1089
- const revenueData = useMemo(() => {
1090
- // Group by time range
1091
- const revenueByPeriod = transactions.reduce((acc, tx) => {
1092
- const date = new Date(tx.timestamp);
1093
- let key: string;
1094
-
1095
- switch (timeRange) {
1096
- case "day":
1097
- key = date.toLocaleDateString();
1098
- break;
1099
- case "week":
1100
- const weekStart = new Date(date);
1101
- weekStart.setDate(date.getDate() - date.getDay());
1102
- key = weekStart.toLocaleDateString();
1103
- break;
1104
- case "month":
1105
- key = `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}`;
1106
- break;
1107
- }
1108
-
1109
- const amount = tx.metadata?.amount || 0;
1110
- acc[key] = (acc[key] || 0) + amount;
1111
- return acc;
1112
- }, {} as Record<string, number>);
1113
-
1114
- // Convert to array and sort
1115
- return Object.entries(revenueByPeriod)
1116
- .map(([period, revenue]) => ({ period, revenue }))
1117
- .sort((a, b) => new Date(a.period).getTime() - new Date(b.period).getTime());
1118
- }, [transactions, timeRange]);
1119
-
1120
- // Calculate summary metrics
1121
- const metrics = useMemo(() => {
1122
- const total = revenueData.reduce((sum, item) => sum + item.revenue, 0);
1123
- const average = total / (revenueData.length || 1);
1124
- const max = Math.max(...revenueData.map(item => item.revenue));
1125
-
1126
- return { total, average, max };
1127
- }, [revenueData]);
1128
-
1129
- return (
1130
- <div className="bg-white dark:bg-gray-800 p-6 rounded-lg shadow">
1131
- <div className="flex justify-between items-center mb-4">
1132
- <h3 className="text-lg font-semibold">Revenue</h3>
1133
-
1134
- {/* Time Range Selector */}
1135
- <div className="flex gap-2">
1136
- {(["day", "week", "month"] as TimeRange[]).map(range => (
1137
- <button
1138
- key={range}
1139
- onClick={() => setTimeRange(range)}
1140
- className={`px-3 py-1 rounded text-sm ${
1141
- timeRange === range
1142
- ? "bg-blue-600 text-white"
1143
- : "bg-gray-200 text-gray-700 hover:bg-gray-300"
1144
- }`}
1145
- >
1146
- {range.charAt(0).toUpperCase() + range.slice(1)}
1147
- </button>
1148
- ))}
1149
- </div>
1150
- </div>
1151
-
1152
- {/* Summary Metrics */}
1153
- <div className="grid grid-cols-3 gap-4 mb-6">
1154
- <div className="text-center">
1155
- <div className="text-2xl font-bold text-green-600">
1156
- ${metrics.total.toLocaleString()}
1157
- </div>
1158
- <div className="text-xs text-gray-600 dark:text-gray-400">Total Revenue</div>
1159
- </div>
1160
- <div className="text-center">
1161
- <div className="text-2xl font-bold text-blue-600">
1162
- ${metrics.average.toLocaleString()}
1163
- </div>
1164
- <div className="text-xs text-gray-600 dark:text-gray-400">Average</div>
1165
- </div>
1166
- <div className="text-center">
1167
- <div className="text-2xl font-bold text-purple-600">
1168
- ${metrics.max.toLocaleString()}
1169
- </div>
1170
- <div className="text-xs text-gray-600 dark:text-gray-400">Peak</div>
1171
- </div>
1172
- </div>
1173
-
1174
- {/* Chart */}
1175
- <ResponsiveContainer width="100%" height={250}>
1176
- <BarChart data={revenueData}>
1177
- <XAxis
1178
- dataKey="period"
1179
- tick={{ fontSize: 12 }}
1180
- tickFormatter={(value) => {
1181
- const date = new Date(value);
1182
- return timeRange === "month"
1183
- ? date.toLocaleDateString(undefined, { month: 'short', year: 'numeric' })
1184
- : date.toLocaleDateString(undefined, { month: 'short', day: 'numeric' });
1185
- }}
1186
- />
1187
- <YAxis
1188
- tick={{ fontSize: 12 }}
1189
- tickFormatter={(value) => `$${value.toLocaleString()}`}
1190
- />
1191
- <Tooltip
1192
- formatter={(value: number) => [`$${value.toLocaleString()}`, "Revenue"]}
1193
- contentStyle={{
1194
- backgroundColor: 'hsl(var(--color-background))',
1195
- border: '1px solid hsl(var(--color-border))',
1196
- borderRadius: '8px'
1197
- }}
1198
- />
1199
- <Bar dataKey="revenue" radius={[8, 8, 0, 0]}>
1200
- {revenueData.map((entry, index) => (
1201
- <Cell
1202
- key={`cell-${index}`}
1203
- fill={`hsl(${120 + (entry.revenue / metrics.max) * 60}, 70%, 50%)`}
1204
- />
1205
- ))}
1206
- </Bar>
1207
- </BarChart>
1208
- </ResponsiveContainer>
1209
- </div>
1210
- );
1211
- }
1212
- ```
1213
-
1214
- **Key Changes:**
1215
-
1216
- 1. Added time range selector (day/week/month)
1217
- 2. Added summary metrics (total, average, peak)
1218
- 3. Added dynamic bar coloring based on revenue amount
1219
- 4. Added memoization for aggregation
1220
- 5. Improved date formatting based on time range
1221
- 6. Added dark mode support
1222
-
1223
- ---
1224
-
1225
- ### Example 4: RecentTransactions Migration
1226
-
1227
- **BEFORE:**
1228
-
1229
- ```typescript
1230
- // frontend/src/components/dashboard/RecentTransactions.tsx
1231
- import type { Event } from "@/convex/_generated/dataModel";
1232
-
1233
- interface RecentTransactionsProps {
1234
- transactions: Event[];
1235
- }
1236
-
1237
- export function RecentTransactions({ transactions }: RecentTransactionsProps) {
1238
- return (
1239
- <div className="bg-white p-6 rounded-lg shadow">
1240
- <h3 className="text-lg font-semibold mb-4">Recent Transactions</h3>
1241
- <table className="w-full">
1242
- <thead>
1243
- <tr>
1244
- <th>Date</th>
1245
- <th>Amount</th>
1246
- <th>Type</th>
1247
- </tr>
1248
- </thead>
1249
- <tbody>
1250
- {transactions.map(tx => (
1251
- <tr key={tx._id}>
1252
- <td>{new Date(tx.timestamp).toLocaleDateString()}</td>
1253
- <td>${tx.metadata.amount}</td>
1254
- <td>{tx.type}</td>
1255
- </tr>
1256
- ))}
1257
- </tbody>
1258
- </table>
1259
- </div>
1260
- );
1261
- }
1262
- ```
1263
-
1264
- **AFTER:**
1265
-
1266
- ```typescript
1267
- // frontend/src/components/dashboard/RecentTransactions.tsx
1268
- import { useMemo } from "react";
1269
- import { useThing } from "@/providers/hooks";
1270
- import type { Event } from "@/types/ontology";
1271
- import type { Id } from "@/types/convex";
1272
-
1273
- interface RecentTransactionsProps {
1274
- transactions: Event[];
1275
- }
1276
-
1277
- function TransactionRow({ transaction }: { transaction: Event }) {
1278
- // Fetch actor and target entities for display
1279
- const { data: actor } = useThing({ id: transaction.actorId as Id<"things"> });
1280
- const { data: target } = useThing({ id: transaction.targetId as Id<"things"> });
1281
-
1282
- const amount = transaction.metadata?.amount || 0;
1283
- const transactionType = transaction.type.replace(/_/g, ' ');
1284
-
1285
- return (
1286
- <tr className="border-b border-gray-200 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-800">
1287
- <td className="py-3 px-4">
1288
- <div className="text-sm font-medium">
1289
- {new Date(transaction.timestamp).toLocaleDateString(undefined, {
1290
- month: 'short',
1291
- day: 'numeric',
1292
- year: 'numeric'
1293
- })}
1294
- </div>
1295
- <div className="text-xs text-gray-500">
1296
- {new Date(transaction.timestamp).toLocaleTimeString(undefined, {
1297
- hour: '2-digit',
1298
- minute: '2-digit'
1299
- })}
1300
- </div>
1301
- </td>
1302
- <td className="py-3 px-4">
1303
- <div className="text-sm font-semibold text-green-600">${amount.toLocaleString()}</div>
1304
- </td>
1305
- <td className="py-3 px-4">
1306
- <div className="text-sm">{transactionType}</div>
1307
- </td>
1308
- <td className="py-3 px-4">
1309
- <div className="text-sm text-gray-600 dark:text-gray-400">
1310
- {actor?.name || "Unknown"}
1311
- </div>
1312
- </td>
1313
- <td className="py-3 px-4">
1314
- <div className="text-sm text-gray-600 dark:text-gray-400">
1315
- {target?.name || "Unknown"}
1316
- </div>
1317
- </td>
1318
- <td className="py-3 px-4">
1319
- <span className={`px-2 py-1 rounded-full text-xs font-medium ${
1320
- transaction.metadata?.status === "completed"
1321
- ? "bg-green-100 text-green-800"
1322
- : transaction.metadata?.status === "pending"
1323
- ? "bg-yellow-100 text-yellow-800"
1324
- : "bg-red-100 text-red-800"
1325
- }`}>
1326
- {transaction.metadata?.status || "completed"}
1327
- </span>
1328
- </td>
1329
- </tr>
1330
- );
1331
- }
1332
-
1333
- export function RecentTransactions({ transactions }: RecentTransactionsProps) {
1334
- // Sort by most recent
1335
- const sortedTransactions = useMemo(() => {
1336
- return [...transactions].sort((a, b) => b.timestamp - a.timestamp);
1337
- }, [transactions]);
1338
-
1339
- // Calculate total
1340
- const totalRevenue = useMemo(() => {
1341
- return transactions.reduce((sum, tx) => sum + (tx.metadata?.amount || 0), 0);
1342
- }, [transactions]);
1343
-
1344
- return (
1345
- <div className="bg-white dark:bg-gray-800 p-6 rounded-lg shadow">
1346
- <div className="flex justify-between items-center mb-4">
1347
- <h3 className="text-lg font-semibold">Recent Transactions</h3>
1348
- <div className="text-sm text-gray-600 dark:text-gray-400">
1349
- Total: <span className="font-semibold text-green-600">${totalRevenue.toLocaleString()}</span>
1350
- </div>
1351
- </div>
1352
-
1353
- {sortedTransactions.length === 0 ? (
1354
- <div className="text-center py-8 text-gray-500">
1355
- No transactions yet
1356
- </div>
1357
- ) : (
1358
- <div className="overflow-x-auto">
1359
- <table className="w-full">
1360
- <thead>
1361
- <tr className="border-b border-gray-300 dark:border-gray-600">
1362
- <th className="py-2 px-4 text-left text-xs font-semibold text-gray-600 dark:text-gray-400 uppercase tracking-wider">
1363
- Date
1364
- </th>
1365
- <th className="py-2 px-4 text-left text-xs font-semibold text-gray-600 dark:text-gray-400 uppercase tracking-wider">
1366
- Amount
1367
- </th>
1368
- <th className="py-2 px-4 text-left text-xs font-semibold text-gray-600 dark:text-gray-400 uppercase tracking-wider">
1369
- Type
1370
- </th>
1371
- <th className="py-2 px-4 text-left text-xs font-semibold text-gray-600 dark:text-gray-400 uppercase tracking-wider">
1372
- From
1373
- </th>
1374
- <th className="py-2 px-4 text-left text-xs font-semibold text-gray-600 dark:text-gray-400 uppercase tracking-wider">
1375
- To
1376
- </th>
1377
- <th className="py-2 px-4 text-left text-xs font-semibold text-gray-600 dark:text-gray-400 uppercase tracking-wider">
1378
- Status
1379
- </th>
1380
- </tr>
1381
- </thead>
1382
- <tbody>
1383
- {sortedTransactions.map(transaction => (
1384
- <TransactionRow key={transaction._id} transaction={transaction} />
1385
- ))}
1386
- </tbody>
1387
- </table>
1388
- </div>
1389
- )}
1390
- </div>
1391
- );
1392
- }
1393
- ```
1394
-
1395
- **Key Changes:**
1396
-
1397
- 1. Added TransactionRow component with entity lookups
1398
- 2. Added sorting by timestamp
1399
- 3. Added total revenue calculation
1400
- 4. Added status badges with colors
1401
- 5. Added empty state
1402
- 6. Improved table styling with dark mode
1403
- 7. Added actor and target entity display
1404
-
1405
- ---
1406
-
1407
- ### Example 5: QuickActions Component
1408
-
1409
- **NEW Component (Not in Original Spec):**
1410
-
1411
- ```typescript
1412
- // frontend/src/components/dashboard/QuickActions.tsx
1413
- import { useState } from "react";
1414
- import { useCreateThing, useCreateConnection } from "@/providers/hooks";
1415
- import { useAuth } from "@/providers/auth";
1416
- import { PlusIcon, UserPlusIcon, FileTextIcon, BotIcon } from "lucide-react";
1417
- import { toast } from "sonner";
1418
- import type { ThingType } from "@/types/ontology";
1419
-
1420
- export function QuickActions() {
1421
- const { user } = useAuth();
1422
- const [creating, setCreating] = useState(false);
1423
- const createThing = useCreateThing();
1424
- const createConnection = useCreateConnection();
1425
-
1426
- const handleCreateEntity = async (type: ThingType, name: string) => {
1427
- setCreating(true);
1428
- try {
1429
- const entityId = await createThing({
1430
- type,
1431
- name,
1432
- properties: {},
1433
- status: "draft"
1434
- });
1435
-
1436
- // Create ownership connection
1437
- if (user) {
1438
- await createConnection({
1439
- fromThingId: user.id,
1440
- toThingId: entityId,
1441
- relationshipType: "owns",
1442
- metadata: { createdVia: "quick_action" }
1443
- });
1444
- }
1445
-
1446
- toast.success(`${name} created successfully!`);
1447
- } catch (error) {
1448
- toast.error(`Failed to create ${name}`);
1449
- console.error(error);
1450
- } finally {
1451
- setCreating(false);
1452
- }
1453
- };
1454
-
1455
- const actions = [
1456
- {
1457
- icon: FileTextIcon,
1458
- label: "New Course",
1459
- color: "blue",
1460
- onClick: () => handleCreateEntity("course", "New Course")
1461
- },
1462
- {
1463
- icon: BotIcon,
1464
- label: "New AI Agent",
1465
- color: "purple",
1466
- onClick: () => handleCreateEntity("ai_clone", "New Agent")
1467
- },
1468
- {
1469
- icon: UserPlusIcon,
1470
- label: "Invite Student",
1471
- color: "green",
1472
- onClick: () => {
1473
- // Open invite modal
1474
- toast.info("Opening invite dialog...");
1475
- }
1476
- }
1477
- ];
1478
-
1479
- return (
1480
- <div className="bg-white dark:bg-gray-800 p-6 rounded-lg shadow">
1481
- <h3 className="text-lg font-semibold mb-4">Quick Actions</h3>
1482
- <div className="grid grid-cols-1 sm:grid-cols-3 gap-4">
1483
- {actions.map(action => {
1484
- const Icon = action.icon;
1485
- return (
1486
- <button
1487
- key={action.label}
1488
- onClick={action.onClick}
1489
- disabled={creating}
1490
- className={`flex items-center gap-3 p-4 rounded-lg border-2 border-${action.color}-200 hover:border-${action.color}-400 hover:bg-${action.color}-50 dark:hover:bg-${action.color}-900 transition-colors disabled:opacity-50 disabled:cursor-not-allowed`}
1491
- >
1492
- <Icon className={`w-6 h-6 text-${action.color}-600`} />
1493
- <span className="font-medium">{action.label}</span>
1494
- </button>
1495
- );
1496
- })}
1497
- </div>
1498
- </div>
1499
- );
1500
- }
1501
- ```
1502
-
1503
- ---
1504
-
1505
- ## 6. Testing Strategy
1506
-
1507
- ### Unit Tests
1508
-
1509
- **Test each component independently with mocked DataProvider hooks:**
1510
-
1511
- ```typescript
1512
- // frontend/test/components/dashboard/CourseList.test.tsx
1513
- import { describe, it, expect, vi } from "vitest";
1514
- import { render, screen } from "@testing-library/react";
1515
- import { CourseList } from "@/components/dashboard/CourseList";
1516
- import * as hooks from "@/providers/hooks";
1517
-
1518
- describe("CourseList", () => {
1519
- it("displays loading state", () => {
1520
- vi.spyOn(hooks, "useThings").mockReturnValue({
1521
- data: undefined,
1522
- loading: true,
1523
- error: null
1524
- });
1525
-
1526
- render(<CourseList />);
1527
- expect(screen.getByText(/loading/i)).toBeInTheDocument();
1528
- });
1529
-
1530
- it("displays courses when loaded", () => {
1531
- vi.spyOn(hooks, "useThings").mockReturnValue({
1532
- data: [
1533
- { _id: "1", type: "course", name: "Course 1", properties: {}, status: "published" },
1534
- { _id: "2", type: "course", name: "Course 2", properties: {}, status: "published" }
1535
- ],
1536
- loading: false,
1537
- error: null
1538
- });
1539
-
1540
- render(<CourseList />);
1541
- expect(screen.getByText("Course 1")).toBeInTheDocument();
1542
- expect(screen.getByText("Course 2")).toBeInTheDocument();
1543
- });
1544
-
1545
- it("displays error state", () => {
1546
- vi.spyOn(hooks, "useThings").mockReturnValue({
1547
- data: undefined,
1548
- loading: false,
1549
- error: new Error("Failed to load courses")
1550
- });
1551
-
1552
- render(<CourseList />);
1553
- expect(screen.getByText(/failed to load/i)).toBeInTheDocument();
1554
- });
1555
- });
1556
- ```
1557
-
1558
- ### Integration Tests
1559
-
1560
- **Test dashboard with full DataProvider context:**
1561
-
1562
- ```typescript
1563
- // frontend/test/integration/dashboard.test.tsx
1564
- import { describe, it, expect } from "vitest";
1565
- import { render, screen, waitFor } from "@testing-library/react";
1566
- import { DataProvider } from "@/providers/data-provider";
1567
- import { DashboardOverview } from "@/components/dashboard/DashboardOverview";
1568
-
1569
- describe("Dashboard Integration", () => {
1570
- it("loads dashboard with all data", async () => {
1571
- render(
1572
- <DataProvider>
1573
- <DashboardOverview />
1574
- </DataProvider>
1575
- );
1576
-
1577
- // Wait for loading to complete
1578
- await waitFor(() => {
1579
- expect(screen.queryByText(/loading/i)).not.toBeInTheDocument();
1580
- });
1581
-
1582
- // Verify all sections render
1583
- expect(screen.getByText(/total courses/i)).toBeInTheDocument();
1584
- expect(screen.getByText(/total students/i)).toBeInTheDocument();
1585
- expect(screen.getByText(/recent activity/i)).toBeInTheDocument();
1586
- expect(screen.getByText(/revenue/i)).toBeInTheDocument();
1587
- });
1588
- });
1589
- ```
1590
-
1591
- ### Visual Regression Tests
1592
-
1593
- **Capture screenshots and compare:**
1594
-
1595
- ```typescript
1596
- // frontend/test/visual/dashboard.visual.test.tsx
1597
- import { test, expect } from "@playwright/test";
1598
-
1599
- test("dashboard matches baseline", async ({ page }) => {
1600
- await page.goto("http://localhost:4321/dashboard");
1601
-
1602
- // Wait for loading to complete
1603
- await page.waitForSelector('[data-testid="dashboard-loaded"]');
1604
-
1605
- // Capture screenshot
1606
- await expect(page).toHaveScreenshot("dashboard-overview.png");
1607
- });
1608
-
1609
- test("dashboard dark mode matches baseline", async ({ page }) => {
1610
- await page.goto("http://localhost:4321/dashboard");
1611
- await page.waitForSelector('[data-testid="dashboard-loaded"]');
1612
-
1613
- // Enable dark mode
1614
- await page.click('[data-testid="theme-toggle"]');
1615
-
1616
- // Capture screenshot
1617
- await expect(page).toHaveScreenshot("dashboard-overview-dark.png");
1618
- });
1619
- ```
1620
-
1621
- ### Performance Tests
1622
-
1623
- **Measure and validate performance:**
1624
-
1625
- ```typescript
1626
- // frontend/test/performance/dashboard.perf.test.ts
1627
- import { test, expect } from "@playwright/test";
1628
-
1629
- test("dashboard loads within performance budget", async ({ page }) => {
1630
- // Start performance measurement
1631
- await page.goto("http://localhost:4321/dashboard");
1632
-
1633
- // Measure LCP (Largest Contentful Paint)
1634
- const lcp = await page.evaluate(() => {
1635
- return new Promise((resolve) => {
1636
- new PerformanceObserver((list) => {
1637
- const entries = list.getEntries();
1638
- const lastEntry = entries[entries.length - 1];
1639
- resolve(lastEntry.renderTime || lastEntry.loadTime);
1640
- }).observe({ entryTypes: ["largest-contentful-paint"] });
1641
- });
1642
- });
1643
-
1644
- // Verify LCP < 2.5s
1645
- expect(lcp).toBeLessThan(2500);
1646
-
1647
- // Measure FID (First Input Delay)
1648
- const fid = await page.evaluate(() => {
1649
- return new Promise((resolve) => {
1650
- new PerformanceObserver((list) => {
1651
- const entries = list.getEntries();
1652
- resolve(entries[0].processingStart - entries[0].startTime);
1653
- }).observe({ entryTypes: ["first-input"] });
1654
-
1655
- // Trigger input
1656
- document.body.click();
1657
- });
1658
- });
1659
-
1660
- // Verify FID < 100ms
1661
- expect(fid).toBeLessThan(100);
1662
- });
1663
- ```
1664
-
1665
- ---
1666
-
1667
- ## 7. Quality Gates
1668
-
1669
- ### Pre-Implementation Checklist
1670
-
1671
- - [ ] Feature 2-5 (Auth Migration) is complete
1672
- - [ ] All auth tests pass
1673
- - [ ] DataProvider hooks are tested and working
1674
- - [ ] Performance baseline established
1675
-
1676
- ### During Implementation Checklist
1677
-
1678
- **Component Migration:**
1679
-
1680
- - [ ] DashboardOverview migrated to DataProvider
1681
- - [ ] StatsCards migrated to DataProvider
1682
- - [ ] ActivityCharts migrated to DataProvider
1683
- - [ ] RevenueCharts migrated to DataProvider
1684
- - [ ] RecentTransactions migrated to DataProvider
1685
- - [ ] CourseList migrated to DataProvider
1686
- - [ ] CourseDetail migrated to DataProvider
1687
- - [ ] LessonList migrated to DataProvider
1688
- - [ ] LessonDetail migrated to DataProvider
1689
- - [ ] StudentList migrated to DataProvider
1690
- - [ ] ActivityFeed migrated to DataProvider
1691
- - [ ] SearchBar migrated to DataProvider
1692
- - [ ] SettingsPanel migrated to DataProvider
1693
-
1694
- **Code Quality:**
1695
-
1696
- - [ ] Zero direct Convex imports in dashboard components
1697
- - [ ] Zero `import { api } from "@/convex/_generated/api"` in dashboard
1698
- - [ ] All components use DataProvider hooks
1699
- - [ ] All loading states implemented
1700
- - [ ] All error states implemented
1701
- - [ ] TypeScript errors: 0
1702
- - [ ] ESLint warnings: 0
1703
-
1704
- **Testing:**
1705
-
1706
- - [ ] Unit tests for all migrated components
1707
- - [ ] Integration tests for dashboard flow
1708
- - [ ] Visual regression tests pass
1709
- - [ ] Performance tests within 10% of baseline
1710
- - [ ] Real-time updates work correctly
1711
- - [ ] Optimistic updates work correctly
1712
-
1713
- ### Post-Implementation Checklist
1714
-
1715
- - [ ] All dashboard components migrated
1716
- - [ ] Full test suite passes (100%)
1717
- - [ ] Performance within 10% of baseline
1718
- - [ ] Documentation updated
1719
- - [ ] Migration guide written
1720
- - [ ] Code review completed
1721
- - [ ] QA validation passed
1722
-
1723
- ---
1724
-
1725
- ## 8. Rollback Plan
1726
-
1727
- ### Rollback Strategy
1728
-
1729
- **Feature Flag:**
1730
-
1731
- ```typescript
1732
- // frontend/src/lib/feature-flags.ts
1733
- export const USE_NEW_DASHBOARD = import.meta.env.PUBLIC_USE_NEW_DASHBOARD === "true";
1734
-
1735
- // Usage in component
1736
- import { USE_NEW_DASHBOARD } from "@/lib/feature-flags";
1737
-
1738
- export function Dashboard() {
1739
- if (USE_NEW_DASHBOARD) {
1740
- return <NewDashboard />;
1741
- }
1742
- return <LegacyDashboard />;
1743
- }
1744
- ```
1745
-
1746
- **Git Rollback Points:**
1747
-
1748
- 1. Tag before starting: `git tag -a dashboard-migration-start -m "Dashboard migration baseline"`
1749
- 2. Tag after each phase: `git tag -a dashboard-migration-phase-1 -m "Phase 1 complete"`
1750
- 3. Rollback command: `git reset --hard dashboard-migration-start`
1751
-
1752
- **Incremental Rollback:**
1753
-
1754
- - Each component can be rolled back independently
1755
- - Keep old component files as `.legacy.tsx` during migration
1756
- - Remove `.legacy.tsx` files only after QA validation
1757
-
1758
- **Rollback Time: < 5 minutes**
1759
-
1760
- Steps:
1761
-
1762
- 1. Set `PUBLIC_USE_NEW_DASHBOARD=false` in `.env.local`
1763
- 2. Restart dev server: `bun run dev`
1764
- 3. If needed, git reset: `git reset --hard dashboard-migration-start`
1765
-
1766
- ---
1767
-
1768
- ## 9. Documentation Requirements
1769
-
1770
- ### Migration Guide
1771
-
1772
- **Document for developers:**
1773
-
1774
- ```markdown
1775
- # Dashboard Migration Guide
1776
-
1777
- ## Overview
1778
-
1779
- This guide explains how to migrate dashboard components from direct Convex integration to DataProvider.
1780
-
1781
- ## Before Migration
1782
-
1783
- - Component uses `useQuery` from `convex/react`
1784
- - Component imports `api` from `@/convex/_generated/api`
1785
- - Loading state is implicit (`data === undefined`)
1786
-
1787
- ## After Migration
1788
-
1789
- - Component uses `useThings`, `useThing`, `useEvents` from `@/providers/hooks`
1790
- - Component uses backend-agnostic types from `@/types/ontology`
1791
- - Loading state is explicit (`loading` boolean)
1792
-
1793
- ## Step-by-Step Migration
1794
-
1795
- ### 1. Replace Imports
1796
-
1797
- \`\`\`typescript
1798
- // BEFORE
1799
- import { useQuery, useMutation } from "convex/react";
1800
- import { api } from "@/convex/\_generated/api";
1801
-
1802
- // AFTER
1803
- import { useThings, useCreateThing } from "@/providers/hooks";
1804
- \`\`\`
1805
-
1806
- ### 2. Replace Hooks
1807
-
1808
- \`\`\`typescript
1809
- // BEFORE
1810
- const courses = useQuery(api.queries.entities.list, { type: "course" });
1811
-
1812
- // AFTER
1813
- const { data: courses, loading, error } = useThings({ type: "course" });
1814
- \`\`\`
1815
-
1816
- ### 3. Update Loading State
1817
-
1818
- \`\`\`typescript
1819
- // BEFORE
1820
- if (courses === undefined) return <LoadingSpinner />;
1821
-
1822
- // AFTER
1823
- if (loading) return <LoadingSpinner />;
1824
- \`\`\`
1825
-
1826
- ### 4. Add Error Handling
1827
-
1828
- \`\`\`typescript
1829
- // NEW (add this)
1830
- if (error) return <ErrorMessage error={error} />;
1831
- \`\`\`
1832
-
1833
- ### 5. Update Tests
1834
-
1835
- \`\`\`typescript
1836
- // Mock DataProvider hooks
1837
- vi.spyOn(hooks, "useThings").mockReturnValue({
1838
- data: mockCourses,
1839
- loading: false,
1840
- error: null
1841
- });
1842
- \`\`\`
1843
- ```
1844
-
1845
- ### Component API Changes
1846
-
1847
- **Document breaking changes:**
1848
-
1849
- ```markdown
1850
- # Dashboard Component API Changes
1851
-
1852
- ## DashboardOverview
1853
-
1854
- - **No breaking changes** - Props remain the same
1855
- - Internal implementation changed to use DataProvider
1856
-
1857
- ## CourseList
1858
-
1859
- - **No breaking changes** - Props remain the same
1860
- - Now supports `error` prop for external error display
1861
-
1862
- ## ActivityFeed
1863
-
1864
- - **New prop:** `onLoadMore` - Callback for pagination
1865
- - **Changed:** Real-time updates now via DataProvider subscriptions
1866
-
1867
- ## SearchBar
1868
-
1869
- - **New prop:** `debounceMs` - Control search debounce timing (default: 300ms)
1870
- - **Changed:** Search now backend-agnostic
1871
- ```
1872
-
1873
- ### Performance Benchmarks
1874
-
1875
- **Document before/after metrics:**
1876
-
1877
- ```markdown
1878
- # Dashboard Performance Benchmarks
1879
-
1880
- ## Metrics (Before Migration)
1881
-
1882
- - Initial Load: 1.8s
1883
- - LCP: 2.1s
1884
- - FID: 45ms
1885
- - CLS: 0.05
1886
- - Lighthouse Score: 92
1887
-
1888
- ## Metrics (After Migration)
1889
-
1890
- - Initial Load: 1.9s (+5.5%)
1891
- - LCP: 2.2s (+4.8%)
1892
- - FID: 48ms (+6.7%)
1893
- - CLS: 0.05 (0%)
1894
- - Lighthouse Score: 91 (-1 point)
1895
-
1896
- ## Analysis
1897
-
1898
- - Minimal performance impact (<10% for all metrics)
1899
- - Additional abstraction layer adds negligible overhead
1900
- - Real-time updates remain performant
1901
- - No degradation in user experience
1902
- ```
1903
-
1904
- ### Known Issues
1905
-
1906
- ```markdown
1907
- # Dashboard Migration Known Issues
1908
-
1909
- ## Issue 1: Chart Animation Delay
1910
-
1911
- **Severity:** Low
1912
- **Description:** Charts have 100ms animation delay on initial render
1913
- **Workaround:** Set `animationDuration={0}` in chart props
1914
- **Fix Timeline:** Will be addressed in next optimization phase
1915
-
1916
- ## Issue 2: Search Debounce Configuration
1917
-
1918
- **Severity:** Low
1919
- **Description:** Search debounce timing not configurable per-component
1920
- **Workaround:** Modify global `SEARCH_DEBOUNCE_MS` constant
1921
- **Fix Timeline:** Add per-component prop in v2
1922
-
1923
- ## Issue 3: Loading Skeleton Flash
1924
-
1925
- **Severity:** Medium
1926
- **Description:** Loading skeleton flashes briefly on fast connections
1927
- **Workaround:** Increase minimum loading time to 200ms
1928
- **Fix Timeline:** Implement smart loading delay based on connection speed
1929
- ```
1930
-
1931
- ---
1932
-
1933
- ## 10. Success Criteria
1934
-
1935
- ### Functional Criteria
1936
-
1937
- - [x] **All Dashboard Components Migrated**
1938
- - DashboardOverview ✓
1939
- - StatsCards ✓
1940
- - ActivityCharts ✓
1941
- - RevenueCharts ✓
1942
- - RecentTransactions ✓
1943
- - CourseList ✓
1944
- - CourseDetail ✓
1945
- - LessonList ✓
1946
- - LessonDetail ✓
1947
- - StudentList ✓
1948
- - ActivityFeed ✓
1949
- - SearchBar ✓
1950
- - SettingsPanel ✓
1951
-
1952
- - [x] **Zero Direct Convex Dependencies**
1953
- - No `import { useQuery, useMutation } from "convex/react"` ✓
1954
- - No `import { api } from "@/convex/_generated/api"` ✓
1955
- - All queries go through DataProvider ✓
1956
-
1957
- - [x] **Feature Parity**
1958
- - All existing features preserved ✓
1959
- - Real-time updates working ✓
1960
- - Optimistic updates working ✓
1961
- - Loading states implemented ✓
1962
- - Error states implemented ✓
1963
-
1964
- ### Technical Criteria
1965
-
1966
- - [x] **Test Coverage**
1967
- - All component unit tests pass ✓
1968
- - All integration tests pass ✓
1969
- - Visual regression tests pass ✓
1970
- - Performance tests within 10% baseline ✓
1971
- - Test coverage > 80% ✓
1972
-
1973
- - [x] **Code Quality**
1974
- - TypeScript errors: 0 ✓
1975
- - ESLint warnings: 0 ✓
1976
- - Prettier formatting correct ✓
1977
- - No console errors in browser ✓
1978
-
1979
- - [x] **Performance**
1980
- - Initial load within 10% of baseline ✓
1981
- - LCP < 2.5s ✓
1982
- - FID < 100ms ✓
1983
- - CLS < 0.1 ✓
1984
- - Lighthouse score > 90 ✓
1985
-
1986
- ### Documentation Criteria
1987
-
1988
- - [x] **Documentation Complete**
1989
- - Migration guide written ✓
1990
- - Component API changes documented ✓
1991
- - Performance benchmarks published ✓
1992
- - Known issues documented ✓
1993
- - Code examples provided ✓
1994
-
1995
- ### Validation Criteria
1996
-
1997
- - [x] **Quality Agent Validation**
1998
- - All automated tests pass ✓
1999
- - Manual QA testing complete ✓
2000
- - Performance validation complete ✓
2001
- - Accessibility validation complete ✓
2002
-
2003
- - [x] **Stakeholder Approval**
2004
- - Engineering Director approves ✓
2005
- - Frontend Specialist approves ✓
2006
- - Quality Agent approves ✓
2007
-
2008
- ---
2009
-
2010
- ## Related Files
2011
-
2012
- - **Plan:** `/Users/toc/Server/ONE/one/things/plans/2-backend-agnostic-frontend.md`
2013
- - **Feature 2-5:** `/Users/toc/Server/ONE/one/things/features/2-5-auth-migration.md` (DEPENDENCY)
2014
- - **Implementation:** `/Users/toc/Server/ONE/frontend/src/components/dashboard/` (migrate these)
2015
- - **Tests:** `/Users/toc/Server/ONE/frontend/test/components/dashboard/` (component tests)
2016
- - **DataProvider:** `/Users/toc/Server/ONE/frontend/src/providers/data-provider.tsx`
2017
- - **Hooks:** `/Users/toc/Server/ONE/frontend/src/providers/hooks/` (useThings, useThing, etc.)
2018
-
2019
- ---
2020
-
2021
- ## Next Steps
2022
-
2023
- ### Immediate Actions (Today)
2024
-
2025
- 1. **Frontend Specialist:** Wait for Feature 2-5 completion signal from Director
2026
- 2. **Frontend Specialist:** Verify all auth tests pass
2027
- 3. **Frontend Specialist:** Review this specification thoroughly
2028
- 4. **Frontend Specialist:** Ask questions if anything is unclear
2029
-
2030
- ### Implementation Phase (Week 1)
2031
-
2032
- **Day 1: Preparation**
2033
-
2034
- - Set up feature branch
2035
- - Create rollback points
2036
- - Establish performance baseline
2037
- - Set up monitoring
2038
-
2039
- **Day 2-3: Entity Components**
2040
-
2041
- - Migrate CourseList, LessonList, StudentList
2042
- - Migrate CourseDetail, LessonDetail
2043
- - Test each component after migration
2044
-
2045
- **Day 4-5: Analytics Components**
2046
-
2047
- - Migrate DashboardOverview
2048
- - Migrate StatsCards, ActivityCharts, RevenueCharts
2049
- - Migrate RecentTransactions
2050
- - Test dashboard as a whole
2051
-
2052
- **Day 6: Activity & Search**
2053
-
2054
- - Migrate ActivityFeed
2055
- - Migrate SearchBar
2056
- - Test real-time updates
2057
-
2058
- **Day 7: Cleanup & Documentation**
2059
-
2060
- - Remove all Convex imports
2061
- - Run full test suite
2062
- - Write documentation
2063
- - Create pull request
2064
-
2065
- ### Validation Phase (Week 2)
2066
-
2067
- 1. **Quality Agent:** Run automated test suite
2068
- 2. **Quality Agent:** Perform manual QA testing
2069
- 3. **Quality Agent:** Validate performance benchmarks
2070
- 4. **Engineering Director:** Review and approve
2071
- 5. **Merge to main**
2072
-
2073
- ---
2074
-
2075
- **Status:** Ready for Implementation (Pending Feature 2-5)
2076
- **Created:** 2025-10-13
2077
- **Last Updated:** 2025-10-13
2078
- **Validated By:** Engineering Director Agent + Frontend Specialist
2079
- **Blocks:** Feature 2-7 (Course Management Migration)
2080
- **Estimated Completion:** Week 2 of Plan 2 Implementation
2081
-
2082
- ---
2083
-
2084
- **Built for performance. Backend-agnostic. User-friendly.**