oneie 2.0.2 → 2.0.3

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 (405) hide show
  1. package/AGENTS.md +245 -0
  2. package/CLAUDE.md +534 -0
  3. package/one/.obsidian/app.json +1 -0
  4. package/one/.obsidian/appearance.json +1 -0
  5. package/one/.obsidian/core-plugins.json +33 -0
  6. package/one/.obsidian/workspace.json +211 -0
  7. package/one/connections/a2a.md +551 -0
  8. package/one/connections/acp.md +761 -0
  9. package/one/connections/acps.md +731 -0
  10. package/one/connections/agui.md +767 -0
  11. package/one/connections/any-backend.md +1702 -0
  12. package/one/connections/ap2.md +998 -0
  13. package/one/connections/api-docs.md +1891 -0
  14. package/one/connections/api.md +2190 -0
  15. package/one/connections/architecture-diagram.md +94 -0
  16. package/one/connections/communications.md +449 -0
  17. package/one/connections/connections.md +339 -0
  18. package/one/connections/cryptonetworks.md +781 -0
  19. package/one/connections/documentation.md +1120 -0
  20. package/one/connections/effect.md +279 -0
  21. package/one/connections/elizaos.md +1290 -0
  22. package/one/connections/inference.md +58 -0
  23. package/one/connections/kyc.md +632 -0
  24. package/one/connections/mcp.md +842 -0
  25. package/one/connections/membership.md +1152 -0
  26. package/one/connections/middleware.md +1067 -0
  27. package/one/connections/multitenant.md +1341 -0
  28. package/one/connections/n8n.md +1015 -0
  29. package/one/connections/patterns.md +89 -0
  30. package/one/connections/protocols.md +279 -0
  31. package/one/connections/relationships.md +107 -0
  32. package/one/connections/schema.md +587 -0
  33. package/one/connections/service-layer.md +550 -0
  34. package/one/connections/structure.md +0 -0
  35. package/one/connections/vectors.md +207 -0
  36. package/one/connections/wordpress.md +1302 -0
  37. package/one/connections/workflow-copy.md +905 -0
  38. package/one/connections/workflow-examples.md +741 -0
  39. package/one/connections/workflow.md +905 -0
  40. package/one/connections/workflows/delegation.md +885 -0
  41. package/one/connections/workflows/frontend.md +1037 -0
  42. package/one/connections/workflows/strategy.md +903 -0
  43. package/one/connections/workflows/tasks.md +698 -0
  44. package/one/connections/x402.md +1249 -0
  45. package/one/events/events.md +545 -0
  46. package/one/knowledge/ai-platform.md +305 -0
  47. package/one/knowledge/architecture-diagram.md +94 -0
  48. package/one/knowledge/architecture-frontend.md +930 -0
  49. package/one/knowledge/architecture.md +2077 -0
  50. package/one/knowledge/crypto.md +960 -0
  51. package/one/knowledge/dsl.md +1660 -0
  52. package/one/knowledge/files.md +2471 -0
  53. package/one/knowledge/frontend.md +1038 -0
  54. package/one/knowledge/hono.md +2109 -0
  55. package/one/knowledge/implementation-examples.md +2536 -0
  56. package/one/knowledge/inference-score.md +159 -0
  57. package/one/knowledge/knowledge.md +642 -0
  58. package/one/knowledge/language.md +980 -0
  59. package/one/knowledge/lessons-learned.md +70 -0
  60. package/one/knowledge/ontology-6-dimensions.md +0 -0
  61. package/one/knowledge/ontology-documentation.md +356 -0
  62. package/one/knowledge/ontology-engineering-specification.md +1292 -0
  63. package/one/knowledge/ontology-engineering.md +1652 -0
  64. package/one/knowledge/ontology-frontend-copy-2.md +1492 -0
  65. package/one/knowledge/ontology-frontend-copy.md +753 -0
  66. package/one/knowledge/ontology-frontend-specifications.md +2188 -0
  67. package/one/knowledge/ontology-frontend.md +2427 -0
  68. package/one/knowledge/ontology-minimal.yaml +299 -0
  69. package/one/knowledge/ontology.md +2819 -0
  70. package/one/knowledge/ontology.yaml +1165 -0
  71. package/one/knowledge/patterns/backend/convex-mutation-pattern.md +100 -0
  72. package/one/knowledge/patterns/backend/convex-query-pattern.md +88 -0
  73. package/one/knowledge/patterns/backend/mutation-template.md +231 -0
  74. package/one/knowledge/patterns/backend/query-template.md +267 -0
  75. package/one/knowledge/patterns/backend/service-template.md +237 -0
  76. package/one/knowledge/patterns/design/component-architecture.md +399 -0
  77. package/one/knowledge/patterns/design/test-driven-design-pattern.md +162 -0
  78. package/one/knowledge/patterns/design/wireframe-template.md +216 -0
  79. package/one/knowledge/patterns/frontend/component-template.md +195 -0
  80. package/one/knowledge/patterns/frontend/form-template.md +276 -0
  81. package/one/knowledge/patterns/frontend/page-template.md +178 -0
  82. package/one/knowledge/patterns/frontend/react-component-pattern.md +128 -0
  83. package/one/knowledge/patterns/test/acceptance-criteria-template.md +378 -0
  84. package/one/knowledge/patterns/test/technical-test-template.md +544 -0
  85. package/one/knowledge/patterns/test/test-driven-pattern.md +140 -0
  86. package/one/knowledge/patterns/test/user-flow-template.md +254 -0
  87. package/one/knowledge/quality-loop.md +401 -0
  88. package/one/knowledge/readme.md +131 -0
  89. package/one/knowledge/rules.md +626 -0
  90. package/one/knowledge/score.md +67 -0
  91. package/one/knowledge/specifications.md +855 -0
  92. package/one/knowledge/tags.md +130 -0
  93. package/one/organisation/one.md +599 -0
  94. package/one/organisation/organisation.md +438 -0
  95. package/one/organisation/revenue.md +673 -0
  96. package/one/organisation/strategy.md +869 -0
  97. package/one/organisation/vision.md +98 -0
  98. package/one/people/anthony-o-connell.md +440 -0
  99. package/one/people/people.md +567 -0
  100. package/one/repomix-output.md +92634 -0
  101. package/one/things/agentkit.md +349 -0
  102. package/one/things/agents/agent-backend.md +1401 -0
  103. package/one/things/agents/agent-builder.md +955 -0
  104. package/one/things/agents/agent-clean.md +709 -0
  105. package/one/things/agents/agent-clone.md +1341 -0
  106. package/one/things/agents/agent-designer.md +2177 -0
  107. package/one/things/agents/agent-director.md +1508 -0
  108. package/one/things/agents/agent-documenter.md +1049 -0
  109. package/one/things/agents/agent-frontend.md +1119 -0
  110. package/one/things/agents/agent-integrator.md +1192 -0
  111. package/one/things/agents/agent-problem-solver.md +1379 -0
  112. package/one/things/agents/agent-quality.md +1353 -0
  113. package/one/things/agents/agent-sales.md +986 -0
  114. package/one/things/cascade/cascade.yaml +464 -0
  115. package/one/things/cascade/docs/examples/1-1-agent-prompts/design.md +470 -0
  116. package/one/things/cascade/docs/examples/1-1-agent-prompts/tests.md +264 -0
  117. package/one/things/cascade/docs/examples/1-1-agent-prompts.md +486 -0
  118. package/one/things/cascade/docs/examples/1-2-yaml-orchestrator/design.md +497 -0
  119. package/one/things/cascade/docs/examples/1-2-yaml-orchestrator/tests.md +227 -0
  120. package/one/things/cascade/docs/examples/1-2-yaml-orchestrator.md +516 -0
  121. package/one/things/cascade/docs/examples/1-3-event-coordination/design.md +544 -0
  122. package/one/things/cascade/docs/examples/1-3-event-coordination/tests.md +223 -0
  123. package/one/things/cascade/docs/examples/1-3-event-coordination.md +508 -0
  124. package/one/things/cascade/docs/examples/1-4-knowledge-management/design.md +609 -0
  125. package/one/things/cascade/docs/examples/1-4-knowledge-management/tests.md +195 -0
  126. package/one/things/cascade/docs/examples/1-4-knowledge-management.md +577 -0
  127. package/one/things/cascade/docs/examples/1-5-quality-loops/design.md +797 -0
  128. package/one/things/cascade/docs/examples/1-5-quality-loops/tests.md +212 -0
  129. package/one/things/cascade/docs/examples/1-5-quality-loops.md +641 -0
  130. package/one/things/cascade/docs/examples/1-6-numbering-structure/design.md +610 -0
  131. package/one/things/cascade/docs/examples/1-6-numbering-structure/tests.md +213 -0
  132. package/one/things/cascade/docs/examples/1-6-numbering-structure.md +575 -0
  133. package/one/things/cascade/docs/examples/readme.md +222 -0
  134. package/one/things/cascade/docs/getting-started.md +515 -0
  135. package/one/things/cascade/docs/workflow.md +1372 -0
  136. package/one/things/cascade/readme.md +336 -0
  137. package/one/things/cascade/templates/feature-template.md +267 -0
  138. package/one/things/claude/agents/advocacy-activation-manager.md +685 -0
  139. package/one/things/claude/agents/advocacy-campaign-designer.md +663 -0
  140. package/one/things/claude/agents/analyst.md +483 -0
  141. package/one/things/claude/agents/architect.md +480 -0
  142. package/one/things/claude/agents/brand-identity-specialist.md +513 -0
  143. package/one/things/claude/agents/bstp-token-strategist.md +667 -0
  144. package/one/things/claude/agents/builder-repo.md +489 -0
  145. package/one/things/claude/agents/bullstamp-community-builder.md +574 -0
  146. package/one/things/claude/agents/bullstamp-marketing-orchestrator.md +506 -0
  147. package/one/things/claude/agents/bulltilt-platform-growth.md +567 -0
  148. package/one/things/claude/agents/company-bullstamp-character.md +587 -0
  149. package/one/things/claude/agents/company-bullstamp-community.md +292 -0
  150. package/one/things/claude/agents/company-bullstamp-marketing.md +292 -0
  151. package/one/things/claude/agents/company-bullstamp-token.md +292 -0
  152. package/one/things/claude/agents/company-bulltilt-growth.md +292 -0
  153. package/one/things/claude/agents/content-bibliography-formatter.md +381 -0
  154. package/one/things/claude/agents/content-calendar-planner.md +448 -0
  155. package/one/things/claude/agents/content-chapter-formatter.md +488 -0
  156. package/one/things/claude/agents/content-formatter.md +546 -0
  157. package/one/things/claude/agents/content-hook-specialist.md +462 -0
  158. package/one/things/claude/agents/content-image-formatter.md +535 -0
  159. package/one/things/claude/agents/content-introduction-formatter.md +485 -0
  160. package/one/things/claude/agents/content-multiplication-engine.md +556 -0
  161. package/one/things/claude/agents/content-playbook-writer.md +448 -0
  162. package/one/things/claude/agents/content-team-manager.md +622 -0
  163. package/one/things/claude/agents/content-toc-formatter.md +522 -0
  164. package/one/things/claude/agents/convex-backend-specialist.md +2561 -0
  165. package/one/things/claude/agents/core-manager.md +582 -0
  166. package/one/things/claude/agents/core-master.md +403 -0
  167. package/one/things/claude/agents/cross-functional-manager.md +471 -0
  168. package/one/things/claude/agents/crypto-airdrop-strategist.md +602 -0
  169. package/one/things/claude/agents/crypto-analytics-educator.md +553 -0
  170. package/one/things/claude/agents/crypto-architecture-specialist.md +466 -0
  171. package/one/things/claude/agents/crypto-community-analyst.md +298 -0
  172. package/one/things/claude/agents/crypto-community-psychologist.md +509 -0
  173. package/one/things/claude/agents/crypto-dex-optimization-expert.md +538 -0
  174. package/one/things/claude/agents/crypto-dex-optimizer.md +292 -0
  175. package/one/things/claude/agents/crypto-diamond-formation-specialist.md +513 -0
  176. package/one/things/claude/agents/crypto-diamond-hands.md +292 -0
  177. package/one/things/claude/agents/crypto-ecosystem-expansion-manager.md +554 -0
  178. package/one/things/claude/agents/crypto-engagement-specialist.md +540 -0
  179. package/one/things/claude/agents/crypto-market-researcher.md +292 -0
  180. package/one/things/claude/agents/crypto-marketing-orchestrator.md +523 -0
  181. package/one/things/claude/agents/crypto-network-effect-amplifier.md +569 -0
  182. package/one/things/claude/agents/crypto-optimization-analyst.md +554 -0
  183. package/one/things/claude/agents/crypto-strategic-synthesizer.md +517 -0
  184. package/one/things/claude/agents/crypto-team-manager.md +387 -0
  185. package/one/things/claude/agents/crypto-token-analyst.md +278 -0
  186. package/one/things/claude/agents/crypto-viral-content-creator.md +546 -0
  187. package/one/things/claude/agents/crypto-wallet-identification-expert.md +517 -0
  188. package/one/things/claude/agents/crypto-wallet-identifier.md +292 -0
  189. package/one/things/claude/agents/customer-journey-designer.md +481 -0
  190. package/one/things/claude/agents/customer-success-manager.md +581 -0
  191. package/one/things/claude/agents/dev.md +413 -0
  192. package/one/things/claude/agents/documenter.md +546 -0
  193. package/one/things/claude/agents/elevate-marketing-orchestrator.md +410 -0
  194. package/one/things/claude/agents/engagement-specialist.md +509 -0
  195. package/one/things/claude/agents/engineering-architect.md +387 -0
  196. package/one/things/claude/agents/engineering-business-analyst.md +537 -0
  197. package/one/things/claude/agents/engineering-developer.md +387 -0
  198. package/one/things/claude/agents/engineering-director.md +282 -0
  199. package/one/things/claude/agents/engineering-ingestor.md +649 -0
  200. package/one/things/claude/agents/engineering-product-manager.md +537 -0
  201. package/one/things/claude/agents/engineering-product-owner.md +537 -0
  202. package/one/things/claude/agents/engineering-project-coordinator.md +537 -0
  203. package/one/things/claude/agents/engineering-quality-assurance.md +393 -0
  204. package/one/things/claude/agents/engineering-team-manager.md +512 -0
  205. package/one/things/claude/agents/engineering-user-experience.md +387 -0
  206. package/one/things/claude/agents/framework-elevate-manager.md +294 -0
  207. package/one/things/claude/agents/improver.md +763 -0
  208. package/one/things/claude/agents/intelligence-team-manager.md +385 -0
  209. package/one/things/claude/agents/lead-capture-expert.md +466 -0
  210. package/one/things/claude/agents/lead-magnet-creator.md +453 -0
  211. package/one/things/claude/agents/market-research-analyst.md +412 -0
  212. package/one/things/claude/agents/marketing-brand-identity.md +314 -0
  213. package/one/things/claude/agents/marketing-content-hooks.md +450 -0
  214. package/one/things/claude/agents/marketing-content-multiplier.md +326 -0
  215. package/one/things/claude/agents/marketing-content-poster.md +361 -0
  216. package/one/things/claude/agents/marketing-customer-journey.md +326 -0
  217. package/one/things/claude/agents/marketing-director.md +397 -0
  218. package/one/things/claude/agents/marketing-engagement.md +326 -0
  219. package/one/things/claude/agents/marketing-lead-capture.md +326 -0
  220. package/one/things/claude/agents/marketing-lead-magnet.md +326 -0
  221. package/one/things/claude/agents/marketing-network-effects.md +326 -0
  222. package/one/things/claude/agents/marketing-nurture-campaigns.md +326 -0
  223. package/one/things/claude/agents/marketing-share-optimizer.md +326 -0
  224. package/one/things/claude/agents/marketing-team-manager.md +446 -0
  225. package/one/things/claude/agents/marketing-viral-growth.md +201 -0
  226. package/one/things/claude/agents/mission-commander.md +373 -0
  227. package/one/things/claude/agents/network-effect-analyst.md +587 -0
  228. package/one/things/claude/agents/nextjs-15-specialist.md +1547 -0
  229. package/one/things/claude/agents/npx.md +890 -0
  230. package/one/things/claude/agents/nurture-campaign-manager.md +531 -0
  231. package/one/things/claude/agents/one-master.md +355 -0
  232. package/one/things/claude/agents/one-orchestrator.md +315 -0
  233. package/one/things/claude/agents/one.md +601 -0
  234. package/one/things/claude/agents/playbook-generator.md +503 -0
  235. package/one/things/claude/agents/pm.md +326 -0
  236. package/one/things/claude/agents/po.md +345 -0
  237. package/one/things/claude/agents/qa.md +336 -0
  238. package/one/things/claude/agents/research-foundation-analyst.md +307 -0
  239. package/one/things/claude/agents/research-intelligence-gatherer.md +408 -0
  240. package/one/things/claude/agents/research-market-analyst.md +307 -0
  241. package/one/things/claude/agents/research-team-manager.md +482 -0
  242. package/one/things/claude/agents/sales-environment-optimizer.md +494 -0
  243. package/one/things/claude/agents/sales-team-manager.md +400 -0
  244. package/one/things/claude/agents/sales-upsell-strategist.md +307 -0
  245. package/one/things/claude/agents/service-advocacy-campaigns.md +307 -0
  246. package/one/things/claude/agents/service-advocacy-manager.md +307 -0
  247. package/one/things/claude/agents/service-success-manager.md +307 -0
  248. package/one/things/claude/agents/service-team-manager.md +400 -0
  249. package/one/things/claude/agents/shadcn-ui-design-system-specialist.md +2302 -0
  250. package/one/things/claude/agents/share-optimization-specialist.md +551 -0
  251. package/one/things/claude/agents/sm.md +327 -0
  252. package/one/things/claude/agents/story-teller.md +473 -0
  253. package/one/things/claude/agents/task-master.md +596 -0
  254. package/one/things/claude/agents/tauri-cross-platform-specialist.md +1827 -0
  255. package/one/things/claude/agents/tester.md +556 -0
  256. package/one/things/claude/agents/the-bull-character-manager.md +580 -0
  257. package/one/things/claude/agents/tools-playbook-generator.md +489 -0
  258. package/one/things/claude/agents/turbo-repo-builder.md +316 -0
  259. package/one/things/claude/agents/upsell-strategist.md +480 -0
  260. package/one/things/claude/agents/ux-expert.md +335 -0
  261. package/one/things/claude/agents/viral-growth-orchestrator.md +497 -0
  262. package/one/things/claude/claude-code-hooks-development.json +21 -0
  263. package/one/things/claude/claude-code-hooks-production.json +21 -0
  264. package/one/things/claude/claude-code-hooks.json +25 -0
  265. package/one/things/claude/commands/agent.md +104 -0
  266. package/one/things/claude/commands/cascade-status.md +128 -0
  267. package/one/things/claude/commands/ingest.md +290 -0
  268. package/one/things/claude/commands/ingestor.md +136 -0
  269. package/one/things/claude/commands/mission.md +83 -0
  270. package/one/things/claude/commands/npx.md +133 -0
  271. package/one/things/claude/commands/one.md +440 -0
  272. package/one/things/claude/commands/quality-check.md +204 -0
  273. package/one/things/claude/commands/smart-route.md +220 -0
  274. package/one/things/claude/commands/start.md +121 -0
  275. package/one/things/claude/commands/story.md +83 -0
  276. package/one/things/claude/commands/task.md +173 -0
  277. package/one/things/claude/hook-bypass.json +32 -0
  278. package/one/things/claude/hooks/agent-hook-config.json +427 -0
  279. package/one/things/claude/hooks/agent-hook-manager.js +525 -0
  280. package/one/things/claude/hooks/agent-load-balancer.js +271 -0
  281. package/one/things/claude/hooks/agent-request-interceptor.js +70 -0
  282. package/one/things/claude/hooks/build-hook.sh +156 -0
  283. package/one/things/claude/hooks/cascade-feedback.js +297 -0
  284. package/one/things/claude/hooks/cascade-integration-hooks.js +648 -0
  285. package/one/things/claude/hooks/cleanup-hook.sh +201 -0
  286. package/one/things/claude/hooks/continuous-improvement-monitor.js +510 -0
  287. package/one/things/claude/hooks/file-organization-engine.js +427 -0
  288. package/one/things/claude/hooks/file-organization-hook.sh +80 -0
  289. package/one/things/claude/hooks/file-organization-monitor.js +269 -0
  290. package/one/things/claude/hooks/format-hook.sh +43 -0
  291. package/one/things/claude/hooks/hook-bypass.sh +293 -0
  292. package/one/things/claude/hooks/hook-config-manager.js +202 -0
  293. package/one/things/claude/hooks/hook-debouncer.sh +62 -0
  294. package/one/things/claude/hooks/hook-logger.sh +89 -0
  295. package/one/things/claude/hooks/hook-orchestrator.js +662 -0
  296. package/one/things/claude/hooks/hook-performance-report.js +120 -0
  297. package/one/things/claude/hooks/lint-hook.sh +140 -0
  298. package/one/things/claude/hooks/mcp-cascade-integration.js +816 -0
  299. package/one/things/claude/hooks/memory-optimizer.js +510 -0
  300. package/one/things/claude/hooks/notification-hook.sh +204 -0
  301. package/one/things/claude/hooks/ontology-compliance.js +394 -0
  302. package/one/things/claude/hooks/ontology-hook-manager.js +316 -0
  303. package/one/things/claude/hooks/ontology-validation-engine.js +317 -0
  304. package/one/things/claude/hooks/ontology-validation-hook.sh +86 -0
  305. package/one/things/claude/hooks/performance-metrics.json +25 -0
  306. package/one/things/claude/hooks/performance-monitoring-hook.js +422 -0
  307. package/one/things/claude/hooks/quality-scoring-engine.js +834 -0
  308. package/one/things/claude/hooks/security-hook.sh +256 -0
  309. package/one/things/claude/hooks/simple-load-balancer.js +238 -0
  310. package/one/things/claude/hooks/startup-optimizer.js +625 -0
  311. package/one/things/claude/hooks/story-scoring-system.js +445 -0
  312. package/one/things/claude/hooks/story-validation-engine.js +473 -0
  313. package/one/things/claude/hooks/story-validation-hook-enhanced.sh +210 -0
  314. package/one/things/claude/hooks/story-validation-hook.sh +145 -0
  315. package/one/things/claude/hooks/structure-synchronizer.js +194 -0
  316. package/one/things/claude/hooks/sub-agent-output-validator.js +647 -0
  317. package/one/things/claude/hooks/sub-agent-validation-hook.js +343 -0
  318. package/one/things/claude/hooks/test-hook.sh +145 -0
  319. package/one/things/claude/hooks/test-story-validation.sh +170 -0
  320. package/one/things/claude/hooks/trinity-validation-system.js +392 -0
  321. package/one/things/claude/settings-local.json +86 -0
  322. package/one/things/cli-code.md +652 -0
  323. package/one/things/cli-compiler-code.md +652 -0
  324. package/one/things/cli.md +1045 -0
  325. package/one/things/components/card-shadcn.md +929 -0
  326. package/one/things/components/card.md +1050 -0
  327. package/one/things/components.md +1669 -0
  328. package/one/things/componets.md +4 -0
  329. package/one/things/copilotkit.md +1559 -0
  330. package/one/things/creator-diagram.md +166 -0
  331. package/one/things/examples/children/lemonade-stand.md +366 -0
  332. package/one/things/examples/enterprise/crm-saas.md +1429 -0
  333. package/one/things/features/1-1-agent-prompts/design.md +470 -0
  334. package/one/things/features/1-1-agent-prompts/tests.md +264 -0
  335. package/one/things/features/1-1-agent-prompts.md +486 -0
  336. package/one/things/features/1-2-yaml-orchestrator/design.md +497 -0
  337. package/one/things/features/1-2-yaml-orchestrator/tests.md +227 -0
  338. package/one/things/features/1-2-yaml-orchestrator.md +516 -0
  339. package/one/things/features/1-3-event-coordination/design.md +544 -0
  340. package/one/things/features/1-3-event-coordination/tests.md +223 -0
  341. package/one/things/features/1-3-event-coordination.md +508 -0
  342. package/one/things/features/1-4-knowledge-management/design.md +609 -0
  343. package/one/things/features/1-4-knowledge-management/tests.md +195 -0
  344. package/one/things/features/1-4-knowledge-management.md +577 -0
  345. package/one/things/features/1-5-quality-loops/design.md +797 -0
  346. package/one/things/features/1-5-quality-loops/tests.md +212 -0
  347. package/one/things/features/1-5-quality-loops.md +641 -0
  348. package/one/things/features/1-6-numbering-structure/design.md +610 -0
  349. package/one/things/features/1-6-numbering-structure/tests.md +213 -0
  350. package/one/things/features/1-6-numbering-structure.md +575 -0
  351. package/one/things/features/2-cli.md +1235 -0
  352. package/one/things/features/use-one-backend.md +1180 -0
  353. package/one/things/ideas/1-create-workflow.md +189 -0
  354. package/one/things/plans/1-create-workflow-status.md +555 -0
  355. package/one/things/plans/1-create-workflow.md +713 -0
  356. package/one/things/plans/app.md +761 -0
  357. package/one/things/plans/better-auth-any-backend-revised.md +1065 -0
  358. package/one/things/plans/better-auth-any-backend.md +1852 -0
  359. package/one/things/plans/better-auth-available-features.md +235 -0
  360. package/one/things/plans/big-plan.md +38 -0
  361. package/one/things/plans/convex-better-auth.md +1109 -0
  362. package/one/things/plans/convex-on-off.md +389 -0
  363. package/one/things/plans/desktop.md +1121 -0
  364. package/one/things/plans/effect-components.md +1669 -0
  365. package/one/things/plans/effect.md +973 -0
  366. package/one/things/plans/email.md +953 -0
  367. package/one/things/plans/enhance-auth.md +1669 -0
  368. package/one/things/plans/install-components.md +198 -0
  369. package/one/things/plans/landing.md +728 -0
  370. package/one/things/plans/layout.md +205 -0
  371. package/one/things/plans/mail-backend.md +1308 -0
  372. package/one/things/plans/mail.md +2624 -0
  373. package/one/things/plans/next-features.md +83 -0
  374. package/one/things/plans/one.md +658 -0
  375. package/one/things/plans/ontology-6-dimensions.md +2216 -0
  376. package/one/things/plans/ontology-driven-strategy.md +866 -0
  377. package/one/things/plans/ontology-ui-approach.md +357 -0
  378. package/one/things/plans/open-agent.md +785 -0
  379. package/one/things/plans/performace.md +90 -0
  380. package/one/things/plans/releases.md +809 -0
  381. package/one/things/plans/repos.md +76 -0
  382. package/one/things/plans/separate-copy-2.md +1293 -0
  383. package/one/things/plans/separate-copy-3.md +2458 -0
  384. package/one/things/plans/separate-copy.md +1293 -0
  385. package/one/things/plans/separate.md +1983 -0
  386. package/one/things/plans/shadcn-integration-summary.md +450 -0
  387. package/one/things/plans/sidebar.md +172 -0
  388. package/one/things/plans/small-fixes.md +5 -0
  389. package/one/things/plans/test-backend-connection.md +476 -0
  390. package/one/things/plans/workflow-files.md +1196 -0
  391. package/one/things/plans/workflow.md +1372 -0
  392. package/one/things/products/cascade-landing-page.md +737 -0
  393. package/one/things/products/cascade.md +1518 -0
  394. package/one/things/products/context-engineering.md +1427 -0
  395. package/one/things/products/onthology.md +0 -0
  396. package/one/things/products/ontology-ui-shadcn.md +1280 -0
  397. package/one/things/products/ontology-ui.md +1387 -0
  398. package/one/things/products/ontology.md +717 -0
  399. package/one/things/products/sdk.md +557 -0
  400. package/one/things/promptkit.md +903 -0
  401. package/one/things/service-providers-new.md +982 -0
  402. package/one/things/service-providers.md +1092 -0
  403. package/one/things/things.md +349 -0
  404. package/one/things/todo.md +1248 -0
  405. package/package.json +5 -2
@@ -0,0 +1,2471 @@
1
+ # ONE Platform - File System Map
2
+
3
+ **Version:** 1.0.0
4
+ **Last Updated:** 2025-01-15
5
+ **Purpose:** Exact location for every file type - AI agents use this to know where to place generated code
6
+
7
+ ---
8
+
9
+ ## How AI Agents Use This Map
10
+
11
+ **Before creating ANY file:**
12
+ 1. Find the file type in this map
13
+ 2. Use the exact path shown
14
+ 3. Follow naming conventions precisely
15
+ 4. Update this map if creating new directories
16
+
17
+ **Never:**
18
+ - Create files in random locations
19
+ - Invent new directory structures
20
+ - Use different naming conventions
21
+ - Skip updating this map
22
+
23
+ ---
24
+
25
+ ## Complete Directory Tree
26
+
27
+ ```
28
+ one/
29
+ │
30
+ ├── .ai/ # AI AGENT CONTEXT (never commit secrets)
31
+ │ ├── agents/ # Agent specifications
32
+ │ │ ├── frontend-agent.md # Astro/React specialist
33
+ │ │ ├── backend-agent.md # Convex/Effect.ts specialist
34
+ │ │ ├── auth-agent.md # Auth specialist
35
+ │ │ ├── blockchain-agent.md # Web3 specialist
36
+ │ │ ├── ai-ml-agent.md # AI/ML specialist
37
+ │ │ └── ingestor-agent.md # Migration specialist
38
+ │ │
39
+ │ ├── context/ # System context
40
+ │ │ ├── ontology.md # ✅ CREATED - 6-dimension data model
41
+ │ │ ├── architecture.md # ✅ CREATED - System design + FP
42
+ │ │ ├── patterns.md # ✅ CREATED - Code patterns
43
+ │ │ ├── file-map.md # ✅ THIS FILE
44
+ │ │ └── dependencies.md # Package versions & APIs
45
+ │ │
46
+ │ ├── specs/ # Feature specifications
47
+ │ │ ├── auth-flow.md # Authentication system
48
+ │ │ ├── ai-clone-creation.md # AI clone pipeline
49
+ │ │ ├── token-economics.md # Token system
50
+ │ │ ├── elevate-journey.md # ELEVATE workflow
51
+ │ │ ├── content-generation.md # Content automation
52
+ │ │ ├── viral-loops.md # Growth mechanisms
53
+ │ │ ├── course-builder.md # AI course generation
54
+ │ │ └── analytics-dashboard.md # Analytics & insights
55
+ │ │
56
+ │ ├── prompts/ # Reusable prompts
57
+ │ │ ├── new-feature.md # Feature creation template
58
+ │ │ ├── fix-bug.md # Bug fixing workflow
59
+ │ │ ├── refactor.md # Refactoring guide
60
+ │ │ ├── test-generation.md # Test creation
61
+ │ │ └── documentation.md # Doc generation
62
+ │ │
63
+ │ └── rules.md # ✅ CREATED - Golden rules
64
+ │
65
+ ├── docs/ # HUMAN DOCUMENTATION
66
+ │ │
67
+ │ ├── # CORE DOCUMENTATION
68
+ │ ├── Strategy.md # ✅ Platform vision & business strategy
69
+ │ ├── Ontology.md # ✅ 6-dimension data model (25 connections, 35 events)
70
+ │ ├── Architecture.md # ✅ Technical architecture & FP patterns
71
+ │ ├── Rules.md # ✅ Golden rules for development
72
+ │ ├── Patterns.md # ✅ Code patterns & best practices
73
+ │ ├── Files.md # ✅ THIS FILE - File system map
74
+ │ ├── Workflow.md # ✅ Ontology-driven development flow
75
+ │ ├── Documentation-Map.md # ✅ Visual map of how all docs work together
76
+ │ │
77
+ │ ├── # DSL DOCUMENTATION
78
+ │ ├── DSL.md # ✅ DSL overview & introduction
79
+ │ ├── ONE DSL.md # ✅ Technical DSL (JSON-like, 25+35 types)
80
+ │ ├── ONE DSL English.md # ✅ Plain English DSL (compiles to Technical)
81
+ │ │
82
+ │ ├── # PROTOCOL DOCUMENTATION
83
+ │ ├── README-Protocols.md # ✅ Protocol overview
84
+ │ ├── A2A.md # ✅ Agent-to-Agent protocol
85
+ │ ├── ACP.md # ✅ Agentic Commerce Protocol
86
+ │ ├── AP2.md # ✅ Agent Payments Protocol (mandates)
87
+ │ ├── ACPayments.md # ✅ Agentic Commerce Payments
88
+ │ ├── X402.md # ✅ HTTP Micropayments (402 status)
89
+ │ ├── AGUI.md # ✅ Generative UI (CopilotKit)
90
+ │ │
91
+ │ ├── # INTEGRATION DOCUMENTATION
92
+ │ ├── ElizaOS.md # ✅ ElizaOS integration (external AI agents)
93
+ │ ├── CopilotKit.md # ✅ CopilotKit/AG-UI integration (generative UI)
94
+ │ ├── PromptKit.md # ✅ PromptKit integration (AI UI components)
95
+ │ ├── MCP.md # ✅ Model Context Protocol
96
+ │ ├── N8N.md # ✅ n8n workflow automation
97
+ │ ├── Agent-Communications.md # ✅ Agent communication patterns
98
+ │ │
99
+ │ ├── # IMPLEMENTATION GUIDES
100
+ │ ├── Implementation.md # ✅ Implementation patterns
101
+ │ ├── Implementation Examples.md # ✅ Code examples
102
+ │ ├── Specifications.md # ✅ Technical specifications
103
+ │ ├── Components.md # ✅ Convex components + Effect.ts integration
104
+ │ ├── Schema.md # ✅ Database schema details
105
+ │ │
106
+ │ ├── # SERVICE LAYER DOCUMENTATION
107
+ │ ├── Service Layer.md # ✅ Effect.ts service layer architecture
108
+ │ ├── Service Providers.md # ✅ External service providers (OpenAI, ElevenLabs, Stripe, Blockchain)
109
+ │ ├── Service Providers - New.md # ✅ New providers (D-ID, HeyGen, Uniswap, Alchemy, Twilio, AWS, Cloudflare Stream)
110
+ │ │
111
+ │ ├── # WORKFLOW & TOOLS
112
+ │ ├── Workflow Examples.md # ✅ Development workflow examples
113
+ │ ├── CLI.md # ✅ CLI tool documentation
114
+ │ ├── CLI Code.md # ✅ CLI implementation
115
+ │ ├── CLI Compiler Code.md # ✅ CLI compiler implementation
116
+ │ ├── Agent Ingestor.md # ✅ Migration agent documentation
117
+ │ │
118
+ │ ├── # DIAGRAMS & VISUALS
119
+ │ ├── Architecture Diagram.md # ✅ Architecture visualizations
120
+ │ ├── Creator Diagram.md # ✅ Creator flow diagrams
121
+ │ │
122
+ │ ├── # API DOCUMENTATION
123
+ │ ├── API.md # ✅ API reference
124
+ │ ├── API-docs.md # ✅ Detailed API documentation
125
+ │ │
126
+ │ └── # MIGRATION & UPDATES
127
+ │ ├── OntologyUpdates.md # ✅ Ontology evolution log
128
+ │ └── Effects Provider.md # ✅ Effect.ts provider patterns (deprecated - see Service Layer.md)
129
+ │
130
+ ├── src/ # FRONTEND SOURCE
131
+ │ │
132
+ │ ├── components/ # React components
133
+ │ │ │
134
+ │ │ ├── ui/ # shadcn/ui primitives (50+)
135
+ │ │ │ ├── button.tsx # Button component
136
+ │ │ │ ├── card.tsx # Card component
137
+ │ │ │ ├── dialog.tsx # Dialog/modal
138
+ │ │ │ ├── input.tsx # Input field
139
+ │ │ │ ├── label.tsx # Label
140
+ │ │ │ ├── select.tsx # Select dropdown
141
+ │ │ │ ├── checkbox.tsx # Checkbox
142
+ │ │ │ ├── radio-group.tsx # Radio buttons
143
+ │ │ │ ├── switch.tsx # Toggle switch
144
+ │ │ │ ├── slider.tsx # Slider
145
+ │ │ │ ├── progress.tsx # Progress bar
146
+ │ │ │ ├── alert.tsx # Alert messages
147
+ │ │ │ ├── badge.tsx # Badge/tag
148
+ │ │ │ ├── avatar.tsx # Avatar image
149
+ │ │ │ ├── skeleton.tsx # Loading skeleton
150
+ │ │ │ ├── toast.tsx # Toast notifications
151
+ │ │ │ ├── tooltip.tsx # Tooltips
152
+ │ │ │ ├── popover.tsx # Popover
153
+ │ │ │ ├── dropdown-menu.tsx # Dropdown menu
154
+ │ │ │ ├── context-menu.tsx # Context menu
155
+ │ │ │ ├── menubar.tsx # Menu bar
156
+ │ │ │ ├── navigation-menu.tsx # Navigation
157
+ │ │ │ ├── breadcrumb.tsx # Breadcrumbs
158
+ │ │ │ ├── tabs.tsx # Tab panels
159
+ │ │ │ ├── accordion.tsx # Accordion
160
+ │ │ │ ├── collapsible.tsx # Collapsible
161
+ │ │ │ ├── sheet.tsx # Side sheet
162
+ │ │ │ ├── drawer.tsx # Drawer
163
+ │ │ │ ├── hover-card.tsx # Hover card
164
+ │ │ │ ├── table.tsx # Data table
165
+ │ │ │ ├── calendar.tsx # Date picker
166
+ │ │ │ ├── command.tsx # Command palette
167
+ │ │ │ ├── separator.tsx # Separator line
168
+ │ │ │ ├── scroll-area.tsx # Scroll container
169
+ │ │ │ ├── textarea.tsx # Text area
170
+ │ │ │ ├── form.tsx # Form wrapper
171
+ │ │ │ └── [more shadcn components] # 50+ total
172
+ │ │ │
173
+ │ │ ├── prompt-kit/ # 🤖 PROMPT KIT AI COMPONENTS
174
+ │ │ │ ├── # Chat Components
175
+ │ │ │ ├── message.tsx # AI message component
176
+ │ │ │ ├── prompt-input.tsx # Auto-resize AI input
177
+ │ │ │ ├── chat-container.tsx # Auto-scroll chat
178
+ │ │ │ ├── response-stream.tsx # Streaming responses
179
+ │ │ │ │
180
+ │ │ │ ├── # Agent Components
181
+ │ │ │ ├── reasoning.tsx # Show agent thinking
182
+ │ │ │ ├── tool.tsx # Display function calls
183
+ │ │ │ ├── agent-card.tsx # Agent info card
184
+ │ │ │ │
185
+ │ │ │ ├── # Generative UI Components (CopilotKit-inspired)
186
+ │ │ │ ├── generative-ui-renderer.tsx # Render agent UI messages
187
+ │ │ │ ├── dynamic-chart.tsx # Agent-generated charts
188
+ │ │ │ ├── dynamic-table.tsx # Agent-generated tables
189
+ │ │ │ ├── dynamic-form.tsx # Agent-generated forms
190
+ │ │ │ ├── dynamic-card.tsx # Agent-generated cards
191
+ │ │ │ │
192
+ │ │ │ ├── # Context Components
193
+ │ │ │ ├── context-provider.tsx # AG-UI context sharing
194
+ │ │ │ ├── context-viewer.tsx # View shared context
195
+ │ │ │ │
196
+ │ │ │ └── # Action Components
197
+ │ │ │ ├── action-trigger.tsx # Human-in-the-loop actions
198
+ │ │ │ ├── action-approval.tsx # Approve agent actions
199
+ │ │ │ └── multi-agent-panel.tsx # Multi-agent coordination
200
+ │ │ │
201
+ │ │ └── features/ # Feature-specific components
202
+ │ │ │
203
+ │ │ ├── auth/ # 🔐 AUTHENTICATION
204
+ │ │ │ ├── SignInForm.tsx # Sign in form
205
+ │ │ │ ├── SignUpForm.tsx # Sign up form
206
+ │ │ │ ├── PasswordReset.tsx # Password reset
207
+ │ │ │ ├── EmailVerification.tsx # Email verify
208
+ │ │ │ ├── MagicLinkForm.tsx # Magic link auth
209
+ │ │ │ ├── TwoFactorSetup.tsx # 2FA setup
210
+ │ │ │ ├── TwoFactorVerify.tsx # 2FA verify
211
+ │ │ │ ├── OAuthButtons.tsx # OAuth buttons (GitHub, Google)
212
+ │ │ │ ├── SessionManager.tsx # Session display
213
+ │ │ │ └── AuthGuard.tsx # Auth wrapper
214
+ │ │ │
215
+ │ │ ├── creators/ # 👤 CREATOR FEATURES
216
+ │ │ │ ├── CreatorOnboarding.tsx # Multi-step onboarding
217
+ │ │ │ ├── CreatorProfile.tsx # Public profile display
218
+ │ │ │ ├── CreatorDashboard.tsx # Main dashboard
219
+ │ │ │ ├── CreatorWebsite.tsx # Auto-generated website
220
+ │ │ │ ├── ContentUploader.tsx # Upload videos/content
221
+ │ │ │ ├── SocialConnector.tsx # Connect social accounts
222
+ │ │ │ ├── AICloneStatus.tsx # Clone training status
223
+ │ │ │ ├── RevenueChart.tsx # Revenue analytics
224
+ │ │ │ ├── AudienceInsights.tsx # Audience analytics
225
+ │ │ │ ├── SettingsForm.tsx # Settings
226
+ │ │ │ └── BrandCustomizer.tsx # Brand colors/theme
227
+ │ │ │
228
+ │ │ ├── ai-clone/ # 🤖 AI CLONE FEATURES (Feature #1)
229
+ │ │ │ ├── # Clone Creation
230
+ │ │ │ ├── CloneWizard.tsx # Multi-step clone creation
231
+ │ │ │ ├── VideoUploader.tsx # Upload training videos (3+ required)
232
+ │ │ │ ├── VoiceCloner.tsx # Voice cloning interface
233
+ │ │ │ ├── AppearanceCloner.tsx # Appearance cloning UI
234
+ │ │ │ ├── PersonalityBuilder.tsx # Build personality from content
235
+ │ │ │ ├── TrainingProgress.tsx # Training status & progress
236
+ │ │ │ ├── KnowledgeBaseManager.tsx # Manage RAG knowledge
237
+ │ │ │ │
238
+ │ │ │ ├── # Clone Interaction
239
+ │ │ │ ├── CloneChat.tsx # Chat with AI clone
240
+ │ │ │ ├── CloneChatMessage.tsx # Chat message component
241
+ │ │ │ ├── CloneVoiceChat.tsx # Voice chat interface (future)
242
+ │ │ │ ├── CloneVideoCall.tsx # Video call with clone (future)
243
+ │ │ │ ├── VoicePlayer.tsx # Voice playback
244
+ │ │ │ ├── CloneEmbed.tsx # Embeddable clone widget
245
+ │ │ │ │
246
+ │ │ │ ├── # Clone Management
247
+ │ │ │ ├── CloneEditor.tsx # Edit clone settings
248
+ │ │ │ ├── PersonalityEditor.tsx # Edit personality traits
249
+ │ │ │ ├── ResponseEditor.tsx # Edit common responses
250
+ │ │ │ ├── CloneAnalytics.tsx # Clone usage analytics
251
+ │ │ │ └── CloneSettings.tsx # Clone configuration
252
+ │ │ │
253
+ │ │ ├── tokens/ # 💰 TOKEN ECONOMY (Feature #8)
254
+ │ │ │ ├── # Token Purchase
255
+ │ │ │ ├── TokenPurchase.tsx # Buy tokens UI
256
+ │ │ │ ├── TokenCheckout.tsx # Checkout flow
257
+ │ │ │ ├── PaymentMethods.tsx # Payment options (Stripe, crypto)
258
+ │ │ │ ├── PurchaseConfirm.tsx # Confirm purchase
259
+ │ │ │ │
260
+ │ │ │ ├── # Token Display
261
+ │ │ │ ├── TokenBalance.tsx # Balance display
262
+ │ │ │ ├── TokenChart.tsx # Price chart
263
+ │ │ │ ├── TokenStats.tsx # Token statistics
264
+ │ │ │ ├── TokenHolders.tsx # Holder leaderboard
265
+ │ │ │ ├── TransactionHistory.tsx # TX history
266
+ │ │ │ │
267
+ │ │ │ ├── # Token Staking
268
+ │ │ │ ├── StakingInterface.tsx # Stake tokens UI
269
+ │ │ │ ├── StakingRewards.tsx # Rewards display
270
+ │ │ │ ├── UnstakeModal.tsx # Unstake flow
271
+ │ │ │ │
272
+ │ │ │ ├── # Token Economics
273
+ │ │ │ ├── TokenLaunchWizard.tsx # Launch creator token
274
+ │ │ │ ├── TokenomicsConfig.tsx # Configure economics
275
+ │ │ │ ├── BurnMechanism.tsx # Burn display/trigger
276
+ │ │ │ ├── RewardCalculator.tsx # Reward estimation
277
+ │ │ │ └── TokenGovernance.tsx # Governance voting
278
+ │ │ │
279
+ │ │ ├── courses/ # 📚 AI-POWERED LMS (Feature #5)
280
+ │ │ │ ├── # Course Creation
281
+ │ │ │ ├── CourseWizard.tsx # AI-assisted course builder
282
+ │ │ │ ├── CourseOutlineGen.tsx # AI outline generation
283
+ │ │ │ ├── LessonBuilder.tsx # Build single lesson
284
+ │ │ │ ├── QuizBuilder.tsx # Build quizzes
285
+ │ │ │ ├── AssignmentBuilder.tsx # Build assignments
286
+ │ │ │ ├── CertificateDesigner.tsx # Design certificates
287
+ │ │ │ │
288
+ │ │ │ ├── # Course Display
289
+ │ │ │ ├── CourseCatalog.tsx # Browse courses
290
+ │ │ │ ├── CourseCard.tsx # Course card
291
+ │ │ │ ├── CourseDetail.tsx # Course details
292
+ │ │ │ ├── EnrollmentButton.tsx # Enroll with tokens
293
+ │ │ │ │
294
+ │ │ │ ├── # Learning Experience
295
+ │ │ │ ├── LessonPlayer.tsx # Watch/read lesson
296
+ │ │ │ ├── VideoPlayer.tsx # Video lessons
297
+ │ │ │ ├── InteractiveLecture.tsx # Interactive content
298
+ │ │ │ ├── QuizInterface.tsx # Take quiz
299
+ │ │ │ ├── AssignmentSubmit.tsx # Submit assignment
300
+ │ │ │ ├── AITutor.tsx # AI clone teaches
301
+ │ │ │ ├── ProgressTracker.tsx # Progress bar
302
+ │ │ │ ├── GamificationBadges.tsx # Achievements
303
+ │ │ │ ├── CertificateDisplay.tsx # Earned certificate
304
+ │ │ │ └── NextLessonSuggest.tsx # AI suggestions
305
+ │ │ │
306
+ │ │ ├── community/ # 💬 LIVING COMMUNITY (Feature #6)
307
+ │ │ │ ├── # Messaging
308
+ │ │ │ ├── MessageList.tsx # Message feed
309
+ │ │ │ ├── MessageComposer.tsx # Compose message
310
+ │ │ │ ├── MessageItem.tsx # Single message
311
+ │ │ │ ├── ThreadView.tsx # Message threads
312
+ │ │ │ ├── DirectMessages.tsx # DMs
313
+ │ │ │ ├── CloneResponses.tsx # AI clone replies
314
+ │ │ │ │
315
+ │ │ │ ├── # Members
316
+ │ │ │ ├── MemberList.tsx # All members
317
+ │ │ │ ├── MemberCard.tsx # Member card
318
+ │ │ │ ├── MemberProfile.tsx # Member profile
319
+ │ │ │ ├── FollowersList.tsx # Followers
320
+ │ │ │ ├── TopContributors.tsx # Leaderboard
321
+ │ │ │ │
322
+ │ │ │ ├── # Activity
323
+ │ │ │ ├── ActivityFeed.tsx # Real-time feed
324
+ │ │ │ ├── LiveEvents.tsx # Live events
325
+ │ │ │ ├── Polls.tsx # Community polls
326
+ │ │ │ ├── QandA.tsx # Q&A forum
327
+ │ │ │ ├── Announcements.tsx # Creator announcements
328
+ │ │ │ │
329
+ │ │ │ ├── # Moderation
330
+ │ │ │ ├── ModerationQueue.tsx # Moderation queue
331
+ │ │ │ ├── ReportContent.tsx # Report system
332
+ │ │ │ ├── BanUser.tsx # Ban/mute users
333
+ │ │ │ └── AIModeration.tsx # AI moderation
334
+ │ │ │
335
+ │ │ ├── elevate/ # 🚀 ELEVATE JOURNEY (9 Steps)
336
+ │ │ │ ├── JourneyMap.tsx # Full journey map
337
+ │ │ │ ├── StepCard.tsx # Single step card
338
+ │ │ │ ├── ProgressRing.tsx # Progress visualization
339
+ │ │ │ ├── AchievementBadge.tsx # Achievement badges
340
+ │ │ │ │
341
+ │ │ │ ├── # Step Components
342
+ │ │ │ ├── Step1Hook.tsx # Hook: Business analysis
343
+ │ │ │ ├── Step2Gift.tsx # Gift: Free insights
344
+ │ │ │ ├── Step3Identify.tsx # Identify: €100 payment
345
+ │ │ │ ├── Step4Engage.tsx # Engage: Workshop access
346
+ │ │ │ ├── Step5Ascend.tsx # Ascend: Advanced training
347
+ │ │ │ ├── Step6Deliver.tsx # Deliver: Implementation
348
+ │ │ │ ├── Step7Nurture.tsx # Nurture: Ongoing support
349
+ │ │ │ ├── Step8Refer.tsx # Refer: Referral program
350
+ │ │ │ ├── Step9Rebuild.tsx # Rebuild: Optimization
351
+ │ │ │ │
352
+ │ │ │ ├── PaymentGate.tsx # Payment checkpoint
353
+ │ │ │ ├── WaitingRoom.tsx # Timed waiting
354
+ │ │ │ └── CompletionCert.tsx # Journey completion
355
+ │ │ │
356
+ │ │ ├── content/ # 📝 CONTENT AUTOMATION (Feature #2)
357
+ │ │ │ ├── # Content Creation
358
+ │ │ │ ├── ContentWizard.tsx # AI content generation wizard
359
+ │ │ │ ├── ContentEditor.tsx # Edit content
360
+ │ │ │ ├── AIWriter.tsx # AI writing assistant
361
+ │ │ │ ├── ContentScheduler.tsx # Schedule posts
362
+ │ │ │ ├── CalendarView.tsx # Content calendar
363
+ │ │ │ │
364
+ │ │ │ ├── # Content Display
365
+ │ │ │ ├── ContentGrid.tsx # Content grid
366
+ │ │ │ ├── ContentCard.tsx # Content card
367
+ │ │ │ ├── ContentPreview.tsx # Preview
368
+ │ │ │ ├── ContentStats.tsx # Performance stats
369
+ │ │ │ │
370
+ │ │ │ ├── # Social Distribution
371
+ │ │ │ ├── SocialPublisher.tsx # Publish to all platforms
372
+ │ │ │ ├── PlatformSelector.tsx # Select platforms
373
+ │ │ │ ├── PostCustomizer.tsx # Customize per platform
374
+ │ │ │ ├── HashtagSuggest.tsx # AI hashtag suggestions
375
+ │ │ │ │
376
+ │ │ │ ├── # Content Templates
377
+ │ │ │ ├── TemplateLibrary.tsx # Content templates
378
+ │ │ │ ├── TemplateEditor.tsx # Edit templates
379
+ │ │ │ └── BrandGuidelines.tsx # Brand consistency
380
+ │ │ │
381
+ │ │ ├── ugc/ # 🎨 USER-GENERATED CONTENT (Feature #4)
382
+ │ │ │ ├── UGCCreator.tsx # Create UGC with AI
383
+ │ │ │ ├── UGCGallery.tsx # Browse UGC
384
+ │ │ │ ├── UGCCard.tsx # UGC display card
385
+ │ │ │ ├── ShareUGC.tsx # Share UGC (earn tokens)
386
+ │ │ │ ├── UGCRewards.tsx # Token rewards for UGC
387
+ │ │ │ ├── FeaturedUGC.tsx # Featured content
388
+ │ │ │ ├── UGCModeration.tsx # Moderate UGC
389
+ │ │ │ └── ViralTracker.tsx # Track viral spread
390
+ │ │ │
391
+ │ │ ├── livestream/ # 📹 LIVESTREAM (AI + Human Mix)
392
+ │ │ │ ├── LivestreamStudio.tsx # Livestream control room
393
+ │ │ │ ├── StreamPlayer.tsx # Watch stream
394
+ │ │ │ ├── ChatOverlay.tsx # Live chat
395
+ │ │ │ ├── CloneMixer.tsx # Mix AI clone + human
396
+ │ │ │ ├── DonationWidget.tsx # Donations (tokens)
397
+ │ │ │ ├── ViewerList.tsx # Live viewers
398
+ │ │ │ ├── StreamSchedule.tsx # Schedule streams
399
+ │ │ │ └── StreamAnalytics.tsx # Stream stats
400
+ │ │ │
401
+ │ │ ├── analytics/ # 📊 ANALYTICS & BUSINESS OS (Feature #7)
402
+ │ │ │ ├── # Dashboard
403
+ │ │ │ ├── AnalyticsDashboard.tsx # Main dashboard
404
+ │ │ │ ├── MetricCard.tsx # Metric display
405
+ │ │ │ ├── KPIOverview.tsx # Key metrics
406
+ │ │ │ │
407
+ │ │ │ ├── # Charts
408
+ │ │ │ ├── GrowthChart.tsx # Growth over time
409
+ │ │ │ ├── RevenueChart.tsx # Revenue analytics
410
+ │ │ │ ├── TokenChart.tsx # Token metrics
411
+ │ │ │ ├── EngagementChart.tsx # Engagement metrics
412
+ │ │ │ ├── FunnelVisualization.tsx # Conversion funnel
413
+ │ │ │ │
414
+ │ │ │ ├── # Insights
415
+ │ │ │ ├── AIInsights.tsx # AI-generated insights
416
+ │ │ │ ├── PredictionsPanel.tsx # AI predictions
417
+ │ │ │ ├── RecommendationsPanel.tsx # AI recommendations
418
+ │ │ │ ├── AnomalyDetection.tsx # Detect anomalies
419
+ │ │ │ │
420
+ │ │ │ ├── # Reports
421
+ │ │ │ ├── ReportBuilder.tsx # Build custom reports
422
+ │ │ │ ├── ExportReports.tsx # Export data
423
+ │ │ │ ├── ScheduledReports.tsx # Auto-send reports
424
+ │ │ │ │
425
+ │ │ │ └── # Real-time
426
+ │ │ │ ├── RealtimeFeed.tsx # Live activity feed
427
+ │ │ │ └── AlertsPanel.tsx # Important alerts
428
+ │ │ │
429
+ │ │ ├── viral/ # 🔥 VIRAL MECHANICS
430
+ │ │ │ ├── ShareRewards.tsx # Share to earn tokens
431
+ │ │ │ ├── ReferralDashboard.tsx # Referral tracking
432
+ │ │ │ ├── ViralLoop.tsx # Viral loop mechanics
433
+ │ │ │ ├── SocialProof.tsx # Success stories
434
+ │ │ │ ├── Leaderboard.tsx # Top referrers
435
+ │ │ │ └── InviteFlow.tsx # Invite friends
436
+ │ │ │
437
+ │ │ ├── wallet/ # 👛 WALLET & CRYPTO
438
+ │ │ │ ├── WalletConnect.tsx # Connect wallet
439
+ │ │ │ ├── WalletDisplay.tsx # Show balances
440
+ │ │ │ ├── TransactionList.tsx # TX history
441
+ │ │ │ ├── SendTokens.tsx # Send tokens
442
+ │ │ │ ├── ReceiveTokens.tsx # Receive QR
443
+ │ │ │ └── SwapTokens.tsx # Swap tokens (DEX)
444
+ │ │ │
445
+ │ │ └── notifications/ # 🔔 NOTIFICATIONS
446
+ │ │ ├── NotificationCenter.tsx # All notifications
447
+ │ │ ├── NotificationBell.tsx # Bell icon + badge
448
+ │ │ ├── NotificationItem.tsx # Single notification
449
+ │ │ ├── EmailPreferences.tsx # Email settings
450
+ │ │ ├── PushSettings.tsx # Push notification settings
451
+ │ │ └── InAppNotif.tsx # In-app toasts
452
+ │ │
453
+ │ ├── layouts/ # Astro layouts
454
+ │ │ ├── Layout.astro # Base layout
455
+ │ │ ├── Dashboard.astro # Dashboard layout
456
+ │ │ ├── Marketing.astro # Marketing layout
457
+ │ │ └── Auth.astro # Auth layout
458
+ │ │
459
+ │ ├── pages/ # 📄 ASTRO PAGES (File-based routing)
460
+ │ │ │
461
+ │ │ │ # ═══════════════════════════════════════════════════════════════════
462
+ │ │ │ # PAGES ORGANIZED BY THE 8 CORE PLATFORM FEATURES
463
+ │ │ │ # Based on Strategy.md vision - complete creator operating system
464
+ │ │ │ # ═══════════════════════════════════════════════════════════════════
465
+ │ │ │
466
+ │ │ ├── # ═══ MARKETING & PUBLIC PAGES ═══
467
+ │ │ │
468
+ │ │ ├── index.astro # ✅ Marketing homepage (/)
469
+ │ │ ├── pricing.astro # Pricing page (/pricing)
470
+ │ │ ├── features.astro # Features overview (/features)
471
+ │ │ ├── about.astro # About page (/about)
472
+ │ │ ├── contact.astro # Contact page (/contact)
473
+ │ │ ├── demo.astro # Interactive demo (/demo)
474
+ │ │ ├── blog/ # Blog section
475
+ │ │ │ ├── index.astro # Blog list (/blog)
476
+ │ │ │ └── [...slug].astro # Blog post (/blog/[slug])
477
+ │ │ ├── legal/ # Legal pages
478
+ │ │ │ ├── terms.astro # Terms of service (/legal/terms)
479
+ │ │ │ ├── privacy.astro # Privacy policy (/legal/privacy)
480
+ │ │ │ └── cookies.astro # Cookie policy (/legal/cookies)
481
+ │ │ ├── 404.astro # ✅ 404 page
482
+ │ │ ├── 500.astro # 500 error page
483
+ │ │ │
484
+ │ │ ├── # ═══ AUTHENTICATION & ONBOARDING ═══
485
+ │ │ │
486
+ │ │ ├── signin.astro # ✅ Sign in page (/signin)
487
+ │ │ ├── signup.astro # ✅ Sign up page (/signup)
488
+ │ │ ├── forgot-password.astro # ✅ Forgot password (/forgot-password)
489
+ │ │ ├── reset-password.astro # ✅ Reset password (/reset-password)
490
+ │ │ ├── verify-email.astro # ✅ Email verification (/verify-email)
491
+ │ │ ├── request-magic-link.astro # ✅ Magic link request (/request-magic-link)
492
+ │ │ ├── mail.astro # ✅ Magic link verify (/mail)
493
+ │ │ ├── onboard.astro # ✅ Creator onboarding (/onboard)
494
+ │ │ ├── auth/ # Auth pages directory
495
+ │ │ │ ├── signin.astro # ✅ Alt sign in (/auth/signin)
496
+ │ │ │ ├── signup.astro # ✅ Alt sign up (/auth/signup)
497
+ │ │ │ └── verify-2fa.astro # 2FA verification (/auth/verify-2fa)
498
+ │ │ │
499
+ │ │ ├── # ═══ CREATOR DASHBOARD & MANAGEMENT ═══
500
+ │ │ │
501
+ │ │ ├── dashboard.astro # ✅ Main dashboard (/dashboard)
502
+ │ │ ├── settings.astro # ✅ Settings (/settings)
503
+ │ │ │
504
+ │ │ ├── creator/ # Creator-specific pages
505
+ │ │ │ ├── dashboard.astro # Creator dashboard (/creator/dashboard)
506
+ │ │ │ ├── profile.astro # Creator profile edit (/creator/profile)
507
+ │ │ │ ├── settings.astro # Creator settings (/creator/settings)
508
+ │ │ │ ├── analytics.astro # Analytics overview (/creator/analytics)
509
+ │ │ │ ├── revenue.astro # Revenue dashboard (/creator/revenue)
510
+ │ │ │ │
511
+ │ │ │ ├── # Feature #1: AI Clone Management
512
+ │ │ │ ├── clone/
513
+ │ │ │ │ ├── index.astro # Clone overview (/creator/clone)
514
+ │ │ │ │ ├── setup.astro # Clone setup wizard (/creator/clone/setup)
515
+ │ │ │ │ ├── voice.astro # Voice cloning (/creator/clone/voice)
516
+ │ │ │ │ ├── appearance.astro # Appearance cloning (/creator/clone/appearance)
517
+ │ │ │ │ ├── personality.astro # Personality config (/creator/clone/personality)
518
+ │ │ │ │ ├── training.astro # Training status (/creator/clone/training)
519
+ │ │ │ │ ├── knowledge.astro # Knowledge base (RAG) (/creator/clone/knowledge)
520
+ │ │ │ │ ├── test.astro # Test clone chat (/creator/clone/test)
521
+ │ │ │ │ └── analytics.astro # Clone analytics (/creator/clone/analytics)
522
+ │ │ │ │
523
+ │ │ │ ├── # Feature #2: Content Automation
524
+ │ │ │ ├── content/
525
+ │ │ │ │ ├── index.astro # Content overview (/creator/content)
526
+ │ │ │ │ ├── create.astro # Create content (/creator/content/create)
527
+ │ │ │ │ ├── generate.astro # AI content gen (/creator/content/generate)
528
+ │ │ │ │ ├── calendar.astro # Content calendar (/creator/content/calendar)
529
+ │ │ │ │ ├── schedule.astro # Schedule posts (/creator/content/schedule)
530
+ │ │ │ │ ├── library.astro # Content library (/creator/content/library)
531
+ │ │ │ │ ├── templates.astro # Content templates (/creator/content/templates)
532
+ │ │ │ │ ├── analytics.astro # Content analytics (/creator/content/analytics)
533
+ │ │ │ │ └── social.astro # Social accounts (/creator/content/social)
534
+ │ │ │ │
535
+ │ │ │ ├── # Feature #3: Interactive Avatar (Livestream)
536
+ │ │ │ ├── livestream/
537
+ │ │ │ │ ├── index.astro # Livestream overview (/creator/livestream)
538
+ │ │ │ │ ├── setup.astro # Stream setup (/creator/livestream/setup)
539
+ │ │ │ │ ├── studio.astro # Live studio (/creator/livestream/studio)
540
+ │ │ │ │ ├── mixer.astro # AI+Human mixer (/creator/livestream/mixer)
541
+ │ │ │ │ ├── chat.astro # Live chat mgmt (/creator/livestream/chat)
542
+ │ │ │ │ ├── recordings.astro # Stream recordings (/creator/livestream/recordings)
543
+ │ │ │ │ └── analytics.astro # Stream analytics (/creator/livestream/analytics)
544
+ │ │ │ │
545
+ │ │ │ ├── # Feature #5: AI-Powered LMS (Courses)
546
+ │ │ │ ├── courses/
547
+ │ │ │ │ ├── index.astro # Courses overview (/creator/courses)
548
+ │ │ │ │ ├── create.astro # Create course (/creator/courses/create)
549
+ │ │ │ │ ├── generate.astro # AI course gen (/creator/courses/generate)
550
+ │ │ │ │ ├── builder/
551
+ │ │ │ │ │ └── [id].astro # Course builder (/creator/courses/builder/[id])
552
+ │ │ │ │ ├── edit/
553
+ │ │ │ │ │ └── [id].astro # Edit course (/creator/courses/edit/[id])
554
+ │ │ │ │ ├── students.astro # Student mgmt (/creator/courses/students)
555
+ │ │ │ │ ├── analytics.astro # Course analytics (/creator/courses/analytics)
556
+ │ │ │ │ └── certificates.astro # Certificate mgmt (/creator/courses/certificates)
557
+ │ │ │ │
558
+ │ │ │ ├── # Feature #6: Living Community
559
+ │ │ │ ├── community/
560
+ │ │ │ │ ├── index.astro # Community overview (/creator/community)
561
+ │ │ │ │ ├── members.astro # Manage members (/creator/community/members)
562
+ │ │ │ │ ├── moderation.astro # Moderation queue (/creator/community/moderation)
563
+ │ │ │ │ ├── channels.astro # Manage channels (/creator/community/channels)
564
+ │ │ │ │ ├── events.astro # Community events (/creator/community/events)
565
+ │ │ │ │ ├── analytics.astro # Community analytics (/creator/community/analytics)
566
+ │ │ │ │ └── settings.astro # Community settings (/creator/community/settings)
567
+ │ │ │ │
568
+ │ │ │ ├── # Feature #8: Token Economy
569
+ │ │ │ ├── token/
570
+ │ │ │ │ ├── index.astro # Token overview (/creator/token)
571
+ │ │ │ │ ├── launch.astro # Launch token wizard (/creator/token/launch)
572
+ │ │ │ │ ├── economics.astro # Token economics config (/creator/token/economics)
573
+ │ │ │ │ ├── holders.astro # Token holders (/creator/token/holders)
574
+ │ │ │ │ ├── distribution.astro # Token distribution (/creator/token/distribution)
575
+ │ │ │ │ ├── staking.astro # Staking config (/creator/token/staking)
576
+ │ │ │ │ ├── governance.astro # Governance (/creator/token/governance)
577
+ │ │ │ │ ├── analytics.astro # Token analytics (/creator/token/analytics)
578
+ │ │ │ │ └── transactions.astro # Transaction history (/creator/token/transactions)
579
+ │ │ │ │
580
+ │ │ │ ├── # Feature #7: Business OS (10 AI Agents)
581
+ │ │ │ ├── agents/
582
+ │ │ │ │ ├── index.astro # Agents overview (/creator/agents)
583
+ │ │ │ │ ├── ceo.astro # Strategy agent (/creator/agents/ceo)
584
+ │ │ │ │ ├── cmo.astro # Marketing agent (/creator/agents/cmo)
585
+ │ │ │ │ ├── cso.astro # Sales agent (/creator/agents/cso)
586
+ │ │ │ │ ├── cxo.astro # Service agent (/creator/agents/cxo)
587
+ │ │ │ │ ├── cdo.astro # Design agent (/creator/agents/cdo)
588
+ │ │ │ │ ├── cto.astro # Engineering agent (/creator/agents/cto)
589
+ │ │ │ │ ├── cfo.astro # Finance agent (/creator/agents/cfo)
590
+ │ │ │ │ ├── clo.astro # Legal agent (/creator/agents/clo)
591
+ │ │ │ │ ├── cio.astro # Intelligence agent (/creator/agents/cio)
592
+ │ │ │ │ └── analytics.astro # Analytics agent (/creator/agents/analytics)
593
+ │ │ │ │
594
+ │ │ │ ├── # Feature #4: UGC Engine
595
+ │ │ │ ├── ugc/
596
+ │ │ │ │ ├── index.astro # UGC overview (/creator/ugc)
597
+ │ │ │ │ ├── templates.astro # UGC templates (/creator/ugc/templates)
598
+ │ │ │ │ ├── submissions.astro # Review submissions (/creator/ugc/submissions)
599
+ │ │ │ │ ├── featured.astro # Featured UGC (/creator/ugc/featured)
600
+ │ │ │ │ ├── rewards.astro # UGC rewards config (/creator/ugc/rewards)
601
+ │ │ │ │ └── analytics.astro # UGC analytics (/creator/ugc/analytics)
602
+ │ │ │ │
603
+ │ │ │ ├── # Viral Growth
604
+ │ │ │ ├── growth/
605
+ │ │ │ │ ├── index.astro # Growth overview (/creator/growth)
606
+ │ │ │ │ ├── referrals.astro # Referral program (/creator/growth/referrals)
607
+ │ │ │ │ ├── viral.astro # Viral loops config (/creator/growth/viral)
608
+ │ │ │ │ ├── incentives.astro # Growth incentives (/creator/growth/incentives)
609
+ │ │ │ │ └── analytics.astro # Growth analytics (/creator/growth/analytics)
610
+ │ │ │ │
611
+ │ │ │ └── # ELEVATE Journey
612
+ │ │ │ ├── elevate/
613
+ │ │ │ ├── index.astro # ELEVATE overview (/creator/elevate)
614
+ │ │ │ ├── journey.astro # Journey editor (/creator/elevate/journey)
615
+ │ │ │ ├── steps.astro # Step config (/creator/elevate/steps)
616
+ │ │ │ ├── participants.astro # Journey participants (/creator/elevate/participants)
617
+ │ │ │ └── analytics.astro # Journey analytics (/creator/elevate/analytics)
618
+ │ │ │
619
+ │ │ ├── # ═══ PUBLIC CREATOR PROFILES ═══
620
+ │ │ │
621
+ │ │ ├── [username]/ # Public creator profile (dynamic route)
622
+ │ │ │ ├── index.astro # Creator homepage (/[username])
623
+ │ │ │ ├── about.astro # About creator (/[username]/about)
624
+ │ │ │ ├── content.astro # Content gallery (/[username]/content)
625
+ │ │ │ ├── courses.astro # Courses catalog (/[username]/courses)
626
+ │ │ │ ├── community.astro # Join community (/[username]/community)
627
+ │ │ │ ├── token.astro # Buy token (/[username]/token)
628
+ │ │ │ └── chat.astro # Chat with AI clone (/[username]/chat)
629
+ │ │ │
630
+ │ │ ├── # ═══ FAN/AUDIENCE EXPERIENCE ═══
631
+ │ │ │
632
+ │ │ ├── chat/ # Chat with AI clones
633
+ │ │ │ ├── index.astro # Chat overview (/chat)
634
+ │ │ │ └── [cloneId].astro # Chat with clone (/chat/[cloneId])
635
+ │ │ │
636
+ │ │ ├── courses/ # Course marketplace & learning
637
+ │ │ │ ├── index.astro # Browse courses (/courses)
638
+ │ │ │ ├── [id].astro # Course details (/courses/[id])
639
+ │ │ │ ├── enroll/
640
+ │ │ │ │ └── [id].astro # Enroll in course (/courses/enroll/[id])
641
+ │ │ │ ├── learn/
642
+ │ │ │ │ └── [id].astro # Take course (/courses/learn/[id])
643
+ │ │ │ ├── my-courses.astro # My enrolled courses (/courses/my-courses)
644
+ │ │ │ ├── progress.astro # Learning progress (/courses/progress)
645
+ │ │ │ └── certificates.astro # My certificates (/courses/certificates)
646
+ │ │ │
647
+ │ │ ├── community/ # Community features
648
+ │ │ │ ├── index.astro # Community home (/community)
649
+ │ │ │ ├── [creatorId]/ # Creator community
650
+ │ │ │ │ ├── index.astro # Community feed (/community/[creatorId])
651
+ │ │ │ │ ├── channels/
652
+ │ │ │ │ │ └── [channelId].astro # Channel view (/community/[creatorId]/channels/[channelId])
653
+ │ │ │ │ ├── events.astro # Community events (/community/[creatorId]/events)
654
+ │ │ │ │ └── members.astro # Community members (/community/[creatorId]/members)
655
+ │ │ │ └── my-communities.astro # My communities (/community/my-communities)
656
+ │ │ │
657
+ │ │ ├── tokens/ # Token marketplace
658
+ │ │ │ ├── index.astro # Token marketplace (/tokens)
659
+ │ │ │ ├── [symbol]/ # Token details
660
+ │ │ │ │ ├── index.astro # Token overview (/tokens/[symbol])
661
+ │ │ │ │ ├── buy.astro # Buy token (/tokens/[symbol]/buy)
662
+ │ │ │ │ ├── stake.astro # Stake tokens (/tokens/[symbol]/stake)
663
+ │ │ │ │ ├── chart.astro # Price chart (/tokens/[symbol]/chart)
664
+ │ │ │ │ └── holders.astro # Token holders (/tokens/[symbol]/holders)
665
+ │ │ │ ├── portfolio.astro # My token portfolio (/tokens/portfolio)
666
+ │ │ │ ├── wallet.astro # Wallet mgmt (/tokens/wallet)
667
+ │ │ │ └── transactions.astro # Transaction history (/tokens/transactions)
668
+ │ │ │
669
+ │ │ ├── ugc/ # User-generated content
670
+ │ │ │ ├── index.astro # UGC gallery (/ugc)
671
+ │ │ │ ├── create.astro # Create UGC (/ugc/create)
672
+ │ │ │ ├── my-content.astro # My UGC (/ugc/my-content)
673
+ │ │ │ ├── rewards.astro # UGC rewards (/ugc/rewards)
674
+ │ │ │ └── [id].astro # View UGC (/ugc/[id])
675
+ │ │ │
676
+ │ │ ├── livestream/ # Livestream viewing
677
+ │ │ │ ├── index.astro # Browse streams (/livestream)
678
+ │ │ │ ├── [streamId].astro # Watch stream (/livestream/[streamId])
679
+ │ │ │ └── schedule.astro # Stream schedule (/livestream/schedule)
680
+ │ │ │
681
+ │ │ ├── elevate/ # ELEVATE journey (fan experience)
682
+ │ │ │ ├── index.astro # ELEVATE overview (/elevate)
683
+ │ │ │ ├── join.astro # Join journey (/elevate/join)
684
+ │ │ │ ├── journey/
685
+ │ │ │ │ └── [id].astro # Journey progress (/elevate/journey/[id])
686
+ │ │ │ └── completed.astro # Completed journeys (/elevate/completed)
687
+ │ │ │
688
+ │ │ ├── wallet/ # Wallet & crypto
689
+ │ │ │ ├── index.astro # Wallet overview (/wallet)
690
+ │ │ │ ├── connect.astro # Connect wallet (/wallet/connect)
691
+ │ │ │ ├── balance.astro # Token balances (/wallet/balance)
692
+ │ │ │ ├── send.astro # Send tokens (/wallet/send)
693
+ │ │ │ ├── receive.astro # Receive tokens (/wallet/receive)
694
+ │ │ │ └── history.astro # Transaction history (/wallet/history)
695
+ │ │ │
696
+ │ │ ├── notifications/ # Notifications
697
+ │ │ │ ├── index.astro # All notifications (/notifications)
698
+ │ │ │ └── settings.astro # Notification settings (/notifications/settings)
699
+ │ │ │
700
+ │ │ └── # ═══ API ROUTES ═══
701
+ │ │ │
702
+ │ │ └── api/ # API endpoints
703
+ │ │ ├── auth/
704
+ │ │ │ └── [...all].ts # ✅ Better Auth handler
705
+ │ │ ├── trpc/
706
+ │ │ │ └── [trpc].ts # tRPC endpoint (if using)
707
+ │ │ ├── webhooks/
708
+ │ │ │ ├── stripe.ts # Stripe webhooks
709
+ │ │ │ ├── coinbase.ts # Coinbase webhooks
710
+ │ │ │ └── resend.ts # Resend webhooks
711
+ │ │ └── convex/
712
+ │ │ └── sync.ts # Convex sync endpoint
713
+ │ │
714
+ │ ├── lib/ # Frontend utilities
715
+ │ │ ├── auth-client.ts # Better Auth client
716
+ │ │ ├── convex-client.ts # Convex setup
717
+ │ │ ├── utils.ts # cn() + helpers
718
+ │ │ ├── hooks.ts # Custom hooks
719
+ │ │ ├── validators.ts # Zod schemas
720
+ │ │ └── constants.ts # Constants
721
+ │ │
722
+ │ ├── styles/ # Styles
723
+ │ │ ├── global.css # Global + Tailwind
724
+ │ │ └── themes/
725
+ │ │ ├── light.css # Light theme vars
726
+ │ │ └── dark.css # Dark theme vars
727
+ │ │
728
+ │ └── types/ # Frontend types
729
+ │ ├── index.ts # Shared types
730
+ │ ├── entities.ts # Entity types
731
+ │ ├── auth.ts # Auth types
732
+ │ └── api.ts # API types
733
+ │
734
+ ├── convex/ # 🔷 CONVEX BACKEND (Effect.ts-Powered Architecture)
735
+ │ │
736
+ │ │ # ═══════════════════════════════════════════════════════════════════════════════
737
+ │ │ # EFFECT.TS ARCHITECTURE: How Effect.ts Covers the Entire Application
738
+ │ │ # ═══════════════════════════════════════════════════════════════════════════════
739
+ │ │ #
740
+ │ │ # The ONE Platform uses Effect.ts as the CORE architecture pattern. Here's how:
741
+ │ │ #
742
+ │ │ # 📊 THREE-LAYER ARCHITECTURE:
743
+ │ │ #
744
+ │ │ # Layer 1: CONVEX API (Thin Wrappers)
745
+ │ │ # ├── mutations/ → Write operations (user-facing API)
746
+ │ │ # ├── queries/ → Read operations (user-facing API)
747
+ │ │ # └── actions/ → External calls (user-facing API)
748
+ │ │ #
749
+ │ │ # Layer 2: EFFECT.TS SERVICES (Business Logic - 100% of app logic lives here)
750
+ │ │ # ├── core/ → Database, Auth, Storage, Cache, Queue
751
+ │ │ # ├── ai/ → AI Clone, Content Gen, Chat, RAG
752
+ │ │ # ├── business/ → 10 AI C-Suite Agents (CEO, CMO, CFO, etc.)
753
+ │ │ # ├── community/ → Messages, Moderation, Engagement
754
+ │ │ # ├── tokens/ → Purchase, Staking, Economics, Governance
755
+ │ │ # ├── courses/ → Builder, Generation, Progress, Gamification
756
+ │ │ # ├── content/ → Creation, Automation, Distribution
757
+ │ │ # ├── ugc/ → UGC creation, rewards, viral mechanics
758
+ │ │ # ├── livestream/ → Streaming, AI+Human mixing, chat, donations
759
+ │ │ # ├── elevate/ → 9-step journey orchestration
760
+ │ │ # ├── analytics/ → Metrics, Insights, Predictions, Reports
761
+ │ │ # ├── viral/ → Referrals, Share-to-earn, Viral loops
762
+ │ │ # ├── entities/ → CRUD for all 56 entity types
763
+ │ │ # ├── connections/ → Manage 25 connection types
764
+ │ │ # ├── events/ → Log, track, replay 35 event types
765
+ │ │ # └── protocols/ → A2A, ACP, AP2, X402, AG-UI, MCP integration
766
+ │ │ #
767
+ │ │ # Layer 3: EXTERNAL PROVIDERS (Effect.ts Wrappers - 26 providers)
768
+ │ │ # ├── AI/LLM (5) → OpenAI, Anthropic, ElevenLabs, D-ID, HeyGen
769
+ │ │ # ├── Blockchain (4) → Base, Alchemy, Uniswap, WalletConnect
770
+ │ │ # ├── Payment (2) → Stripe (fiat), Coinbase (crypto)
771
+ │ │ # ├── Communication (4) → Resend, SendGrid, Twilio, Pusher
772
+ │ │ # ├── Media/Storage (2) → AWS S3, Cloudflare Stream
773
+ │ │ # ├── Integration (3) → ElizaOS, CopilotKit, n8n
774
+ │ │ # └── Social Media (6) → Twitter, Instagram, YouTube, TikTok, LinkedIn, Facebook
775
+ │ │ #
776
+ │ │ # 🎯 EFFECT.TS BENEFITS:
777
+ │ │ #
778
+ │ │ # 1. Type-Safe Errors:
779
+ │ │ # - NO try/catch blocks
780
+ │ │ # - Every error is typed (InsufficientContentError, VoiceCloneFailedError, etc.)
781
+ │ │ # - Pattern matching on error types
782
+ │ │ #
783
+ │ │ # 2. Dependency Injection:
784
+ │ │ # - Services declare their dependencies explicitly
785
+ │ │ # - Easy to mock for testing (MockAICloneService, MockStripeProvider, etc.)
786
+ │ │ # - Compose services into larger workflows
787
+ │ │ #
788
+ │ │ # 3. Composability:
789
+ │ │ # - Services combine like LEGO blocks
790
+ │ │ # - Parallel execution: Effect.all([...], { concurrency: 5 })
791
+ │ │ # - Sequential execution: Effect.gen chaining
792
+ │ │ # - Retries, timeouts, circuit breakers built-in
793
+ │ │ #
794
+ │ │ # 4. Platform Agnostic:
795
+ │ │ # - Services are pure functions (no Convex-specific code)
796
+ │ │ # - Can run in: Convex, Node.js, Cloudflare Workers, Deno, Bun
797
+ │ │ # - Easy to migrate if needed
798
+ │ │ #
799
+ │ │ # 5. Testability:
800
+ │ │ # - Mock any dependency
801
+ │ │ # - Test services in isolation
802
+ │ │ # - Integration tests compose real services
803
+ │ │ #
804
+ │ │ # 6. Observability:
805
+ │ │ # - Built-in logging: Effect.logInfo, Effect.logError
806
+ │ │ # - Tracing: Effect.withSpan for distributed tracing
807
+ │ │ # - Metrics: Track execution time, errors, retries
808
+ │ │ #
809
+ │ │ # 🔄 EXECUTION FLOW EXAMPLE (Token Purchase):
810
+ │ │ #
811
+ │ │ # 1. User clicks "Buy 100 Tokens"
812
+ │ │ # 2. Frontend calls: useMutation(api.tokens.purchase)
813
+ │ │ # 3. Convex mutation validates args
814
+ │ │ # 4. Mutation calls: TokenService.purchaseTokens(...)
815
+ │ │ # 5. TokenService orchestrates:
816
+ │ │ # a) Charge payment (StripeProvider)
817
+ │ │ # b) Mint tokens (BaseProvider)
818
+ │ │ # c) Update balance (ConvexDatabase)
819
+ │ │ # d) Log event (EventService)
820
+ │ │ # 6. All operations atomic (succeed together or fail together)
821
+ │ │ # 7. Automatic rollback on error
822
+ │ │ # 8. Return result to user
823
+ │ │ #
824
+ │ │ # 📚 KEY PRINCIPLES:
825
+ │ │ #
826
+ │ │ # - ALL business logic in services/ (100% Effect.ts)
827
+ │ │ # - Convex functions are THIN WRAPPERS (validate → call service → return)
828
+ │ │ # - NO business logic in mutations/queries/actions
829
+ │ │ # - Services are pure, testable, composable
830
+ │ │ # - Explicit types everywhere (no `any`, typed errors)
831
+ │ │ #
832
+ │ │ # ═══════════════════════════════════════════════════════════════════════════════
833
+ │ │ # STATUS: PLANNED (not yet implemented - this is the blueprint)
834
+ │ │ # ═══════════════════════════════════════════════════════════════════════════════
835
+ │ │
836
+ │ ├── schema/ # 📊 DATABASE SCHEMA (PLANNED)
837
+ │ │ ├── index.ts # Main schema export (TODO)
838
+ │ │ ├── entities.ts # Entities table definition (TODO)
839
+ │ │ ├── connections.ts # Connections table definition (TODO)
840
+ │ │ ├── events.ts # Events table definition (TODO)
841
+ │ │ ├── tags.ts # Tags table definitions (TODO)
842
+ │ │ └── types.ts # Property type definitions (TODO)
843
+ │ │
844
+ │ ├── services/ # 🎯 EFFECT.TS SERVICES (PLANNED - Core Architecture)
845
+ │ │ │
846
+ │ │ │ # ═══════════════════════════════════════════════════════════
847
+ │ │ │ # EFFECT.TS SERVICE LAYER OVERVIEW
848
+ │ │ │ # ═══════════════════════════════════════════════════════════
849
+ │ │ │ # This is the CORE of the ONE Platform architecture.
850
+ │ │ │ # ALL business logic lives here as pure Effect.ts services.
851
+ │ │ │ # Convex functions are THIN WRAPPERS that call these services.
852
+ │ │ │ #
853
+ │ │ │ # Pattern (REPLICATE EXACTLY):
854
+ │ │ │ #
855
+ │ │ │ # export class ServiceName extends Effect.Service<ServiceName>()(
856
+ │ │ │ # "ServiceName",
857
+ │ │ │ # {
858
+ │ │ │ # effect: Effect.gen(function* () {
859
+ │ │ │ # const db = yield* ConvexDatabase;
860
+ │ │ │ # const provider = yield* ExternalProvider;
861
+ │ │ │ #
862
+ │ │ │ # return {
863
+ │ │ │ # operation: (args) => Effect.gen(function* () {
864
+ │ │ │ # // Pure functional logic
865
+ │ │ │ # // Explicit error handling
866
+ │ │ │ # // Composable operations
867
+ │ │ │ # })
868
+ │ │ │ # };
869
+ │ │ │ # }),
870
+ │ │ │ # dependencies: [ConvexDatabase.Default, Provider.Default]
871
+ │ │ │ # }
872
+ │ │ │ # ) {}
873
+ │ │ │ #
874
+ │ │ │ # Benefits:
875
+ │ │ │ # - Pure functions (testable)
876
+ │ │ │ # - Typed errors (no exceptions)
877
+ │ │ │ # - Dependency injection (composable)
878
+ │ │ │ # - Platform agnostic (can run anywhere)
879
+ │ │ │ # ═══════════════════════════════════════════════════════════
880
+ │ │ │
881
+ │ │ ├── index.ts # Service exports + MainLayer composition (TODO)
882
+ │ │ │
883
+ │ │ ├── core/ # 🔧 CORE INFRASTRUCTURE SERVICES
884
+ │ │ │ │
885
+ │ │ │ │ # Database, Auth, Storage, Cache, Queue - foundational services
886
+ │ │ │ │ # These provide the base layer for all other services
887
+ │ │ │ │
888
+ │ │ │ ├── database.ts # ConvexDatabase service (CRUD, queries, transactions)
889
+ │ │ │ ├── auth.ts # Auth service (Better Auth wrapper, session mgmt)
890
+ │ │ │ ├── storage.ts # File storage service (R2/S3 integration)
891
+ │ │ │ ├── cache.ts # Caching layer service (Redis-like operations)
892
+ │ │ │ └── queue.ts # Job queue service (background tasks)
893
+ │ │ │
894
+ │ │ ├── ai/ # 🤖 AI SERVICES (Feature #1 - AI Clone Technology)
895
+ │ │ │ │
896
+ │ │ │ │ # AI Clone Creation, Training, and Interaction Services
897
+ │ │ │ │ # Depends on: OpenAI, Anthropic, ElevenLabs, D-ID, HeyGen providers
898
+ │ │ │ │
899
+ │ │ │ ├── clone.ts # AI clone orchestration (create, train, deploy)
900
+ │ │ │ ├── voice-clone.ts # Voice cloning via ElevenLabs (3+ samples)
901
+ │ │ │ ├── appearance-clone.ts # Appearance cloning via D-ID/HeyGen
902
+ │ │ │ ├── personality.ts # Personality extraction from creator content
903
+ │ │ │ ├── rag.ts # RAG knowledge base (embeddings + vector search)
904
+ │ │ │ ├── training.ts # Clone training pipeline (async workflows)
905
+ │ │ │ │
906
+ │ │ │ │ # Content Generation Services (Feature #2)
907
+ │ │ │ │
908
+ │ │ │ ├── content-generation.ts # AI content creation (GPT-4, Claude)
909
+ │ │ │ ├── content-strategy.ts # Content strategy planning
910
+ │ │ │ ├── social-optimization.ts # Social media post optimization
911
+ │ │ │ ├── hashtag-generation.ts # AI hashtag suggestions
912
+ │ │ │ │
913
+ │ │ │ │ # Conversational AI Services
914
+ │ │ │ │
915
+ │ │ │ ├── chat.ts # Chat interactions with AI clone
916
+ │ │ │ ├── context-manager.ts # Conversation context tracking
917
+ │ │ │ └── response-generation.ts # Streaming response generation
918
+ │ │ │
919
+ │ │ ├── business/ # 💼 BUSINESS AGENTS SERVICES (10 AI C-Suite Agents)
920
+ │ │ │ │
921
+ │ │ │ │ # Autonomous AI agents that run a creator's entire business
922
+ │ │ │ │ # Each agent has specialized expertise and can collaborate
923
+ │ │ │ │ # Depends on: Convex Agent component, OpenAI, Anthropic
924
+ │ │ │ │
925
+ │ │ │ ├── orchestrator.ts # Multi-agent orchestration & coordination
926
+ │ │ │ ├── strategy.ts # Strategy Agent (CEO) - vision, goals, OKRs
927
+ │ │ │ ├── marketing.ts # Marketing Agent (CMO) - campaigns, SEO, brand
928
+ │ │ │ ├── sales.ts # Sales Agent (CSO) - funnels, conversion, follow-up
929
+ │ │ │ ├── service.ts # Service Agent (CXO) - customer success, support
930
+ │ │ │ ├── design.ts # Design Agent (CDO) - branding, assets, UX
931
+ │ │ │ ├── engineering.ts # Engineering Agent (CTO) - automation, optimization
932
+ │ │ │ ├── finance.ts # Finance Agent (CFO) - revenue, forecasting, costs
933
+ │ │ │ ├── legal.ts # Legal Agent (CLO) - compliance, contracts, IP
934
+ │ │ │ ├── intelligence.ts # Intelligence Agent (CIO) - analytics, insights
935
+ │ │ │ └── analytics.ts # Analytics Agent - data analysis, reporting
936
+ │ │ │
937
+ │ │ ├── community/ # 💬 COMMUNITY SERVICES (Feature #6 - Living Community)
938
+ │ │ │ │
939
+ │ │ │ │ # Real-time community features with AI clone participation
940
+ │ │ │ │ # Depends on: Pusher (real-time), OpenAI (moderation)
941
+ │ │ │ │
942
+ │ │ │ ├── messages.ts # Message handling (create, edit, delete, reactions)
943
+ │ │ │ ├── moderation.ts # AI + human moderation (content filtering)
944
+ │ │ │ ├── engagement.ts # Engagement tracking (likes, shares, comments)
945
+ │ │ │ ├── notifications.ts # Notification dispatch (push, email, in-app)
946
+ │ │ │ ├── threads.ts # Thread management (conversations, replies)
947
+ │ │ │ └── direct-messages.ts # DM handling (private messaging)
948
+ │ │ │
949
+ │ │ ├── tokens/ # 💰 TOKEN SERVICES (Feature #8 - Token Economy)
950
+ │ │ │ │
951
+ │ │ │ │ # Creator token economy - purchase, stake, govern, earn
952
+ │ │ │ │ # Depends on: Base blockchain, Uniswap, Stripe, Coinbase
953
+ │ │ │ │
954
+ │ │ │ ├── purchase.ts # Token purchase (fiat → crypto, atomic txs)
955
+ │ │ │ ├── rewards.ts # Reward distribution (engagement rewards)
956
+ │ │ │ ├── staking.ts # Staking logic (lock tokens, earn yield)
957
+ │ │ │ ├── economics.ts # Token economics (bonding curves, supply)
958
+ │ │ │ ├── burn.ts # Burn mechanism (deflationary pressure)
959
+ │ │ │ ├── governance.ts # Governance voting (DAO features)
960
+ │ │ │ └── distribution.ts # Token distribution (airdrops, rewards)
961
+ │ │ │
962
+ │ │ ├── courses/ # 📚 COURSE SERVICES (Feature #5 - AI-Powered LMS)
963
+ │ │ │ │
964
+ │ │ │ │ # AI-generated courses with personalized learning paths
965
+ │ │ │ │ # Depends on: OpenAI (content gen), ConvexDatabase (progress)
966
+ │ │ │ │
967
+ │ │ │ ├── builder.ts # Course builder (manual + AI-assisted)
968
+ │ │ │ ├── generation.ts # AI course generation (full course from topic)
969
+ │ │ │ ├── enrollment.ts # Enrollment logic (token-gated access)
970
+ │ │ │ ├── progress.ts # Progress tracking (completion, time spent)
971
+ │ │ │ ├── assessment.ts # Quiz/assignment grading (AI + manual)
972
+ │ │ │ ├── personalization.ts # Personalized learning paths (adaptive)
973
+ │ │ │ ├── certificates.ts # Certificate issuance (NFT certificates)
974
+ │ │ │ └── gamification.ts # Gamification logic (badges, streaks, XP)
975
+ │ │ │
976
+ │ │ ├── content/ # 📝 CONTENT SERVICES (Feature #2 - Content Automation)
977
+ │ │ │ │
978
+ │ │ │ │ # AI-powered content creation and multi-platform distribution
979
+ │ │ │ │ # Depends on: OpenAI, social media providers (6), AWS S3
980
+ │ │ │ │
981
+ │ │ │ ├── creation.ts # Content creation (AI-assisted writing, images)
982
+ │ │ │ ├── automation.ts # Automated publishing (scheduled posts)
983
+ │ │ │ ├── scheduling.ts # Content calendar scheduling (optimal timing)
984
+ │ │ │ ├── distribution.ts # Multi-platform distribution (X, IG, YT, etc.)
985
+ │ │ │ ├── optimization.ts # Content optimization (SEO, hashtags, CTR)
986
+ │ │ │ └── templates.ts # Template management (reusable formats)
987
+ │ │ │
988
+ │ │ ├── ugc/ # 🎨 UGC SERVICES (Feature #4 - User-Generated Content)
989
+ │ │ │ │
990
+ │ │ │ │ # UGC creation tools + viral mechanics + token rewards
991
+ │ │ │ │ # Depends on: OpenAI (generation), TokenService (rewards)
992
+ │ │ │ │
993
+ │ │ │ ├── creation.ts # UGC creation tools (AI templates, meme gen)
994
+ │ │ │ ├── moderation.ts # UGC moderation (AI + human review)
995
+ │ │ │ ├── rewards.ts # UGC token rewards (share-to-earn)
996
+ │ │ │ ├── viral.ts # Viral mechanics (amplification loops)
997
+ │ │ │ └── featured.ts # Featured UGC selection (trending algorithm)
998
+ │ │ │
999
+ │ │ ├── livestream/ # 📹 LIVESTREAM SERVICES (Feature #3 - Interactive Avatar)
1000
+ │ │ │ │
1001
+ │ │ │ │ # Live streaming with AI clone + human hybrid interaction
1002
+ │ │ │ │ # Depends on: Cloudflare Stream, Pusher, AI clone services
1003
+ │ │ │ │
1004
+ │ │ │ ├── streaming.ts # Stream management (RTMP, WebRTC, recording)
1005
+ │ │ │ ├── clone-mixer.ts # Mix AI clone + human (hybrid streams)
1006
+ │ │ │ ├── chat.ts # Live chat (real-time messaging)
1007
+ │ │ │ ├── donations.ts # Donation handling (token tips, fiat)
1008
+ │ │ │ └── recording.ts # Stream recording (VOD generation, clips)
1009
+ │ │ │
1010
+ │ │ ├── elevate/ # 🚀 ELEVATE SERVICES (9-Step Customer Journey)
1011
+ │ │ │ │
1012
+ │ │ │ │ # ELEVATE journey orchestration - multi-week workflows
1013
+ │ │ │ │ # Depends on: Workflow component, payment services
1014
+ │ │ │ │
1015
+ │ │ │ ├── journey.ts # Journey orchestration (9-step workflow)
1016
+ │ │ │ ├── step-handler.ts # Step execution (hook, gift, identify, etc.)
1017
+ │ │ │ ├── timing.ts # Timed waiting logic (delays between steps)
1018
+ │ │ │ ├── progression.ts # Progress tracking (completion tracking)
1019
+ │ │ │ └── completion.ts # Journey completion (certificate issuance)
1020
+ │ │ │
1021
+ │ │ ├── analytics/ # 📊 ANALYTICS SERVICES (Feature #7 - Business OS)
1022
+ │ │ │ │
1023
+ │ │ │ │ # AI-powered analytics, insights, predictions
1024
+ │ │ │ │ # Depends on: OpenAI (insights), ConvexDatabase (metrics)
1025
+ │ │ │ │
1026
+ │ │ │ ├── metrics.ts # Metric calculation (KPIs, aggregations)
1027
+ │ │ │ ├── insights.ts # AI insights generation (anomaly detection)
1028
+ │ │ │ ├── predictions.ts # Predictive analytics (forecasting)
1029
+ │ │ │ ├── recommendations.ts # AI recommendations (optimization suggestions)
1030
+ │ │ │ ├── reporting.ts # Report generation (PDF, dashboards)
1031
+ │ │ │ └── real-time.ts # Real-time analytics (live metrics)
1032
+ │ │ │
1033
+ │ │ ├── viral/ # 🔥 VIRAL SERVICES (Growth Mechanisms)
1034
+ │ │ │ │
1035
+ │ │ │ │ # Viral growth mechanics - referrals, share-to-earn, loops
1036
+ │ │ │ │ # Depends on: TokenService (rewards), social providers
1037
+ │ │ │ │
1038
+ │ │ │ ├── referrals.ts # Referral tracking (invite codes, attribution)
1039
+ │ │ │ ├── share-rewards.ts # Share-to-earn logic (token rewards for shares)
1040
+ │ │ │ ├── viral-loops.ts # Viral loop mechanics (k-factor optimization)
1041
+ │ │ │ └── social-proof.ts # Success story tracking (testimonials, wins)
1042
+ │ │ │
1043
+ │ │ ├── entities/ # 📦 ENTITY SERVICES (Ontology CRUD Operations)
1044
+ │ │ │ │
1045
+ │ │ │ │ # Type-safe CRUD for each entity type in the ontology
1046
+ │ │ │ │ # Depends on: ConvexDatabase service
1047
+ │ │ │ │
1048
+ │ │ │ ├── creator.ts # Creator CRUD (create, read, update, deactivate)
1049
+ │ │ │ ├── content.ts # Content CRUD (posts, videos, articles)
1050
+ │ │ │ ├── user.ts # User CRUD (audience members)
1051
+ │ │ │ ├── clone.ts # AI clone CRUD (manage clones)
1052
+ │ │ │ ├── course.ts # Course CRUD (lessons, modules, quizzes)
1053
+ │ │ │ ├── token.ts # Token CRUD (creator tokens)
1054
+ │ │ │ └── community.ts # Community CRUD (spaces, channels)
1055
+ │ │ │
1056
+ │ │ ├── connections/ # 🔗 CONNECTION SERVICES (Relationship Management)
1057
+ │ │ │ │
1058
+ │ │ │ │ # Manage relationships between entities (25 connection types)
1059
+ │ │ │ │ # Depends on: ConvexDatabase, EventService (logging)
1060
+ │ │ │ │
1061
+ │ │ │ ├── follow.ts # Follow/unfollow (creator ↔ user)
1062
+ │ │ │ ├── enrollment.ts # Course enrollment (user → course)
1063
+ │ │ │ ├── ownership.ts # Ownership management (creator → content)
1064
+ │ │ │ ├── token-holding.ts # Token balance tracking (user ↔ token)
1065
+ │ │ │ └── relationships.ts # Generic relationships (extensible)
1066
+ │ │ │
1067
+ │ │ ├── events/ # 📅 EVENT SERVICES (Event Sourcing & Analytics)
1068
+ │ │ │ │
1069
+ │ │ │ │ # Event logging, tracking, replay (35 event types)
1070
+ │ │ │ │ # Depends on: ConvexDatabase (append-only events table)
1071
+ │ │ │ │
1072
+ │ │ │ ├── logging.ts # Event logging (create events with metadata)
1073
+ │ │ │ ├── tracking.ts # Event tracking (aggregate, query, filter)
1074
+ │ │ │ └── replay.ts # Event replay/audit (time-travel queries)
1075
+ │ │ │
1076
+ │ │ ├── protocols/ # 🌐 PROTOCOL SERVICES (External Standards)
1077
+ │ │ │ │
1078
+ │ │ │ │ # Integration with external protocols (A2A, ACP, AP2, X402, AG-UI, MCP)
1079
+ │ │ │ │ # All map to ontology via metadata.protocol field
1080
+ │ │ │ │
1081
+ │ │ │ ├── a2a.ts # A2A protocol handler (agent-to-agent)
1082
+ │ │ │ ├── acp.ts # ACP protocol handler (commerce REST API)
1083
+ │ │ │ ├── ap2.ts # AP2 protocol handler (payment mandates)
1084
+ │ │ │ ├── x402.ts # X402 protocol handler (HTTP micropayments)
1085
+ │ │ │ ├── ag-ui.ts # AG-UI protocol handler (generative UI)
1086
+ │ │ │ ├── mcp.ts # MCP protocol handler (model context)
1087
+ │ │ │ │
1088
+ │ │ │ ├── ag-ui/ # 🎨 AG-UI PROTOCOL IMPLEMENTATION
1089
+ │ │ │ │ │
1090
+ │ │ │ │ │ # CopilotKit-inspired generative UI protocol
1091
+ │ │ │ │ │ # Agents dynamically generate UI components
1092
+ │ │ │ │ │
1093
+ │ │ │ │ ├── context-manager.ts # Context sharing (app state → agent awareness)
1094
+ │ │ │ │ ├── ui-generator.ts # Dynamic UI generation (charts, forms, etc.)
1095
+ │ │ │ │ ├── action-handler.ts # Human-in-the-loop actions (approvals)
1096
+ │ │ │ │ ├── agent-coordinator.ts # Multi-agent coordination (task delegation)
1097
+ │ │ │ │ └── renderer.ts # Component renderer (React component generation)
1098
+ │ │ │
1099
+ │ │ └── providers/ # 🔌 EXTERNAL PROVIDERS (Effect.ts Wrappers - 26 Total)
1100
+ │ │ │
1101
+ │ │ │ # ═══════════════════════════════════════════════════════════
1102
+ │ │ │ # ALL EXTERNAL SERVICES WRAPPED WITH EFFECT.TS
1103
+ │ │ │ # ═══════════════════════════════════════════════════════════
1104
+ │ │ │ # Every provider follows the same pattern:
1105
+ │ │ │ # 1. Define typed errors (class XError extends Data.TaggedError)
1106
+ │ │ │ # 2. Define service interface (class XService extends Context.Tag)
1107
+ │ │ │ # 3. Implement service layer (XServiceLive = Layer.effect)
1108
+ │ │ │ # 4. Export for dependency injection
1109
+ │ │ │ #
1110
+ │ │ │ # Benefits:
1111
+ │ │ │ # - Type-safe error handling (no try/catch)
1112
+ │ │ │ # - Testable (mock any provider)
1113
+ │ │ │ # - Composable (combine services easily)
1114
+ │ │ │ # - Retries, timeouts, circuit breakers built-in
1115
+ │ │ │ # ═══════════════════════════════════════════════════════════
1116
+ │ │ │
1117
+ │ │ ├── # ═══ AI/LLM PROVIDERS (5) ═══
1118
+ │ │ │
1119
+ │ │ ├── openai.ts # OpenAI (GPT-4o, DALL-E 3, text-embedding-3-small, TTS)
1120
+ │ │ │ # Services: chat, embeddings, images, audio, moderation
1121
+ │ │ │
1122
+ │ │ ├── anthropic.ts # Anthropic (Claude 3.5 Sonnet, 200K context)
1123
+ │ │ │ # Services: chat, tool use, vision, streaming
1124
+ │ │ │
1125
+ │ │ ├── elevenlabs.ts # ElevenLabs (voice cloning, multilingual TTS)
1126
+ │ │ │ # Services: cloneVoice, textToSpeech, voiceLibrary
1127
+ │ │ │
1128
+ │ │ ├── d-id.ts # D-ID (AI video avatars, talking head generation)
1129
+ │ │ │ # Services: createAvatar, generateVideo, streaming
1130
+ │ │ │
1131
+ │ │ ├── heygen.ts # HeyGen (AI video avatars, alternative to D-ID)
1132
+ │ │ │ # Services: createAvatar, generateVideo, templates
1133
+ │ │ │
1134
+ │ │ ├── # ═══ BLOCKCHAIN PROVIDERS (4 - Base L2 Focus) ═══
1135
+ │ │ │
1136
+ │ │ ├── base.ts # Base L2 (Coinbase L2, low fees, EVM compatible)
1137
+ │ │ │ # Services: deployToken, mint, burn, transfer, balanceOf
1138
+ │ │ │
1139
+ │ │ ├── alchemy.ts # Alchemy (Base RPC, indexing, NFT API, webhooks)
1140
+ │ │ │ # Services: getBalance, getTxs, subscribeToAddress
1141
+ │ │ │
1142
+ │ │ ├── uniswap.ts # Uniswap V3 (DEX on Base, swaps, liquidity pools)
1143
+ │ │ │ # Services: swap, addLiquidity, getPrice, getPool
1144
+ │ │ │
1145
+ │ │ ├── wallet-connect.ts # WalletConnect (multi-wallet connection protocol)
1146
+ │ │ │ # Services: connect, sign, sendTransaction
1147
+ │ │ │
1148
+ │ │ ├── # ═══ PAYMENT PROVIDERS (2) ═══
1149
+ │ │ │
1150
+ │ │ ├── stripe.ts # Stripe (FIAT ONLY - USD, EUR, cards, bank transfers)
1151
+ │ │ │ # Services: createPaymentIntent, refund, subscriptions
1152
+ │ │ │
1153
+ │ │ ├── coinbase.ts # Coinbase Commerce (crypto payments, multi-chain)
1154
+ │ │ │ # Services: createCharge, getCharge, webhooks
1155
+ │ │ │
1156
+ │ │ ├── # ═══ COMMUNICATION PROVIDERS (4) ═══
1157
+ │ │ │
1158
+ │ │ ├── resend.ts # Resend (PRIMARY - transactional email, templates)
1159
+ │ │ │ # Services: sendEmail, sendBatch, getDomains
1160
+ │ │ │
1161
+ │ │ ├── sendgrid.ts # SendGrid (FALLBACK - marketing email, A/B tests)
1162
+ │ │ │ # Services: sendEmail, templates, analytics
1163
+ │ │ │
1164
+ │ │ ├── twilio.ts # Twilio (SMS, voice calls, 2FA/OTP, programmable)
1165
+ │ │ │ # Services: sendSMS, makeCall, verify2FA
1166
+ │ │ │
1167
+ │ │ ├── pusher.ts # Pusher (real-time WebSockets, presence, private channels)
1168
+ │ │ │ # Services: trigger, batch, presence, webhooks
1169
+ │ │ │
1170
+ │ │ ├── # ═══ MEDIA/STORAGE PROVIDERS (2) ═══
1171
+ │ │ │
1172
+ │ │ ├── aws.ts # AWS (S3 general storage + CloudFront CDN)
1173
+ │ │ │ # Services: uploadFile, signedUrl, multipart, cdn
1174
+ │ │ │ # Use for: images, videos, audio, documents (NOT livestreaming)
1175
+ │ │ │
1176
+ │ │ ├── cloudflare-stream.ts # Cloudflare Stream (LIVESTREAMING ONLY - RTMP, WebRTC)
1177
+ │ │ │ # Services: createStream, recordStream, webhooks
1178
+ │ │ │ # Use for: live streams ONLY (NOT general storage)
1179
+ │ │ │
1180
+ │ │ ├── # ═══ INTEGRATION PROVIDERS (3) ═══
1181
+ │ │ │
1182
+ │ │ ├── elizaos.ts # ElizaOS (external AI agents via A2A protocol)
1183
+ │ │ │ # Services: registerAgent, sendMessage, subscribe
1184
+ │ │ │
1185
+ │ │ ├── copilotkit.ts # CopilotKit (generative UI patterns, context sharing)
1186
+ │ │ │ # Services: shareContext, generateUI, actions
1187
+ │ │ │
1188
+ │ │ ├── n8n.ts # n8n (workflow automation, API orchestration)
1189
+ │ │ │ # Services: triggerWorkflow, getExecution, webhooks
1190
+ │ │ │
1191
+ │ │ └── # ═══ SOCIAL MEDIA PROVIDERS (6) ═══
1192
+ │ │ │
1193
+ │ │ ├── twitter.ts # Twitter/X API (tweets, threads, media, analytics)
1194
+ │ │ │ # Services: tweet, uploadMedia, getMetrics
1195
+ │ │ │
1196
+ │ │ ├── instagram.ts # Instagram Graph API (posts, stories, reels, insights)
1197
+ │ │ │ # Services: createPost, uploadStory, getInsights
1198
+ │ │ │
1199
+ │ │ ├── youtube.ts # YouTube Data API (videos, playlists, live, comments)
1200
+ │ │ │ # Services: uploadVideo, createPlaylist, getLiveChat
1201
+ │ │ │
1202
+ │ │ ├── tiktok.ts # TikTok API (videos, analytics, user data)
1203
+ │ │ │ # Services: uploadVideo, getAnalytics, getUserInfo
1204
+ │ │ │
1205
+ │ │ ├── linkedin.ts # LinkedIn API (posts, articles, pages, analytics)
1206
+ │ │ │ # Services: createPost, publishArticle, getPageStats
1207
+ │ │ │
1208
+ │ │ └── facebook.ts # Facebook Graph API (page posts, media, ads, insights)
1209
+ │ │ # Services: createPagePost, uploadMedia, getInsights
1210
+ │ │
1211
+ │ ├── mutations/ # 📝 CONVEX MUTATIONS (Thin Wrappers - Write Operations)
1212
+ │ │ │
1213
+ │ │ │ # IMPORTANT: These are THIN WRAPPERS around Effect.ts services
1214
+ │ │ │ # Pattern: validate args → call service → handle errors
1215
+ │ │ │ # NO business logic here - all logic in services/
1216
+ │ │ │
1217
+ │ │ ├── auth.ts # Auth mutations (signup, login, logout, reset password)
1218
+ │ │ ├── creators.ts # Creator mutations (create, update, deactivate)
1219
+ │ │ ├── clone.ts # Clone mutations (create clone, update personality)
1220
+ │ │ ├── content.ts # Content mutations (publish, edit, delete)
1221
+ │ │ ├── tokens.ts # Token mutations (purchase, stake, unstake)
1222
+ │ │ ├── courses.ts # Course mutations (create, publish, enroll)
1223
+ │ │ ├── community.ts # Community mutations (post, comment, react)
1224
+ │ │ ├── connections.ts # Connection mutations (follow, connect, disconnect)
1225
+ │ │ └── elevate.ts # ELEVATE mutations (start journey, complete step)
1226
+ │ │
1227
+ │ ├── queries/ # 🔍 CONVEX QUERIES (Thin Wrappers - Read Operations)
1228
+ │ │ │
1229
+ │ │ │ # IMPORTANT: These are THIN WRAPPERS around Effect.ts services
1230
+ │ │ │ # Pattern: validate args → call service → return data
1231
+ │ │ │ # NO business logic here - all logic in services/
1232
+ │ │ │
1233
+ │ │ ├── auth.ts # Auth queries (getCurrentUser, getSession)
1234
+ │ │ ├── creators.ts # Creator queries (getCreator, listCreators)
1235
+ │ │ ├── clone.ts # Clone queries (getClone, getTrainingStatus)
1236
+ │ │ ├── content.ts # Content queries (getContent, listContent, search)
1237
+ │ │ ├── tokens.ts # Token queries (getBalance, getPrice, getHolders)
1238
+ │ │ ├── courses.ts # Course queries (getCourse, listCourses, getProgress)
1239
+ │ │ ├── community.ts # Community queries (getPosts, getMessages, getThreads)
1240
+ │ │ ├── connections.ts # Connection queries (getFollowers, getConnections)
1241
+ │ │ ├── analytics.ts # Analytics queries (getMetrics, getInsights)
1242
+ │ │ └── search.ts # Search queries (searchAll, searchContent, searchUsers)
1243
+ │ │
1244
+ │ ├── actions/ # ⚡ CONVEX ACTIONS (Thin Wrappers - External Calls)
1245
+ │ │ │
1246
+ │ │ │ # IMPORTANT: These are THIN WRAPPERS around Effect.ts services
1247
+ │ │ │ # Actions can call external APIs (OpenAI, Stripe, blockchain, etc.)
1248
+ │ │ │ # Pattern: validate args → call service → return result
1249
+ │ │ │ # NO business logic here - all logic in services/
1250
+ │ │ │
1251
+ │ │ ├── ai/ # AI actions (external AI API calls)
1252
+ │ │ │ ├── clone-voice.ts # Voice cloning via ElevenLabs
1253
+ │ │ │ ├── clone-appearance.ts # Appearance cloning via D-ID/HeyGen
1254
+ │ │ │ ├── generate-content.ts # Content generation via OpenAI/Anthropic
1255
+ │ │ │ ├── chat.ts # AI chat interactions
1256
+ │ │ │ └── analyze.ts # Content/personality analysis
1257
+ │ │ │
1258
+ │ │ ├── blockchain/ # Blockchain actions (Base L2 interactions)
1259
+ │ │ │ ├── deploy-token.ts # Deploy ERC-20 token contract
1260
+ │ │ │ ├── mint.ts # Mint tokens to address
1261
+ │ │ │ ├── burn.ts # Burn tokens (deflationary)
1262
+ │ │ │ └── transfer.ts # Transfer tokens between addresses
1263
+ │ │ │
1264
+ │ │ ├── payments/ # Payment actions (Stripe, Coinbase)
1265
+ │ │ │ ├── create-checkout.ts # Create payment intent/charge
1266
+ │ │ │ ├── webhook.ts # Handle payment webhooks
1267
+ │ │ │ └── refund.ts # Process refunds
1268
+ │ │ │
1269
+ │ │ └── emails/ # Email actions (Resend, SendGrid)
1270
+ │ │ ├── send-verification.ts # Email verification
1271
+ │ │ ├── send-reset.ts # Password reset
1272
+ │ │ └── send-notification.ts # General notifications
1273
+ │ │
1274
+ │ ├── workflows/ # Long-running workflows
1275
+ │ │ ├── creator-launch.ts # Creator onboard
1276
+ │ │ ├── elevate-journey.ts # ELEVATE flow
1277
+ │ │ ├── content-pipeline.ts # Content gen
1278
+ │ │ ├── token-launch.ts # Token deploy
1279
+ │ │ └── daily-operations.ts # Daily tasks
1280
+ │ │
1281
+ │ ├── crons/ # Scheduled functions
1282
+ │ │ ├── daily-content.ts # Daily content
1283
+ │ │ ├── update-analytics.ts # Analytics
1284
+ │ │ ├── token-economics.ts # Token metrics
1285
+ │ │ └── cleanup.ts # Cleanup
1286
+ │ │
1287
+ │ ├── http/ # HTTP endpoints
1288
+ │ │ ├── webhooks.ts # Webhook handler
1289
+ │ │ └── health.ts # Health check
1290
+ │ │
1291
+ │ ├── lib/ # Backend utilities
1292
+ │ │ ├── errors.ts # Error classes
1293
+ │ │ ├── validators.ts # Validation
1294
+ │ │ └── helpers.ts # Helpers
1295
+ │ │
1296
+ │ ├── # ═══════════════════════════════════════════════════════════════════════
1297
+ │ │ # CURRENT STATE: Existing Files (Already Implemented)
1298
+ │ │ # ═══════════════════════════════════════════════════════════════════════
1299
+ │ │
1300
+ │ ├── schema.ts # ✅ Current schema (6-dimension ontology: entities, connections, events, tags)
1301
+ │ ├── auth.ts # ✅ Better Auth integration (GitHub, Google OAuth, magic link, 2FA)
1302
+ │ ├── auth.config.ts # ✅ Better Auth configuration
1303
+ │ ├── http.ts # ✅ HTTP endpoint handler (Better Auth routes + API endpoints)
1304
+ │ ├── convex.config.ts # ✅ Convex config + Resend component + MCP integration
1305
+ │ ├── README.md # ✅ Convex setup documentation
1306
+ │ ├── tsconfig.json # ✅ TypeScript configuration for Convex backend
1307
+ │ │
1308
+ │ ├── _generated/ # ✅ Auto-generated Convex files (DO NOT EDIT)
1309
+ │ │ ├── api.d.ts # Generated API type definitions (queries, mutations, actions)
1310
+ │ │ ├── api.js # Generated API runtime code
1311
+ │ │ ├── dataModel.d.ts # Generated data model types from schema.ts
1312
+ │ │ └── server.d.ts # Generated server-side types and utilities
1313
+ │ │
1314
+ │ ├── # ═══════════════════════════════════════════════════════════════════════
1315
+ │ │ # API DOCUMENTATION & SPECIFICATIONS
1316
+ │ │ # ═══════════════════════════════════════════════════════════════════════
1317
+ │ │
1318
+ │ ├── docs/ # API documentation (lives in /docs/ directory)
1319
+ │ │ ├── API.md # ✅ Complete API reference (Convex, Effect.ts, integrations)
1320
+ │ │ ├── API-docs.md # ✅ OpenAPI 3.1.0 specification (auto-generated)
1321
+ │ │ ├── AGENTS.md # ✅ Agent development guide (Convex patterns)
1322
+ │ │ ├── Specifications.md # ✅ Protocol specifications (A2A, ACP, AP2, X402, ACPayments, AGUI)
1323
+ │ │ └── Integration-Guides.md # 📋 PLANNED: Integration guides for external services
1324
+ │ │
1325
+ │ ├── # ═══════════════════════════════════════════════════════════════════════
1326
+ │ │ # NEXT STEPS: Implementation Roadmap
1327
+ │ │ # ═══════════════════════════════════════════════════════════════════════
1328
+ │ │ #
1329
+ │ │ # Week 1-2: Foundation
1330
+ │ │ # - Implement schema/ directory (6 dimensions: entities, connections, events, tags)
1331
+ │ │ # - Create ConvexDatabase service (core/database.ts)
1332
+ │ │ # - Create EntityService, ConnectionService, EventService
1333
+ │ │ #
1334
+ │ │ # Week 3-4: Core Services
1335
+ │ │ # - Implement auth service (core/auth.ts)
1336
+ │ │ # - Implement storage service (core/storage.ts)
1337
+ │ │ # - Create basic CRUD mutations/queries
1338
+ │ │ #
1339
+ │ │ # Week 5-8: AI Services
1340
+ │ │ # - Implement OpenAI, Anthropic providers
1341
+ │ │ # - Create AI clone services (ai/clone.ts, ai/voice-clone.ts)
1342
+ │ │ # - Implement RAG service (ai/rag.ts)
1343
+ │ │ #
1344
+ │ │ # Week 9-12: Platform Features
1345
+ │ │ # - Token economy services (tokens/)
1346
+ │ │ # - Course services (courses/)
1347
+ │ │ # - Community services (community/)
1348
+ │ │ # - Business agents (business/)
1349
+ │ │ #
1350
+ │ │ # Week 13-16: Protocols & Integrations
1351
+ │ │ # - Protocol services (protocols/a2a.ts, protocols/acp.ts, etc.)
1352
+ │ │ # - External integrations (ElizaOS, CopilotKit, n8n)
1353
+ │ │ # - Social media providers
1354
+ │ │ #
1355
+ │ │ # Week 17-20: Polish & Scale
1356
+ │ │ # - Performance optimization
1357
+ │ │ # - Testing (unit, integration, e2e)
1358
+ │ │ # - Documentation
1359
+ │ │ # - Deployment
1360
+ │ │ # ═══════════════════════════════════════════════════════════════════════
1361
+ │ │
1362
+ │ ├── components/ # 🧩 CONVEX COMPONENTS INTEGRATION (PLANNED)
1363
+ │ │ ├── # Component Wrappers (Effect.ts services)
1364
+ │ │ ├── agent.wrapper.ts # @convex-dev/agent wrapper
1365
+ │ │ ├── workflow.wrapper.ts # @convex-dev/workflow wrapper
1366
+ │ │ ├── rag.wrapper.ts # @convex-dev/rag wrapper
1367
+ │ │ ├── rate-limiter.wrapper.ts # @convex-dev/rate-limiter wrapper
1368
+ │ │ ├── retrier.wrapper.ts # @convex-dev/action-retrier wrapper
1369
+ │ │ ├── workpool.wrapper.ts # @convex-dev/workpool wrapper
1370
+ │ │ ├── streaming.wrapper.ts # @convex-dev/persistent-text-streaming wrapper
1371
+ │ │ ├── crons.wrapper.ts # @convex-dev/crons wrapper
1372
+ │ │ └── resend.wrapper.ts # @convex-dev/resend wrapper
1373
+ │ │
1374
+ │ ├── confect.ts # Confect setup (optional)
1375
+ │ ├── convex.config.ts # Convex config + components registration
1376
+ │ │
1377
+ │ └── _generated/ # Generated (don't edit)
1378
+ │ ├── api.d.ts # API types
1379
+ │ ├── api.js # API runtime
1380
+ │ ├── dataModel.d.ts # Data model
1381
+ │ └── server.d.ts # Server types
1382
+ │
1383
+ ├── tests/ # TESTS
1384
+ │ ├── unit/ # Unit tests
1385
+ │ │ ├── services/ # Service tests
1386
+ │ │ │ ├── ai-clone.test.ts
1387
+ │ │ │ ├── token.test.ts
1388
+ │ │ │ ├── course.test.ts
1389
+ │ │ │ └── agents.test.ts
1390
+ │ │ │
1391
+ │ │ ├── utils/ # Utility tests
1392
+ │ │ │ ├── validators.test.ts
1393
+ │ │ │ └── helpers.test.ts
1394
+ │ │ │
1395
+ │ │ └── components/ # Component tests
1396
+ │ │ ├── auth.test.tsx
1397
+ │ │ └── tokens.test.tsx
1398
+ │ │
1399
+ │ ├── integration/ # Integration tests
1400
+ │ │ ├── auth-flow.test.ts
1401
+ │ │ ├── token-purchase.test.ts
1402
+ │ │ ├── clone-creation.test.ts
1403
+ │ │ └── content-generation.test.ts
1404
+ │ │
1405
+ │ ├── e2e/ # E2E tests
1406
+ │ │ ├── creator-onboarding.spec.ts
1407
+ │ │ ├── audience-journey.spec.ts
1408
+ │ │ ├── token-flow.spec.ts
1409
+ │ │ └── elevate-journey.spec.ts
1410
+ │ │
1411
+ │ ├── fixtures/ # Test fixtures
1412
+ │ │ ├── creators.ts
1413
+ │ │ ├── content.ts
1414
+ │ │ ├── tokens.ts
1415
+ │ │ └── users.ts
1416
+ │ │
1417
+ │ └── helpers/ # Test helpers
1418
+ │ ├── setup.ts
1419
+ │ ├── mocks.ts
1420
+ │ └── factories.ts
1421
+ │
1422
+ ├── scripts/ # AUTOMATION SCRIPTS
1423
+ │ ├── setup/ # Setup scripts
1424
+ │ │ ├── init-dev.ts # Init dev env
1425
+ │ │ ├── seed-data.ts # Seed data
1426
+ │ │ └── create-admin.ts # Create admin
1427
+ │ │
1428
+ │ ├── migration/ # Migration scripts
1429
+ │ │ ├── inventory-one-ie.md # one.ie inventory
1430
+ │ │ ├── inventory-bullfm.md # bullfm inventory
1431
+ │ │ ├── mappings.md # Data mappings
1432
+ │ │ ├── migrate-one-ie.ts # Migrate one.ie
1433
+ │ │ ├── migrate-bullfm.ts # Migrate bullfm
1434
+ │ │ ├── transform-data.ts # Transform
1435
+ │ │ └── verify-migration.ts # Verify
1436
+ │ │
1437
+ │ ├── deploy/ # Deployment scripts
1438
+ │ │ ├── pre-deploy.ts # Pre-deploy
1439
+ │ │ ├── deploy.ts # Deploy
1440
+ │ │ └── post-deploy.ts # Post-deploy
1441
+ │ │
1442
+ │ └── utils/ # Utility scripts
1443
+ │ ├── backup-db.ts # Backup
1444
+ │ ├── analyze-performance.ts # Performance
1445
+ │ └── generate-types.ts # Generate types
1446
+ │
1447
+ ├── public/ # STATIC ASSETS
1448
+ │ ├── images/
1449
+ │ │ ├── logo.svg
1450
+ │ │ ├── logo-dark.svg
1451
+ │ │ ├── hero.png
1452
+ │ │ └── features/
1453
+ │ │
1454
+ │ ├── icons/
1455
+ │ │ ├── favicon.ico
1456
+ │ │ ├── apple-touch-icon.png
1457
+ │ │ └── manifest-icon-192.png
1458
+ │ │
1459
+ │ └── fonts/
1460
+ │ └── inter/
1461
+ │
1462
+ ├── .vscode/ # VS CODE SETTINGS
1463
+ │ ├── settings.json # Workspace settings
1464
+ │ ├── extensions.json # Extensions
1465
+ │ ├── tasks.json # Tasks
1466
+ │ └── launch.json # Debug config
1467
+ │
1468
+ ├── .github/ # GITHUB
1469
+ │ └── workflows/
1470
+ │ ├── ci.yml # CI pipeline
1471
+ │ ├── deploy.yml # Deploy workflow
1472
+ │ └── tests.yml # Test workflow
1473
+ │
1474
+ ├── astro.config.mjs # Astro config
1475
+ ├── tailwind.config.mjs # Tailwind config
1476
+ ├── tsconfig.json # TypeScript config
1477
+ ├── package.json # Dependencies
1478
+ ├── bun.lockb # Lock file
1479
+ ├── .env.example # Env template
1480
+ ├── .env.local # Local env (gitignored)
1481
+ ├── .gitignore # Git ignore
1482
+ ├── .eslintrc.json # ESLint config
1483
+ ├── .prettierrc # Prettier config
1484
+ ├── vitest.config.ts # Test config
1485
+ └── README.md # Root README
1486
+ ```
1487
+
1488
+ ---
1489
+
1490
+ ## Naming Conventions
1491
+
1492
+ ### Files
1493
+
1494
+ **Components (React):**
1495
+ ```
1496
+ PascalCase.tsx
1497
+ ✅ CreatorProfile.tsx
1498
+ ✅ TokenPurchase.tsx
1499
+ ❌ creatorProfile.tsx
1500
+ ❌ creator-profile.tsx
1501
+ ```
1502
+
1503
+ **Pages (Astro):**
1504
+ ```
1505
+ kebab-case.astro or [param].astro
1506
+ ✅ signin.astro
1507
+ ✅ [username].astro
1508
+ ✅ reset-password.astro
1509
+ ❌ SignIn.astro
1510
+ ❌ resetPassword.astro
1511
+ ```
1512
+
1513
+ **Services (Effect.ts):**
1514
+ ```
1515
+ camelCase.ts
1516
+ ✅ clone.ts
1517
+ ✅ content-generation.ts
1518
+ ✅ token-economics.ts
1519
+ ❌ Clone.ts
1520
+ ❌ contentGeneration.ts
1521
+ ```
1522
+
1523
+ **Mutations/Queries/Actions:**
1524
+ ```
1525
+ camelCase.ts (grouped by domain)
1526
+ ✅ creators.ts
1527
+ ✅ tokens.ts
1528
+ ❌ Creators.ts
1529
+ ❌ creator-mutations.ts (redundant)
1530
+ ```
1531
+
1532
+ **Tests:**
1533
+ ```
1534
+ [name].test.ts or [name].spec.ts
1535
+ ✅ token.test.ts (unit)
1536
+ ✅ token-flow.spec.ts (e2e)
1537
+ ❌ tokenTest.ts
1538
+ ```
1539
+
1540
+ ### Exports
1541
+
1542
+ **Components:**
1543
+ ```typescript
1544
+ // ✅ CORRECT: Named export matching filename
1545
+ export function CreatorProfile() { }
1546
+
1547
+ // ❌ WRONG: Default export or mismatched name
1548
+ export default function Profile() { }
1549
+ ```
1550
+
1551
+ **Services:**
1552
+ ```typescript
1553
+ // ✅ CORRECT: Class with Service suffix
1554
+ export class TokenService extends Effect.Service<TokenService>()
1555
+
1556
+ // ❌ WRONG: No suffix or different name
1557
+ export class Token extends Effect.Service<Token>()
1558
+ ```
1559
+
1560
+ **Mutations/Queries:**
1561
+ ```typescript
1562
+ // ✅ CORRECT: Named export
1563
+ export const create = mutation({ })
1564
+ export const get = query({ })
1565
+
1566
+ // ❌ WRONG: Default export
1567
+ export default mutation({ })
1568
+ ```
1569
+
1570
+ ---
1571
+
1572
+ ## Where Each File Type Goes
1573
+
1574
+ ### Frontend Components
1575
+
1576
+ **shadcn/ui primitives:**
1577
+ ```
1578
+ Location: src/components/ui/[component].tsx
1579
+ Example: src/components/ui/button.tsx
1580
+ Rule: Only shadcn components, no custom logic
1581
+ ```
1582
+
1583
+ **Feature components:**
1584
+ ```
1585
+ Location: src/components/features/[domain]/[Component].tsx
1586
+ Example: src/components/features/tokens/TokenPurchase.tsx
1587
+ Rule: Grouped by domain, one component per file
1588
+ ```
1589
+
1590
+ ### Backend Services
1591
+
1592
+ **Effect.ts services:**
1593
+ ```
1594
+ Location: convex/services/[category]/[service].ts
1595
+ Example: convex/services/ai/clone.ts
1596
+ Rule: Business logic only, pure functions
1597
+ ```
1598
+
1599
+ **Convex functions:**
1600
+ ```
1601
+ Mutations: convex/mutations/[domain].ts
1602
+ Queries: convex/queries/[domain].ts
1603
+ Actions: convex/actions/[category]/[action].ts
1604
+ Rule: Thin wrappers around services
1605
+ ```
1606
+
1607
+ ### Schema
1608
+
1609
+ **Schema files:**
1610
+ ```
1611
+ Location: convex/schema/[table].ts
1612
+ Example: convex/schema/entities.ts
1613
+ Rule: One file per table definition
1614
+ ```
1615
+
1616
+ **Type definitions:**
1617
+ ```
1618
+ Location: convex/schema/types.ts
1619
+ Rule: Property types for entities
1620
+ ```
1621
+
1622
+ ### Tests
1623
+
1624
+ **Unit tests:**
1625
+ ```
1626
+ Location: tests/unit/[category]/[name].test.ts
1627
+ Example: tests/unit/services/token.test.ts
1628
+ Rule: Mirror source structure
1629
+ ```
1630
+
1631
+ **Integration tests:**
1632
+ ```
1633
+ Location: tests/integration/[feature].test.ts
1634
+ Example: tests/integration/token-purchase.test.ts
1635
+ Rule: End-to-end feature flows
1636
+ ```
1637
+
1638
+ **E2E tests:**
1639
+ ```
1640
+ Location: tests/e2e/[flow].spec.ts
1641
+ Example: tests/e2e/creator-onboarding.spec.ts
1642
+ Rule: Full user journeys with Playwright
1643
+ ```
1644
+
1645
+ ### Documentation
1646
+
1647
+ **AI context:**
1648
+ ```
1649
+ Location: .ai/context/[topic].md
1650
+ Rule: For AI agents, technical
1651
+ ```
1652
+
1653
+ **Human docs:**
1654
+ ```
1655
+ Location: docs/[topic].md
1656
+ Rule: For developers, user-friendly
1657
+ ```
1658
+
1659
+ ---
1660
+
1661
+ ## File Creation Checklist
1662
+
1663
+ When creating a new file, verify:
1664
+
1665
+ - [ ] File is in correct directory per this map
1666
+ - [ ] Filename follows naming convention
1667
+ - [ ] Export name matches filename
1668
+ - [ ] Imports use path aliases (@/)
1669
+ - [ ] File is added to this map (if new category)
1670
+ - [ ] Related test file created
1671
+
1672
+ ---
1673
+
1674
+ ## Path Aliases
1675
+
1676
+ ```typescript
1677
+ // Use these in imports:
1678
+ import { Button } from "@/components/ui/button"
1679
+ import { api } from "@/convex/_generated/api"
1680
+ import { useAuth } from "@/lib/hooks"
1681
+
1682
+ // Never use relative paths:
1683
+ import { Button } from "../../../components/ui/button" // ❌ WRONG
1684
+ ```
1685
+
1686
+ **Configured in:**
1687
+ - `tsconfig.json` - TypeScript
1688
+ - `astro.config.mjs` - Astro
1689
+
1690
+ ---
1691
+
1692
+ ## Convex Components Architecture
1693
+
1694
+ ### Official Convex Components Used
1695
+
1696
+ This project uses 9 official Convex components wrapped with Effect.ts for enhanced composition:
1697
+
1698
+ #### 1. @convex-dev/agent
1699
+ ```
1700
+ Location: convex/components/agent.wrapper.ts
1701
+ Purpose: AI agent orchestration with tools, streaming, RAG
1702
+ Features:
1703
+ - Multi-agent conversations
1704
+ - Tool calling
1705
+ - Built-in RAG
1706
+ - Usage tracking
1707
+ - Streaming responses
1708
+ ```
1709
+
1710
+ #### 2. @convex-dev/workflow
1711
+ ```
1712
+ Location: convex/components/workflow.wrapper.ts
1713
+ Purpose: Durable, long-running workflows
1714
+ Features:
1715
+ - Step-by-step execution
1716
+ - Automatic retries
1717
+ - Journaling
1718
+ - Parallel steps
1719
+ - Conditional logic
1720
+ ```
1721
+
1722
+ #### 3. @convex-dev/rag
1723
+ ```
1724
+ Location: convex/components/rag.wrapper.ts
1725
+ Purpose: Retrieval Augmented Generation
1726
+ Features:
1727
+ - Vector embeddings
1728
+ - Semantic search
1729
+ - Chunking
1730
+ - Namespace isolation
1731
+ - Filter support
1732
+ ```
1733
+
1734
+ #### 4. @convex-dev/rate-limiter
1735
+ ```
1736
+ Location: convex/components/rate-limiter.wrapper.ts
1737
+ Purpose: Token bucket & fixed window rate limiting
1738
+ Features:
1739
+ - Per-user limits
1740
+ - Global limits
1741
+ - Token reservation
1742
+ - Sharding support
1743
+ ```
1744
+
1745
+ #### 5. @convex-dev/action-retrier
1746
+ ```
1747
+ Location: convex/components/retrier.wrapper.ts
1748
+ Purpose: Persistent action retries with backoff
1749
+ Features:
1750
+ - Exponential backoff
1751
+ - Status tracking
1752
+ - Completion callbacks
1753
+ - Cancellation
1754
+ ```
1755
+
1756
+ #### 6. @convex-dev/workpool
1757
+ ```
1758
+ Location: convex/components/workpool.wrapper.ts
1759
+ Purpose: Task queue with parallelism control
1760
+ Features:
1761
+ - Concurrent execution limits
1762
+ - Priority queues
1763
+ - Completion callbacks
1764
+ - Status tracking
1765
+ ```
1766
+
1767
+ #### 7. @convex-dev/persistent-text-streaming
1768
+ ```
1769
+ Location: convex/components/streaming.wrapper.ts
1770
+ Purpose: HTTP streaming for LLM responses
1771
+ Features:
1772
+ - Delta storage
1773
+ - WebSocket delivery
1774
+ - Client subscriptions
1775
+ - Backpressure handling
1776
+ ```
1777
+
1778
+ #### 8. @convex-dev/crons
1779
+ ```
1780
+ Location: convex/components/crons.wrapper.ts
1781
+ Purpose: Dynamic cron job scheduling
1782
+ Features:
1783
+ - Dynamic registration
1784
+ - Cron expressions
1785
+ - Interval scheduling
1786
+ - Job management
1787
+ ```
1788
+
1789
+ #### 9. @convex-dev/resend
1790
+ ```
1791
+ Location: convex/components/resend.wrapper.ts
1792
+ Purpose: Email sending via Resend
1793
+ Features:
1794
+ - Email delivery
1795
+ - Status tracking
1796
+ - Event webhooks
1797
+ - Template support
1798
+ ```
1799
+
1800
+ ### Effect.ts Integration Pattern
1801
+
1802
+ All components follow this pattern:
1803
+
1804
+ ```typescript
1805
+ // 1. Define Effect Service
1806
+ class AgentService extends Context.Tag("AgentService")<
1807
+ AgentService,
1808
+ {
1809
+ readonly generateResponse: (...) => Effect.Effect<Result, Error>
1810
+ }
1811
+ >() {}
1812
+
1813
+ // 2. Create Service Layer
1814
+ const AgentServiceLive = Layer.effect(
1815
+ AgentService,
1816
+ Effect.gen(function* () {
1817
+ const agent = new Agent(components.agent, { ... })
1818
+ return {
1819
+ generateResponse: (...) => Effect.tryPromise({ ... })
1820
+ }
1821
+ })
1822
+ )
1823
+
1824
+ // 3. Use in Convex functions
1825
+ export const myAction = action({
1826
+ handler: (ctx, args) =>
1827
+ Effect.gen(function* () {
1828
+ const agentService = yield* AgentService
1829
+ const result = yield* agentService.generateResponse(...)
1830
+ return result
1831
+ }).pipe(
1832
+ Effect.provide(AgentServiceLive),
1833
+ Effect.runPromise
1834
+ )
1835
+ })
1836
+ ```
1837
+
1838
+ ### Confect Integration (Optional)
1839
+
1840
+ For teams fully invested in Effect.ts:
1841
+
1842
+ ```
1843
+ Location: convex/confect.ts
1844
+ Purpose: Native Effect.ts Convex functions
1845
+ Features:
1846
+ - Effect Schema instead of Validators
1847
+ - Option<A> instead of A | null
1848
+ - Effect-native database ops
1849
+ - Full Effect integration
1850
+ ```
1851
+
1852
+ ---
1853
+
1854
+ ## PromptKit & CopilotKit Integration
1855
+
1856
+ ### PromptKit AI Components
1857
+
1858
+ **Purpose:** Production-ready AI/chat UI components built on shadcn/ui
1859
+
1860
+ **Location:** `src/components/prompt-kit/`
1861
+
1862
+ **Key Components:**
1863
+ - **Chat:** message.tsx, prompt-input.tsx, chat-container.tsx, response-stream.tsx
1864
+ - **Agents:** reasoning.tsx, tool.tsx, agent-card.tsx
1865
+ - **Generative UI:** generative-ui-renderer.tsx, dynamic-chart.tsx, dynamic-table.tsx, dynamic-form.tsx
1866
+ - **Context:** context-provider.tsx, context-viewer.tsx
1867
+ - **Actions:** action-trigger.tsx, action-approval.tsx, multi-agent-panel.tsx
1868
+
1869
+ **Installation:**
1870
+ ```bash
1871
+ # Install via shadcn CLI
1872
+ bunx shadcn@latest add "https://www.prompt-kit.com/c/[COMPONENT_NAME].json"
1873
+ ```
1874
+
1875
+ **Features:**
1876
+ - Auto-scrolling chat containers
1877
+ - Auto-resizing text inputs
1878
+ - Streaming response display
1879
+ - Agent reasoning visualization
1880
+ - Function call display
1881
+ - Markdown rendering
1882
+ - Code syntax highlighting
1883
+
1884
+ ### CopilotKit/AG-UI Protocol
1885
+
1886
+ **Purpose:** Agent-to-frontend communication protocol for generative UI
1887
+
1888
+ **Location:** `convex/services/protocols/ag-ui/`
1889
+
1890
+ **Architecture:**
1891
+
1892
+ ```
1893
+ Frontend (PromptKit Components)
1894
+ ↕️ (AG-UI Protocol Messages)
1895
+ Backend (Effect.ts Services)
1896
+ ├── context-manager.ts # Bidirectional context sharing
1897
+ ├── ui-generator.ts # Dynamic UI component generation
1898
+ ├── action-handler.ts # Human-in-the-loop actions
1899
+ ├── agent-coordinator.ts # Multi-agent orchestration
1900
+ └── renderer.ts # Component rendering logic
1901
+ ```
1902
+
1903
+ **Protocol Features:**
1904
+ 1. **Context Sharing** - App state ↔️ Agent awareness
1905
+ 2. **Generative UI** - Agents dynamically create UI components
1906
+ 3. **Human-in-the-Loop** - Action approval/rejection
1907
+ 4. **Multi-Agent** - Coordinate multiple agents
1908
+ 5. **Real-time** - Convex subscriptions for live updates
1909
+
1910
+ **Integration Pattern:**
1911
+
1912
+ ```typescript
1913
+ // Frontend (PromptKit)
1914
+ import { GenerativeUIRenderer } from "@/components/prompt-kit/generative-ui-renderer"
1915
+ import { useQuery } from "convex/react"
1916
+ import { api } from "@/convex/_generated/api"
1917
+
1918
+ export function AIChat() {
1919
+ const messages = useQuery(api.agui.getMessages, { threadId })
1920
+
1921
+ return (
1922
+ <ChatContainer>
1923
+ {messages?.map(msg => (
1924
+ msg.type === "ui" ? (
1925
+ <GenerativeUIRenderer component={msg.component} data={msg.data} />
1926
+ ) : (
1927
+ <Message content={msg.content} />
1928
+ )
1929
+ ))}
1930
+ </ChatContainer>
1931
+ )
1932
+ }
1933
+
1934
+ // Backend (Effect.ts + Convex)
1935
+ export const generateUI = action({
1936
+ handler: (ctx, args) =>
1937
+ Effect.gen(function* () {
1938
+ const aguiService = yield* AGUIService
1939
+
1940
+ // Generate dynamic UI component
1941
+ const uiComponent = yield* aguiService.generateComponent({
1942
+ type: "chart",
1943
+ data: args.chartData,
1944
+ config: { theme: "dark" }
1945
+ })
1946
+
1947
+ // Send to frontend
1948
+ yield* Effect.tryPromise({
1949
+ try: () => ctx.runMutation(api.agui.sendUI, {
1950
+ threadId: args.threadId,
1951
+ component: uiComponent
1952
+ })
1953
+ })
1954
+ }).pipe(Effect.provide(AGUIServiceLive), Effect.runPromise)
1955
+ })
1956
+ ```
1957
+
1958
+ **Documentation:**
1959
+ - `docs/PromptKit.md` - Component usage & examples
1960
+ - `docs/CopilotKit.md` - AG-UI protocol & generative UI patterns
1961
+ - `docs/AGUI.md` - Complete AG-UI protocol specification
1962
+
1963
+ ---
1964
+
1965
+ ## Service Providers Architecture
1966
+
1967
+ ### Overview
1968
+
1969
+ All external service providers are wrapped with **Effect.ts** for type-safe error handling, dependency injection, and composability.
1970
+
1971
+ **Total Providers:** 26
1972
+ - AI/LLM: 5
1973
+ - Blockchain: 4
1974
+ - Payment: 2
1975
+ - Communication: 4
1976
+ - Media/Storage: 2
1977
+ - Integration: 3
1978
+ - Social Media: 6
1979
+
1980
+ ### Effect.ts Pattern
1981
+
1982
+ Every provider follows this pattern:
1983
+
1984
+ ```typescript
1985
+ // 1. Define typed errors
1986
+ export class ProviderError extends Data.TaggedError("ProviderError")<{
1987
+ message: string
1988
+ cause?: unknown
1989
+ }> {}
1990
+
1991
+ // 2. Define service interface
1992
+ export class ProviderService extends Context.Tag("ProviderService")<
1993
+ ProviderService,
1994
+ {
1995
+ readonly operation: (...args) => Effect.Effect<Result, Error>
1996
+ }
1997
+ >() {}
1998
+
1999
+ // 3. Implement service layer
2000
+ export const ProviderServiceLive = Layer.effect(
2001
+ ProviderService,
2002
+ Effect.gen(function* () {
2003
+ const apiKey = process.env.PROVIDER_API_KEY
2004
+ const client = new ProviderSDK({ apiKey })
2005
+
2006
+ return {
2007
+ operation: (...args) =>
2008
+ Effect.tryPromise({
2009
+ try: () => client.doSomething(args),
2010
+ catch: (error) => new ProviderError({ cause: error })
2011
+ })
2012
+ }
2013
+ })
2014
+ )
2015
+ ```
2016
+
2017
+ ### Provider Categories
2018
+
2019
+ #### **1. AI/LLM Providers (5)**
2020
+
2021
+ **OpenAI (`openai.ts`)**
2022
+ - GPT-4 chat completions
2023
+ - DALL-E image generation
2024
+ - Text embeddings (text-embedding-3-small)
2025
+ - Text-to-Speech (TTS)
2026
+ - Function calling
2027
+
2028
+ **Anthropic (`anthropic.ts`)**
2029
+ - Claude 3.5 Sonnet
2030
+ - Long context windows (200K tokens)
2031
+ - Tool use
2032
+ - Vision capabilities
2033
+
2034
+ **ElevenLabs (`elevenlabs.ts`)**
2035
+ - Voice cloning (3+ samples required)
2036
+ - Text-to-Speech
2037
+ - Voice library
2038
+ - Multi-lingual support
2039
+
2040
+ **D-ID (`d-id.ts`)**
2041
+ - AI video avatar creation
2042
+ - Appearance cloning from images
2043
+ - Talking head videos
2044
+ - Real-time streaming
2045
+
2046
+ **HeyGen (`heygen.ts`)**
2047
+ - Alternative AI video avatars
2048
+ - Multi-language support
2049
+ - Custom avatar training
2050
+ - Video generation
2051
+
2052
+ #### **2. Blockchain Providers (4 - Base L2 Focus)**
2053
+
2054
+ **Base (`base.ts`)**
2055
+ - Primary blockchain (Coinbase L2)
2056
+ - Low gas fees
2057
+ - EVM compatible
2058
+ - Token deployment & transfers
2059
+
2060
+ **Alchemy (`alchemy.ts`)**
2061
+ - Base chain RPC provider
2062
+ - Transaction indexing
2063
+ - WebSocket subscriptions
2064
+ - NFT API
2065
+ - Enhanced APIs
2066
+
2067
+ **Uniswap (`uniswap.ts`)**
2068
+ - DEX on Base
2069
+ - Token swaps
2070
+ - Liquidity pools
2071
+ - Price discovery
2072
+ - V3 concentrated liquidity
2073
+
2074
+ **WalletConnect (`wallet-connect.ts`)**
2075
+ - Wallet connection protocol
2076
+ - Multi-wallet support
2077
+ - QR code signing
2078
+ - Session management
2079
+
2080
+ #### **3. Payment Providers (2)**
2081
+
2082
+ **Stripe (`stripe.ts`)**
2083
+ - **Fiat payments ONLY** (USD, cards, bank transfers)
2084
+ - Subscriptions
2085
+ - Invoicing
2086
+ - Payment intents
2087
+ - Webhook handling
2088
+ - Customer portal
2089
+
2090
+ **Coinbase Commerce (`coinbase.ts`)**
2091
+ - Cryptocurrency payments
2092
+ - Multiple chains
2093
+ - Payment tracking
2094
+ - Webhook events
2095
+
2096
+ #### **4. Communication Providers (4)**
2097
+
2098
+ **Resend (`resend.ts`)**
2099
+ - **Primary email provider**
2100
+ - Transactional emails
2101
+ - Email verification
2102
+ - Password reset
2103
+ - Template support
2104
+ - High deliverability
2105
+
2106
+ **SendGrid (`sendgrid.ts`)**
2107
+ - **Alternative email provider**
2108
+ - Marketing emails
2109
+ - Template engine
2110
+ - Analytics
2111
+ - A/B testing
2112
+
2113
+ **Twilio (`twilio.ts`)**
2114
+ - SMS messaging
2115
+ - Voice calls
2116
+ - 2FA/OTP
2117
+ - Programmable messaging
2118
+ - Call recording
2119
+
2120
+ **Pusher (`pusher.ts`)**
2121
+ - Real-time WebSockets
2122
+ - Presence channels
2123
+ - Private channels
2124
+ - Client events
2125
+ - Fallback support
2126
+
2127
+ #### **5. Media/Storage Providers (2)**
2128
+
2129
+ **AWS (`aws.ts`)**
2130
+ - **S3:** General media storage (images, videos, audio, documents)
2131
+ - **CloudFront:** Global CDN for fast delivery
2132
+ - **Signed URLs:** Secure uploads/downloads
2133
+ - **Multipart uploads:** Large file handling
2134
+
2135
+ **Cloudflare Stream (`cloudflare-stream.ts`)**
2136
+ - **Livestreaming ONLY** (not general storage)
2137
+ - RTMP/WebRTC ingestion
2138
+ - Adaptive bitrate streaming
2139
+ - DVR functionality
2140
+ - Real-time analytics
2141
+
2142
+ #### **6. Integration Providers (3)**
2143
+
2144
+ **ElizaOS (`elizaos.ts`)**
2145
+ - External AI agent integration
2146
+ - Agent discovery
2147
+ - Message routing
2148
+ - Plugin system
2149
+ - Multi-agent coordination
2150
+
2151
+ **CopilotKit (`copilotkit.ts`)**
2152
+ - Generative UI patterns
2153
+ - Context sharing
2154
+ - Action system
2155
+ - Component rendering
2156
+
2157
+ **n8n (`n8n.ts`)**
2158
+ - Workflow automation
2159
+ - API orchestration
2160
+ - Data transformation
2161
+ - Scheduled tasks
2162
+ - Webhook triggers
2163
+
2164
+ #### **7. Social Media Providers (6)**
2165
+
2166
+ **Twitter/X (`twitter.ts`)**
2167
+ - Post tweets
2168
+ - Thread creation
2169
+ - Media uploads
2170
+ - Analytics
2171
+ - OAuth authentication
2172
+
2173
+ **Instagram (`instagram.ts`)**
2174
+ - Post images/videos
2175
+ - Stories
2176
+ - Reels
2177
+ - Insights
2178
+ - Graph API
2179
+
2180
+ **YouTube (`youtube.ts`)**
2181
+ - Video uploads
2182
+ - Playlist management
2183
+ - Analytics
2184
+ - Live streaming
2185
+ - Comments
2186
+
2187
+ **TikTok (`tiktok.ts`)**
2188
+ - Video uploads
2189
+ - Analytics
2190
+ - User data
2191
+ - Engagement metrics
2192
+
2193
+ **LinkedIn (`linkedin.ts`)**
2194
+ - Post updates
2195
+ - Article publishing
2196
+ - Company pages
2197
+ - Analytics
2198
+
2199
+ **Facebook (`facebook.ts`)**
2200
+ - Page posts
2201
+ - Media uploads
2202
+ - Insights
2203
+ - Ads API
2204
+
2205
+ ### Architecture Principles
2206
+
2207
+ **1. Media Storage Strategy**
2208
+ - **AWS S3 + CloudFront:** All static media (images, videos, audio, documents)
2209
+ - **Cloudflare Stream:** Livestreaming ONLY (RTMP, WebRTC, adaptive streaming)
2210
+
2211
+ **2. Payment Strategy**
2212
+ - **Stripe:** All fiat payments (USD, credit cards, bank transfers, subscriptions)
2213
+ - **Blockchain:** All crypto payments (token purchases, staking, transfers)
2214
+
2215
+ **3. Multi-Chain Architecture**
2216
+ - Each blockchain has dedicated provider
2217
+ - Unified Effect.ts interface
2218
+ - Easy to add new chains (Sui, Solana, Ethereum mainnet)
2219
+ - Chain-specific optimizations
2220
+
2221
+ **4. Email Strategy**
2222
+ - **Resend:** Primary (transactional emails)
2223
+ - **SendGrid:** Fallback + marketing emails
2224
+ - Automatic failover
2225
+
2226
+ **5. Error Handling**
2227
+ - All providers use typed errors
2228
+ - Retry logic with exponential backoff
2229
+ - Circuit breaker pattern
2230
+ - Fallback providers
2231
+
2232
+ ### Documentation
2233
+
2234
+ - `docs/Service Layer.md` - Effect.ts service architecture
2235
+ - `docs/Service Providers.md` - Original providers (OpenAI, ElevenLabs, Stripe, Blockchain)
2236
+ - `docs/Service Providers - New.md` - New providers (D-ID, HeyGen, Uniswap, Alchemy, Twilio, AWS, Cloudflare)
2237
+
2238
+ ## Special Directories
2239
+
2240
+ ### Don't Edit
2241
+
2242
+ ```
2243
+ convex/_generated/ # Auto-generated by Convex
2244
+ node_modules/ # Dependencies
2245
+ dist/ # Build output
2246
+ .astro/ # Astro cache
2247
+ ```
2248
+
2249
+ ### Don't Commit
2250
+
2251
+ ```
2252
+ .env.local # Local environment
2253
+ .DS_Store # macOS
2254
+ *.log # Log files
2255
+ coverage/ # Test coverage
2256
+ ```
2257
+
2258
+ ---
2259
+
2260
+ ## Migration Notes
2261
+
2262
+ **From one.ie and bullfm:**
2263
+
2264
+ Old structure → New structure mapping:
2265
+
2266
+ ```
2267
+ one.ie/components/Auth/ → src/components/features/auth/
2268
+ one.ie/pages/dashboard/ → src/pages/dashboard.astro
2269
+ one.ie/lib/api/ → convex/mutations/ + queries/
2270
+ one.ie/models/ → convex/schema/
2271
+ one.ie/utils/ → src/lib/
2272
+
2273
+ bullfm/components/ → src/components/features/[domain]/
2274
+ bullfm/api/ → convex/actions/
2275
+ ```
2276
+
2277
+ **Ingestor agent will handle this mapping automatically.**
2278
+
2279
+ ---
2280
+
2281
+ ## Summary
2282
+
2283
+ **Key principles:**
2284
+ 1. Everything has a specific place
2285
+ 2. Naming is consistent and predictable
2286
+ 3. Structure mirrors functionality
2287
+ 4. AI agents know exactly where to put files
2288
+ 5. No ambiguity, no guessing
2289
+
2290
+ **When in doubt:**
2291
+ - Read this file
2292
+ - Find similar existing file
2293
+ - Follow the same pattern
2294
+ - Update this file if creating new structure
2295
+
2296
+ **This map is the source of truth for file locations.**
2297
+
2298
+ ---
2299
+
2300
+ ## Effect.ts Architecture Summary
2301
+
2302
+ ### How Effect.ts Covers the Entire ONE Platform
2303
+
2304
+ The ONE Platform is built on a **pure Effect.ts service layer** that covers 100% of application logic:
2305
+
2306
+ #### 🎯 Coverage Breakdown
2307
+
2308
+ **1. Core Infrastructure (5 services)**
2309
+ - Database operations (CRUD, queries, transactions)
2310
+ - Authentication (Better Auth integration, sessions)
2311
+ - File storage (R2/S3 uploads, signed URLs)
2312
+ - Caching (Redis-like operations)
2313
+ - Job queues (background tasks)
2314
+
2315
+ **2. Platform Features (78 services across 12 domains)**
2316
+ - AI Clone Technology: 12 services
2317
+ - Content Automation: 6 services
2318
+ - Interactive Avatar (Livestream): 5 services
2319
+ - User-Generated Content: 5 services
2320
+ - AI-Powered LMS: 8 services
2321
+ - Living Community: 6 services
2322
+ - Business OS (Analytics): 6 services
2323
+ - Token Economy: 7 services
2324
+ - ELEVATE Journey: 5 services
2325
+ - Viral Mechanisms: 4 services
2326
+ - Business Agents: 11 services (10 C-suite + orchestrator)
2327
+ - Ontology Operations: 3 services (entities, connections, events)
2328
+
2329
+ **3. External Integrations (26 providers)**
2330
+ - AI/LLM: 5 providers (OpenAI, Anthropic, ElevenLabs, D-ID, HeyGen)
2331
+ - Blockchain: 4 providers (Base, Alchemy, Uniswap, WalletConnect)
2332
+ - Payments: 2 providers (Stripe for fiat, Coinbase for crypto)
2333
+ - Communication: 4 providers (Resend, SendGrid, Twilio, Pusher)
2334
+ - Media/Storage: 2 providers (AWS S3, Cloudflare Stream)
2335
+ - Integration: 3 providers (ElizaOS, CopilotKit, n8n)
2336
+ - Social Media: 6 providers (Twitter, Instagram, YouTube, TikTok, LinkedIn, Facebook)
2337
+
2338
+ **4. Protocol Implementations (6 protocols)**
2339
+ - A2A (Agent-to-Agent)
2340
+ - ACP (Agentic Commerce)
2341
+ - AP2 (Agent Payments Protocol)
2342
+ - X402 (HTTP Micropayments)
2343
+ - AG-UI (Generative UI)
2344
+ - MCP (Model Context Protocol)
2345
+
2346
+ **Total Effect.ts Services: 115+**
2347
+ - 5 core infrastructure services
2348
+ - 78 platform feature services
2349
+ - 26 external provider wrappers
2350
+ - 6 protocol implementations
2351
+
2352
+ #### 🏗️ Three-Layer Architecture
2353
+
2354
+ ```
2355
+ ┌─────────────────────────────────────────────────────────┐
2356
+ │ LAYER 1: CONVEX API (Thin Wrappers) │
2357
+ │ - mutations/ (write operations) │
2358
+ │ - queries/ (read operations) │
2359
+ │ - actions/ (external calls) │
2360
+ │ │
2361
+ │ Pattern: validate args → call service → return result │
2362
+ │ NO business logic here │
2363
+ └─────────────────┬───────────────────────────────────────┘
2364
+ │
2365
+ ┌─────────────────▼───────────────────────────────────────┐
2366
+ │ LAYER 2: EFFECT.TS SERVICES (Business Logic) │
2367
+ │ - 100% of application logic lives here │
2368
+ │ - Pure functions (testable, composable) │
2369
+ │ - Typed errors (no exceptions) │
2370
+ │ - Dependency injection │
2371
+ │ - Platform agnostic │
2372
+ │ │
2373
+ │ Pattern: Effect.Service with explicit dependencies │
2374
+ └─────────────────┬───────────────────────────────────────┘
2375
+ │
2376
+ ┌─────────────────▼───────────────────────────────────────┐
2377
+ │ LAYER 3: EXTERNAL PROVIDERS (Effect.ts Wrappers) │
2378
+ │ - 26 external services wrapped with Effect.ts │
2379
+ │ - Type-safe error handling │
2380
+ │ - Automatic retries, timeouts, circuit breakers │
2381
+ │ - Easy to mock for testing │
2382
+ │ │
2383
+ │ Pattern: Context.Tag + Layer.effect │
2384
+ └─────────────────────────────────────────────────────────┘
2385
+ ```
2386
+
2387
+ #### 🎁 Effect.ts Benefits
2388
+
2389
+ **1. Type-Safe Errors**
2390
+ - No try/catch blocks
2391
+ - Every error is typed (e.g., `InsufficientContentError`, `VoiceCloneFailedError`)
2392
+ - Pattern matching on error types
2393
+ - Exhaustive error handling
2394
+
2395
+ **2. Dependency Injection**
2396
+ - Services declare dependencies explicitly
2397
+ - Easy to mock for testing (`MockStripeProvider`, `MockOpenAIProvider`)
2398
+ - Compose services into larger workflows
2399
+ - MainLayer combines all services
2400
+
2401
+ **3. Composability**
2402
+ - Services combine like LEGO blocks
2403
+ - Parallel execution: `Effect.all([...], { concurrency: 5 })`
2404
+ - Sequential execution: `Effect.gen` chaining
2405
+ - Retries, timeouts, circuit breakers built-in
2406
+
2407
+ **4. Platform Agnostic**
2408
+ - Services are pure functions (no Convex-specific code)
2409
+ - Can run in: Convex, Node.js, Cloudflare Workers, Deno, Bun
2410
+ - Easy to migrate if needed
2411
+ - Testable outside of Convex
2412
+
2413
+ **5. Observability**
2414
+ - Built-in logging: `Effect.logInfo`, `Effect.logError`
2415
+ - Tracing: `Effect.withSpan` for distributed tracing
2416
+ - Metrics: Track execution time, errors, retries
2417
+ - Debugging: Full execution trace
2418
+
2419
+ **6. Testability**
2420
+ - Mock any dependency
2421
+ - Test services in isolation
2422
+ - Integration tests compose real services
2423
+ - Property-based testing support
2424
+
2425
+ #### 📊 Current Implementation Status
2426
+
2427
+ **✅ Implemented (Current State)**
2428
+ - Better Auth integration (convex/auth.ts)
2429
+ - Basic schema (convex/schema.ts)
2430
+ - HTTP routes (convex/http.ts)
2431
+ - Convex configuration (convex.config.ts)
2432
+
2433
+ **🚧 In Progress (Planned - 20 Week Roadmap)**
2434
+ - Schema implementation (6 dimensions: entities, connections, events, tags)
2435
+ - Core services (database, auth, storage, cache, queue)
2436
+ - Platform feature services (AI, tokens, courses, community, etc.)
2437
+ - External provider wrappers (26 providers)
2438
+ - Protocol implementations (A2A, ACP, AP2, X402, AG-UI, MCP)
2439
+
2440
+ **📅 Implementation Timeline**
2441
+ - Week 1-2: Foundation (schema + core services)
2442
+ - Week 3-4: Core services (auth, storage, basic CRUD)
2443
+ - Week 5-8: AI services (clone, RAG, content generation)
2444
+ - Week 9-12: Platform features (tokens, courses, community)
2445
+ - Week 13-16: Protocols & integrations
2446
+ - Week 17-20: Polish & scale
2447
+
2448
+ #### 🔑 Key Principles
2449
+
2450
+ 1. **ALL business logic in services/** - 100% Effect.ts, no exceptions
2451
+ 2. **Convex functions are THIN WRAPPERS** - Validate → call service → return
2452
+ 3. **NO business logic in mutations/queries/actions** - Keep them simple
2453
+ 4. **Services are pure, testable, composable** - No side effects
2454
+ 5. **Explicit types everywhere** - No `any`, typed errors with `_tag`
2455
+ 6. **Platform agnostic** - Services can run anywhere
2456
+ 7. **Dependency injection** - Mock any service for testing
2457
+ 8. **Observability first** - Logging, tracing, metrics built-in
2458
+
2459
+ This architecture ensures:
2460
+ - **Consistency**: Same patterns everywhere
2461
+ - **Type Safety**: Compiler catches errors
2462
+ - **Testability**: Pure functions are easy to test
2463
+ - **Composability**: Services combine cleanly
2464
+ - **AI-Friendly**: Explicit patterns AI can learn
2465
+ - **Scalability**: Code quality improves as codebase grows
2466
+
2467
+ ---
2468
+
2469
+ **Last updated:** 2025-01-15
2470
+ **Maintained by:** AI agents + human developers
2471
+ **Update frequency:** Every time new directory created