@powerhousedao/academy 0.1.0-dev.3 → 0.1.0-dev.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (189) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +1 -1
  3. package/docs/academy/01-GetStarted/00-ExploreDemoPackage.md +78 -0
  4. package/docs/academy/01-GetStarted/{03-ToDoList/01-CreateNewPowerhouseProject.md → 01-CreateNewPowerhouseProject.md} +10 -8
  5. package/docs/academy/01-GetStarted/02-DefineToDoListDocumentModel.md +97 -0
  6. package/docs/academy/01-GetStarted/{03-ToDoList/03-ImplementOperationReducers.md → 03-ImplementOperationReducers.md} +20 -16
  7. package/docs/academy/01-GetStarted/{03-ToDoList/04-BuildToDoListEditor.md → 04-BuildToDoListEditor.md} +15 -15
  8. package/docs/academy/01-GetStarted/{00-GetStarted.mdx → home.mdx} +41 -52
  9. package/docs/academy/{02-AdvancedTutorial/01-Create/01-SetupBuilderEnvironment.md → 02-MasteryTrack/01-BuilderEnvironment/01-Prerequisites.md} +78 -43
  10. package/docs/academy/02-MasteryTrack/01-BuilderEnvironment/02-StandardDocumentModelWorkflow.md +253 -0
  11. package/docs/academy/{02-AdvancedTutorial/01-Create/00-BuilderTools.md → 02-MasteryTrack/01-BuilderEnvironment/03-BuilderTools.md} +1 -1
  12. package/docs/academy/02-MasteryTrack/01-BuilderEnvironment/_category_.json +7 -0
  13. package/docs/academy/02-MasteryTrack/02-DocumentModelCreation/01-WhatIsADocumentModel.md +188 -0
  14. package/docs/academy/02-MasteryTrack/02-DocumentModelCreation/02-SpecifyTheStateSchema.md +72 -0
  15. package/docs/academy/02-MasteryTrack/02-DocumentModelCreation/03-SpecifyDocumentOperations.md +119 -0
  16. package/docs/academy/02-MasteryTrack/02-DocumentModelCreation/04-UseTheDocumentModelGenerator.md +116 -0
  17. package/docs/academy/02-MasteryTrack/02-DocumentModelCreation/05-ImplementDocumentReducers.md +282 -0
  18. package/docs/academy/02-MasteryTrack/02-DocumentModelCreation/06-ImplementDocumentModelTests.md +277 -0
  19. package/docs/academy/02-MasteryTrack/02-DocumentModelCreation/07-ExampleToDoListRepository.md +1 -0
  20. package/docs/academy/02-MasteryTrack/02-DocumentModelCreation/_category_.json +7 -0
  21. package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/03-BuildingUserExperiences/02-ConfiguringDrives.md +2 -2
  22. package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/03-BuildingUserExperiences/03-BuildingADriveExplorer.md +1 -1
  23. package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/07-DocumentTools/00-DocumentToolbar.md +20 -0
  24. package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/03-BuildingUserExperiences/07-DocumentTools/01-OperationHistory.md +1 -1
  25. package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/01-ReadingAndWritingThroughTheAPI.mdx +2 -2
  26. package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/02-GraphQLAtPowerhouse.md +1 -1
  27. package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/graphql/index.md +1 -1
  28. package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/05-Launch/02-IntroductionToPackages.md +2 -2
  29. package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/05-Launch/03-RunOnACloudServer.md +3 -3
  30. package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/05-Launch/03-SetupEnvironment.md +1 -1
  31. package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/_category_.json +1 -1
  32. package/docs/academy/04-APIReferences/00-PowerhouseCLI.md +740 -0
  33. package/docs/academy/04-APIReferences/01-ReactHooks.md +16 -0
  34. package/docs/academy/04-APIReferences/02-ReactorAPI.md +1 -0
  35. package/docs/academy/04-APIReferences/03-Configuration.md +64 -0
  36. package/docs/academy/{04-ComponentLibrary/01-PowerhouseDesignSystem.md → 06-ComponentLibrary/00-DocumentEngineering.md} +8 -8
  37. package/docs/academy/{04-ComponentLibrary → 06-ComponentLibrary}/02-BuildingWithScalars.md +2 -2
  38. package/docs/academy/{04-ComponentLibrary → 06-ComponentLibrary}/03-Scalar-Components/01-phid-field.mdx +1 -1
  39. package/docs/academy/{06-Cookbook.md → 07-Cookbook.md} +24 -18
  40. package/docs/academy/08-Glossary.md +82 -0
  41. package/docusaurus.config.ts +7 -14
  42. package/package.json +11 -8
  43. package/scripts/generate-combined-cli-docs.ts +80 -0
  44. package/sidebars.ts +100 -14
  45. package/src/components/HomepageFeatures/index.tsx +10 -10
  46. package/src/css/custom.css +11 -0
  47. package/src/pages/{index.tsx → _archive-homepage.tsx} +1 -1
  48. package/src/theme/DocCardList/index.tsx +30 -0
  49. package/static/img/storybook-icon.svg +18 -0
  50. package/docs/academy/01-GetStarted/01-InstallDemoPackage.md +0 -38
  51. package/docs/academy/01-GetStarted/02-LoginWithRenown.md +0 -32
  52. package/docs/academy/01-GetStarted/03-ToDoList/02-DefineToDoListDocumentModel.md +0 -86
  53. package/docs/academy/01-GetStarted/03-ToDoList/_category_.json +0 -8
  54. package/docs/academy/01-GetStarted/_category_.json +0 -3
  55. package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/_category_.json +0 -8
  56. package/docs/academy/02-AdvancedTutorial/01-Create/02-StandardDocumentModelWorkflow.md +0 -229
  57. package/docs/academy/03-APIReferences/00-PowerhouseCLI.md +0 -40
  58. package/docs/academy/03-APIReferences/01-ReactHooks.md +0 -3
  59. package/docs/academy/03-APIReferences/02-ReactorUsage.md +0 -1
  60. package/docs/academy/07-Glossary.md +0 -53
  61. /package/docs/academy/01-GetStarted/{03-ToDoList/images → images}/DocumentModelHeader.png +0 -0
  62. /package/docs/academy/01-GetStarted/{03-ToDoList/images → images}/DocumentModelOperations.png +0 -0
  63. /package/docs/academy/01-GetStarted/{03-ToDoList/images → images}/OpenDocumentModelEditor.gif +0 -0
  64. /package/docs/academy/01-GetStarted/{03-ToDoList/images → images}/completeEditor.png +0 -0
  65. /package/docs/academy/01-GetStarted/{03-ToDoList/images → images}/connectApp.gif +0 -0
  66. /package/docs/academy/01-GetStarted/{03-ToDoList/images → images}/form.png +0 -0
  67. /package/docs/academy/01-GetStarted/{03-ToDoList/images → images}/mytodolist.gif +0 -0
  68. /package/docs/academy/01-GetStarted/{03-ToDoList/images → images}/reducers.png +0 -0
  69. /package/docs/academy/01-GetStarted/{03-ToDoList/images → images}/vscode.png +0 -0
  70. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/03-BuildingUserExperiences/01-BuildingBeautifulDocumentEditors.md +0 -0
  71. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/03-BuildingUserExperiences/07-DocumentTools/02-RevisionHistoryTimeline.md +0 -0
  72. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/03-BuildingUserExperiences/07-DocumentTools/_category_.json +0 -0
  73. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/03-BuildingUserExperiences/07-DocumentTools/images/committer-address-popup.png +0 -0
  74. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/03-BuildingUserExperiences/07-DocumentTools/images/revision-hash-popup.png +0 -0
  75. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/03-BuildingUserExperiences/07-DocumentTools/images/revision-history-list.png +0 -0
  76. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/03-BuildingUserExperiences/07-DocumentTools/images/signature-details-popup.png +0 -0
  77. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/03-BuildingUserExperiences/08-Authorization/01-RenownAuthenticationFlow.md +0 -0
  78. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/03-BuildingUserExperiences/08-Authorization/02-Authorization.md +0 -0
  79. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/03-BuildingUserExperiences/08-Authorization/_category_.json +0 -0
  80. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/03-BuildingUserExperiences/08-Authorization/images/ConnectAddress.png +0 -0
  81. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/03-BuildingUserExperiences/08-Authorization/images/LoginComplete.png +0 -0
  82. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/03-BuildingUserExperiences/08-Authorization/images/OperationsHistory.png +0 -0
  83. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/03-BuildingUserExperiences/08-Authorization/images/RenownLogin.png +0 -0
  84. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/03-BuildingUserExperiences/08-Authorization/images/ReturnToConnect.png +0 -0
  85. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/03-BuildingUserExperiences/_category_.json +0 -0
  86. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/03-BuildingUserExperiences/images/CreateDrive.png +0 -0
  87. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/03-BuildingUserExperiences/images/CreateNewDrive.png +0 -0
  88. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/03-BuildingUserExperiences/images/mytodolist.gif +0 -0
  89. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/03-WorkingWithSubgraphs/02-GraphQLAndSubgraphs.mdx +0 -0
  90. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/03-WorkingWithSubgraphs/03-WorkingWithSubgraphs.md +0 -0
  91. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/03-WorkingWithSubgraphs/_category_.json +0 -0
  92. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/04-analytics-processor.md +0 -0
  93. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/05-AnalyticsProcessorTutorial/01-SetupBuilderEnvironment.md +0 -0
  94. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/05-AnalyticsProcessorTutorial/02-CreateNewPowerhouseProject.md +0 -0
  95. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/05-AnalyticsProcessorTutorial/03-GenerateAnAnalyticsProcessor.md +0 -0
  96. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/05-AnalyticsProcessorTutorial/04-UpdateAnalyticsProcessor.md +0 -0
  97. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/05-AnalyticsProcessorTutorial/_category_.json +0 -0
  98. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/05-AnalyticsProcessorTutorial/images/Create-SPV.gif +0 -0
  99. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/05-AnalyticsProcessorTutorial/images/Create-a-new-asset.png +0 -0
  100. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/05-AnalyticsProcessorTutorial/images/Create-a-transaction.gif +0 -0
  101. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/05-AnalyticsProcessorTutorial/images/Transaction-table.png +0 -0
  102. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/05-AnalyticsProcessorTutorial/images/create-a-new-RWA-document.gif +0 -0
  103. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/05-AnalyticsProcessorTutorial/images/granularity.png +0 -0
  104. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/GraphQL References/QueryingADocumentWithGraphQL.md +0 -0
  105. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/GraphQL References/rwa-reports/listener-raw.png +0 -0
  106. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/GraphQL References/rwa-reports/raw-reports1.png +0 -0
  107. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/GraphQL References/rwa-reports/raw-reports2.png +0 -0
  108. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/GraphQL References/rwa-reports/rwaRegister.png +0 -0
  109. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/apse.png +0 -0
  110. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/best-practices.md +0 -0
  111. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/filter.png +0 -0
  112. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/filteroptions.png +0 -0
  113. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/graphql/integration.md +0 -0
  114. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/images/dbs.png +0 -0
  115. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/images/high-level.jpg +0 -0
  116. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/images/indexeddb.png +0 -0
  117. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/images/libs-core.jpg +0 -0
  118. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/images/libs.jpg +0 -0
  119. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/images/lod.jpg +0 -0
  120. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/images/logo.png +0 -0
  121. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/images/navbar.png +0 -0
  122. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/images/overview-1.jpg +0 -0
  123. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/images/overview-2.jpg +0 -0
  124. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/images/overview-3.jpg +0 -0
  125. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/images/overview-4.jpg +0 -0
  126. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/images/overview-5.jpg +0 -0
  127. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/images/overview-6.jpg +0 -0
  128. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/images/paths-1.jpg +0 -0
  129. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/images/paths-2.jpg +0 -0
  130. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/intro.md +0 -0
  131. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/typescript/benchmarks.md +0 -0
  132. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/typescript/browser.md +0 -0
  133. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/typescript/compatibility.md +0 -0
  134. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/typescript/index.md +0 -0
  135. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/typescript/memory.md +0 -0
  136. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/typescript/pg.md +0 -0
  137. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/typescript/schema.md +0 -0
  138. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/typescript/utilities.md +0 -0
  139. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/use-cases/index.md +0 -0
  140. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/use-cases/maker.md +0 -0
  141. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/06-Analytics Engine/use-cases/processors.md +0 -0
  142. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/_category_.json +0 -0
  143. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/images/OperationHistory.png +0 -0
  144. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/images/OperationsQuery.png +0 -0
  145. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/images/QueryDocumentID.png +0 -0
  146. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/04-WorkWithData/images/SwitchboardButton.png +0 -0
  147. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/05-Launch/00-IntegrateInAFront-End +0 -0
  148. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/05-Launch/01-IntroducingFusion +0 -0
  149. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/05-Launch/02-PublishYourProject.md +0 -0
  150. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/05-Launch/04-GraphQLNamespacing +0 -0
  151. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/05-Launch/05-LaunchYourBackend.md +0 -0
  152. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/05-Launch/06-LaunchYourFrontend.md +0 -0
  153. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/05-Launch/_category_.json +0 -0
  154. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/05-Launch/images/SSHConnection.png +0 -0
  155. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/05-Launch/images/homedesign.png +0 -0
  156. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/05-Launch/images/keyconcepts.png +0 -0
  157. /package/docs/academy/{02-AdvancedTutorial → 02-MasteryTrack}/05-Launch/images/tutorialschema.png +0 -0
  158. /package/docs/academy/{02-AdvancedTutorial/01-Create/02-MoreTutorials → 03-ExampleUsecases}/Chatroom/01-SetupBuilderEnvironment.md +0 -0
  159. /package/docs/academy/{02-AdvancedTutorial/01-Create/02-MoreTutorials → 03-ExampleUsecases}/Chatroom/02-CreateNewPowerhouseProject.md +0 -0
  160. /package/docs/academy/{02-AdvancedTutorial/01-Create/02-MoreTutorials → 03-ExampleUsecases}/Chatroom/03-DefineChatroomDocumentModel.md +0 -0
  161. /package/docs/academy/{02-AdvancedTutorial/01-Create/02-MoreTutorials → 03-ExampleUsecases}/Chatroom/04-ImplementOperationReducers.md +0 -0
  162. /package/docs/academy/{02-AdvancedTutorial/01-Create/02-MoreTutorials → 03-ExampleUsecases}/Chatroom/05-ImplementChatroomEditor.md +0 -0
  163. /package/docs/academy/{02-AdvancedTutorial/01-Create/02-MoreTutorials → 03-ExampleUsecases}/Chatroom/06-LaunchALocalReactor.md +0 -0
  164. /package/docs/academy/{02-AdvancedTutorial/01-Create/02-MoreTutorials → 03-ExampleUsecases}/Chatroom/_category_.json +0 -0
  165. /package/docs/academy/{02-AdvancedTutorial/01-Create/02-MoreTutorials → 03-ExampleUsecases}/Chatroom/image-1.png +0 -0
  166. /package/docs/academy/{02-AdvancedTutorial/01-Create/02-MoreTutorials → 03-ExampleUsecases}/Chatroom/image-2.png +0 -0
  167. /package/docs/academy/{02-AdvancedTutorial/01-Create/02-MoreTutorials → 03-ExampleUsecases}/Chatroom/image-3.png +0 -0
  168. /package/docs/academy/{02-AdvancedTutorial/01-Create/02-MoreTutorials → 03-ExampleUsecases}/Chatroom/image-4.png +0 -0
  169. /package/docs/academy/{02-AdvancedTutorial/01-Create/02-MoreTutorials → 03-ExampleUsecases}/Chatroom/image-5.png +0 -0
  170. /package/docs/academy/{02-AdvancedTutorial/01-Create/02-MoreTutorials → 03-ExampleUsecases}/Chatroom/image.png +0 -0
  171. /package/docs/academy/{02-AdvancedTutorial/01-Create/02-MoreTutorials → 03-ExampleUsecases}/Chatroom/images/ChatRoomConnectApp.gif +0 -0
  172. /package/docs/academy/{02-AdvancedTutorial/01-Create/02-MoreTutorials → 03-ExampleUsecases}/Chatroom/images/ChatRoomTest.gif +0 -0
  173. /package/docs/academy/{02-AdvancedTutorial/01-Create/02-MoreTutorials → 03-ExampleUsecases}/Chatroom/images/completeEditor.png +0 -0
  174. /package/docs/academy/{02-AdvancedTutorial/01-Create/02-MoreTutorials → 03-ExampleUsecases}/Chatroom/images/form.png +0 -0
  175. /package/docs/academy/{02-AdvancedTutorial/01-Create/02-MoreTutorials → 03-ExampleUsecases}/Chatroom/images/reducers.png +0 -0
  176. /package/docs/academy/{02-AdvancedTutorial/01-Create/02-MoreTutorials → 03-ExampleUsecases}/Chatroom/images/vscode.png +0 -0
  177. /package/docs/academy/{03-APIReferences → 04-APIReferences}/_category_.json +0 -0
  178. /package/docs/academy/05-Architecture/05-DocumentModelTheory/{01-WhatIsADocumentModel.md → 01-WhatIsADocumentModel} +0 -0
  179. /package/docs/academy/05-Architecture/05-DocumentModelTheory/{02-DAOandDocumentsModelsQ+A.md → 02-DAOandDocumentsModelsQ+A} +0 -0
  180. /package/docs/academy/05-Architecture/05-DocumentModelTheory/{02-domain-modeling.md → 02-domain-modeling} +0 -0
  181. /package/docs/academy/05-Architecture/05-DocumentModelTheory/{03-BenefitsOfDocumentModels.md → 03-BenefitsOfDocumentModels} +0 -0
  182. /package/docs/academy/{02-AdvancedTutorial/01-Create/02-MoreTutorials/04-UtilitiesAndTips.md → 05-Architecture/05-DocumentModelTheory/04-UtilitiesAndTips} +0 -0
  183. /package/docs/academy/05-Architecture/05-DocumentModelTheory/{05-best-practices.md → 05-best-practices} +0 -0
  184. /package/docs/academy/{04-ComponentLibrary/00-StorybookLink → 06-ComponentLibrary/01-StorybookLink} +0 -0
  185. /package/docs/academy/{04-ComponentLibrary → 06-ComponentLibrary}/03-Scalar-Components/02-input-field.mdx +0 -0
  186. /package/docs/academy/{04-ComponentLibrary → 06-ComponentLibrary}/04-Complex-Components/01-sidebar.mdx +0 -0
  187. /package/docs/academy/{04-ComponentLibrary → 06-ComponentLibrary}/05-Layout-Components/01-test-toupdate.mdx +0 -0
  188. /package/docs/academy/{04-ComponentLibrary → 06-ComponentLibrary}/06-Fragments/01-test-toupdate.mdx +0 -0
  189. /package/docs/academy/{04-ComponentLibrary → 06-ComponentLibrary}/_category_.json +0 -0
@@ -1,43 +1,10 @@
1
- # Setup Builder Environment
1
+ # Prerequisites
2
2
 
3
3
  Let's set up your machine to start building your first Document Model. Don't worry if this is your first time setting up a development environment - we'll guide you through each step!
4
4
 
5
5
  :::info
6
- If you've already set up Git, Node, and pnpm, your most important step is to install the Powerhouse CLI with the command `pnpm install ph-cmd`. A global install is recommended if you want to use the command from any directory as a power user. In this case use `pnpm install -g ph-cmd`. The Powerhouse CLI is used to create, build, and run your Document Models and gives you direct access to a series of [Powerhouse Builder Tools](../Create/BuilderTools)
6
+ If you've already set up **Git, Node, and pnpm**, your most important step is to install the **Powerhouse CLI** with the command: `pnpm install ph-cmd`. A global install is recommended if you want to use the command from any directory as a power user. In this case use `pnpm install -g ph-cmd`. The Powerhouse CLI is used to create, build, and run your Document Models and gives you direct access to a series of Powerhouse Builder Tools. Move to the end of this page to [verify your installation.](#verify-installation)
7
7
  :::
8
-
9
- The Powerhouse CLI (`ph-cmd`) is a command-line interface tool that provides essential commands for managing Powerhouse projects. You can get access to the Powerhouse Ecosystem tools by installing them globally using:
10
- ```bash
11
- pnpm install -g ph-cmd
12
- ```
13
-
14
- Key commands include:
15
- - `ph connect` for running the Connect application locally
16
- - `ph switchboard` or `ph reactor` for starting the API service
17
- - `ph init` to start a new project and build a document model
18
- - `ph help` to get an overview of all the available commands
19
-
20
- This tool will be fundamental on your journey when creating, building, and running Document Models.
21
-
22
- <details>
23
- <summary> How to make use of different branches? </summary>
24
-
25
- When installing or using the Powerhouse CLI commands you are able to make use of the dev & staging branches. These branches contain more experimental features then the latest stable release the PH CLI uses by default. They can be used to get access to a bugfix or features under development.
26
-
27
- | Command | Description |
28
- |---------|-------------|
29
- | **pnpm install -g ph-cmd** | Install latest stable version |
30
- | **pnpm install -g ph-cmd@dev** | Install development version |
31
- | **pnpm install -g ph-cmd@staging** | Install staging version |
32
- | **ph init** | Use latest stable version of the boilerplate |
33
- | **ph init --dev** | Use development version of the boilerplate |
34
- | **ph init --staging** | Use staging version of the boilerplate |
35
- | **ph use** | Switch all dependencies to latest production versions |
36
- | **ph use dev** | Switch all dependencies to development versions |
37
- | **ph use prod** | Switch all dependencies to production versions |
38
-
39
- Please be aware that these versions can contain bugs and experimental features that aren't fully tested.
40
- </details>
41
8
  ___
42
9
 
43
10
  ## Table of Contents
@@ -55,11 +22,17 @@ ___
55
22
  - [For macOS](#for-macos-2)
56
23
  - [For Linux (Ubuntu/Debian)](#for-linux-ubuntudebian-2)
57
24
  - [Configure Git](#configure-git-all-systems)
25
+ - [Install Powerhouse CLI](#install-powerhouse-cli)
58
26
  - [Verify Installation](#verify-installation)
59
27
 
60
- ## Prerequisites
28
+ ## Overview
29
+
30
+ Before we begin building our Document Model, we need to install some software on your machine. We'll need three main tools:
31
+ - Node.js 22, which helps us run our code.
32
+ - Visual Studio Code (VS Code), which is where we'll write our code
33
+ - Git, which helps us manage our code.
61
34
 
62
- Before we begin building our Document Model, we need to install some software on your machine. We'll need three main tools: node.js 22, which helps us run our code, Visual Studio Code (VS Code), which is where we'll write our code, and Git, which helps us manage our code. Follow the steps below based on your computer's operating system.
35
+ Follow the steps below based on your computer's operating system.
63
36
 
64
37
  ### Installing node.js 22
65
38
 
@@ -83,14 +56,21 @@ node.js 22 is a tool that lets us run our application. Let's install it step by
83
56
  - Once the installer downloads, double-click it to start installation
84
57
  - Click "Next" through the installation wizard, leaving all settings at their defaults
85
58
 
86
- 3. **Verify Installation:**
59
+ 3. **Install pnpm:**
60
+ - Open PowerShell (no need for admin mode)
61
+ - Type this command and press Enter:
62
+ ```powershell
63
+ npm install -g pnpm
64
+ ```
65
+
66
+ 4. **Verify Installation:**
87
67
  - Open PowerShell (no need for admin mode)
88
68
  - Type these commands one at a time and press Enter after each:
89
69
  ```powershell
90
70
  node --version
91
71
  pnpm --version
92
72
  ```
93
- - You should see version numbers appear after each command (e.g., v18.17.0). If you do, congratulations - node.js 22 is installed!
73
+ - You should see version numbers appear after each command (e.g., v18.17.0). If you do, congratulations - Node.js and pnpm are installed!
94
74
 
95
75
  > **Note**: If node.js 22 commands don't work in VS Code, restart VS Code to refresh environment variables.
96
76
 
@@ -106,7 +86,11 @@ node.js 22 is a tool that lets us run our application. Let's install it step by
106
86
  2. **Install node.js 22:**
107
87
  - In the same Terminal window, type this command and press Enter:
108
88
  ```bash
109
- brew install node
89
+ brew install node@22
90
+ ```
91
+ - Then, install pnpm:
92
+ ```bash
93
+ brew install pnpm
110
94
  ```
111
95
 
112
96
  3. **Verify Installation:**
@@ -115,7 +99,7 @@ node.js 22 is a tool that lets us run our application. Let's install it step by
115
99
  node --version
116
100
  pnpm --version
117
101
  ```
118
- - If you see version numbers, you've successfully installed node.js 22!
102
+ - If you see version numbers, you've successfully installed Node.js and pnpm!
119
103
 
120
104
  #### For Linux (Ubuntu/Debian):
121
105
  1. **Open Terminal:**
@@ -163,7 +147,7 @@ VS Code is the editor we'll use to write our code. Here's how to install it:
163
147
  6. To make VS Code available in your terminal:
164
148
  - Open VS Code
165
149
  - Press Command + Shift + P
166
- - Type "shell command" and select "Install 'code' command in PATH"
150
+ - Type "shell command" and select "Shell Command: Install 'code' command in PATH"
167
151
 
168
152
  #### For Linux (Ubuntu/Debian):
169
153
  1. Open Terminal (Ctrl + Alt + T)
@@ -235,6 +219,41 @@ git config --global user.name "Your Name"
235
219
  git config --global user.email "your.email@example.com"
236
220
  ```
237
221
 
222
+ ### Install the Powerhouse CLI
223
+
224
+ The Powerhouse CLI (installed via the `ph-cmd` package) is a command-line interface tool. It provides the `ph` command, which is essential for managing Powerhouse projects. You can get access to the Powerhouse Ecosystem tools by installing them globally using:
225
+ ```bash
226
+ pnpm install -g ph-cmd
227
+ ```
228
+
229
+ Key commands include:
230
+ - `ph connect` for running the Connect application locally
231
+ - `ph switchboard` or `ph reactor` for starting the API service
232
+ - `ph init` to start a new project and build a document model
233
+ - `ph help` to get an overview of all the available commands
234
+
235
+ This tool will be fundamental on your journey when creating, building, and running Document Models.
236
+
237
+ <details>
238
+ <summary> How to use different branches? </summary>
239
+
240
+ When installing or using the Powerhouse CLI commands you can use the dev & staging branches. These branches contain more experimental features than the latest stable release the PH CLI uses by default. They can be used to get access to a bug fix or features under development.
241
+
242
+ | Command | Description |
243
+ |---------|-------------|
244
+ | **pnpm install -g ph-cmd** | Install latest stable version |
245
+ | **pnpm install -g ph-cmd@dev** | Install development version |
246
+ | **pnpm install -g ph-cmd@staging** | Install staging version |
247
+ | **ph init** | Use latest stable version of the boilerplate |
248
+ | **ph init --dev** | Use development version of the boilerplate |
249
+ | **ph init --staging** | Use staging version of the boilerplate |
250
+ | **ph use** | Switch all dependencies to latest production versions |
251
+ | **ph use dev** | Switch all dependencies to development versions |
252
+ | **ph use prod** | Switch all dependencies to production versions |
253
+
254
+ Please be aware that these versions can contain bugs and experimental features that aren't fully tested.
255
+ </details>
256
+
238
257
  ### Verify Installation
239
258
 
240
259
  Open your terminal (command prompt) and run the following commands to verify your setup:
@@ -242,6 +261,22 @@ Open your terminal (command prompt) and run the following commands to verify you
242
261
  node --version
243
262
  pnpm --version
244
263
  git --version
264
+ ph --version
265
+ ```
266
+
267
+ You should see version numbers displayed for all commands, similar to the example output below (your versions might be higher). The output for `ph --version` includes its version and may also show additional messages if further setup like `ph setup-globals` is needed.
268
+ You're now ready to start building your first Document Model!
269
+
270
+ ```bash
271
+ % node --version
272
+ v22.16.0
273
+ % pnpm --version
274
+ 10.10.0
275
+ % git --version
276
+ git version 2.39.3
277
+ % ph --version
278
+ PH CMD version: 0.43.18
279
+ -------------------------------------
280
+ PH CLI is not available, please run `ph setup-globals` to generate the default global project
245
281
  ```
246
282
 
247
- You should see version numbers displayed for all commands. You're now ready to start building your first Document Model!
@@ -0,0 +1,253 @@
1
+ # Creating Powerhouse packages
2
+
3
+ This tutorial guides you through creating a Powerhouse Document Model, from initial setup to publishing a distributable package. We'll leverage the Powerhouse CLI and Connect Studio Mode for a streamlined development experience.
4
+
5
+ <details>
6
+ <summary>Key Commands</summary>
7
+
8
+ - `pnpm install -g ph-cmd`: Installs the Powerhouse CLI globally.
9
+ - `ph init`: Initializes a new Powerhouse project or sets up the local environment.
10
+ - `ph connect`: Runs Connect in Studio Mode for local development and testing.
11
+ - `ph generate <YourModelName.phdm.zip>`: Generates scaffolding code from an exported document model specification.
12
+ - `ph generate --editor YourModelName --document-types powerhouse/YourModelName`: Generates an editor template for a document model.
13
+ - `pnpm build`: Builds the project for production.
14
+ - `pnpm run test`: Runs unit tests.
15
+ - `npm login`: Logs into your NPM account.
16
+ - `npm publish`: Publishes your package to NPM.
17
+ - `ph install @your-org-ph/your-package-name`: Installs a published package into a local Powerhouse environment.
18
+
19
+ </details>
20
+
21
+ ## Phase 1: Setup and Initialization
22
+
23
+ ### 1.1. Install Powerhouse CLI
24
+ Ensure you have the Powerhouse Command Line Interface (`ph-cmd`) installed. This tool is crucial for managing your Powerhouse projects.
25
+ ```bash
26
+ pnpm install -g ph-cmd
27
+ ```
28
+ :::info
29
+ Refer to the [Prerequisites](/academy/MasteryTrack/BuilderEnvironment/StandardDocumentModelWorkflow) guide for detailed installation instructions for Node.js, pnpm, and Git if you haven't set them up yet.
30
+ :::
31
+
32
+ ### 1.2. Initialize Your Project Environment
33
+ Before creating a specific project, or if you're setting up your environment for the first time to use Connect Studio Mode, initialize the Powerhouse environment. This command prepares your local setup, including a local Reactor configuration.
34
+ ```bash
35
+ ph init
36
+ ```
37
+ If you are starting a new project to be packaged, this command will also prompt you for a project name. This name will be used for your package.
38
+
39
+ <details>
40
+ <summary> How to make use of different branches? </summary>
41
+
42
+ When installing or using the Powerhouse CLI commands you are able to make use of the dev & staging branches. These branches contain more experimental features then the latest stable release the PH CLI uses by default. They can be used to get access to a bugfix or features under development.
43
+
44
+ | Command | Description |
45
+ |---------|-------------|
46
+ | **pnpm install -g ph-cmd** | Install latest stable version |
47
+ | **pnpm install -g ph-cmd@dev** | Install development version |
48
+ | **pnpm install -g ph-cmd@staging** | Install staging version |
49
+ | **ph init** | Use latest stable version of the boilerplate |
50
+ | **ph init --dev** | Use development version of the boilerplate |
51
+ | **ph init --staging** | Use staging version of the boilerplate |
52
+ | **ph use** | Switch all dependencies to latest production versions |
53
+ | **ph use dev** | Switch all dependencies to development versions |
54
+ | **ph use prod** | Switch all dependencies to production versions |
55
+
56
+ Please be aware that these versions can contain bugs and experimental features that aren't fully tested.
57
+ </details>
58
+
59
+ ### 1.3. Launch Connect in Studio Mode
60
+ Connect is your local development hub. Running it in Studio Mode spins up a local instance with a local Reactor, allowing you to define, build, and test document models.
61
+ ```bash
62
+ ph connect
63
+ ```
64
+ This command typically opens Connect in your browser at `http://localhost:3000/`.
65
+
66
+ :::info
67
+ **Powerhouse Reactors** are essential nodes in the Powerhouse network. They store documents, manage versions, resolve conflicts, and verify document operation histories by rerunning them. Reactors can be configured for local storage (as in Studio Mode), centralized cloud storage, or decentralized storage networks.
68
+ :::
69
+
70
+ ## Phase 2: Document Model Specification
71
+
72
+ ### 2.1. Define the Document Model Schema
73
+ Within Connect Studio Mode, navigate to the Document Model Editor. Here, you'll specify the structure of your document model using GraphQL Schema Definition Language (SDL).
74
+ - **State Schema:** Describes the data fields and types within your document (e.g., `ToDoItem` with `id`, `text`, `checked` fields).
75
+ - This schema is the blueprint for your document model's data.
76
+
77
+ ### 2.2. Define Document Model Operations
78
+ In the same editor, specify the operations (state transitions) for your document model. These are also defined using GraphQL, specifically input types.
79
+ - **Operations Schema:** Specifies the actions that can be performed on the document (e.g., `AddTodoItemInput`, `UpdateTodoItemInput`, `DeleteTodoItemInput`).
80
+ - Each input type details the parameters required for an operation.
81
+ - **Best Practices:**
82
+ * Clearly define operations (often aligning with CRUD principles).
83
+ * Use GraphQL input types for operation parameters.
84
+ * Ensure operations reflect user intent for a clean API.
85
+
86
+ ### 2.3. Export Document Model Specification
87
+ Once your schema and operations are defined in Connect, export the specification. This will download a `.phdm.zip` file (e.g., `YourModelName.phdm.zip`). Save this file in the root of your Powerhouse project directory.
88
+
89
+ ## Phase 3: Implementation and Testing
90
+
91
+ ### 3.1. Generate Scaffolding Code
92
+ Use the Powerhouse CLI to process the exported `.phdm.zip` file and generate the necessary boilerplate code for your document model.
93
+ ```bash
94
+ ph generate YourModelName.phdm.zip
95
+ ```
96
+ This command creates a new directory under `document-models/YourModelName/` containing:
97
+ - A JSON file with the document model specification.
98
+ - A GraphQL file with the state and operation schemas.
99
+ - A `gen/` folder with autogenerated TypeScript types, action creators, and utility functions based on your schema.
100
+ - A `src/` folder where you'll implement your custom logic (reducers, utils).
101
+
102
+ ### 3.2. Implement Reducer Logic
103
+ Reducers are pure functions that implement the state transition logic for each operation defined in your schema. Navigate to `document-models/YourModelName/src/reducers/to-do-list.ts` (or similar, based on your model name).
104
+ - Implement the functions for each operation (e.g., `addTodoItemOperation`, `updateTodoItemOperation`).
105
+ - These functions take the current state and an action (containing input data) and return the new state.
106
+ - Powerhouse handles immutability behind the scenes.
107
+
108
+ ### 3.3. Write Unit Tests for Reducers
109
+ It's crucial to test your reducer logic. Write unit tests in the `document-models/YourModelName/src/reducers/tests/` directory.
110
+ - Verify that each operation correctly transforms the document state.
111
+ - Use the auto-generated action creators from the `gen/` folder to create operation actions for your tests.
112
+ Run tests using:
113
+ ```bash
114
+ pnpm run test
115
+ ```
116
+
117
+ ### 3.4. Implement the Document Editor
118
+ A document editor provides the user interface for interacting with your document model in Connect. Generate an editor template:
119
+ ```bash
120
+ ph generate --editor YourModelName --document-types powerhouse/YourModelName
121
+ ```
122
+ - The `--editor YourModelName` flag specifies the document model this editor is for.
123
+ - The `--document-types powerhouse/YourModelName` flag links the editor to the specific document type defined in your model specification (ensure this matches what you set in Connect).
124
+
125
+ This creates a template file, typically at `editors/your-model-name/editor.tsx`.
126
+ - Customize this React component to build your UI.
127
+ - You can use standard HTML, Tailwind CSS (available in Connect), or import custom CSS.
128
+ - Utilize components from `@powerhousedao/document-engineering` for consistency and rapid development. @Callmet Reference back to document engineering
129
+
130
+
131
+ ### 3.5. Test the Editor
132
+ Run Connect locally to see your editor in action:
133
+ ```bash
134
+ ph connect
135
+ ```
136
+ Create a new document of your defined type. Interact with your editor, test all functionalities, and ensure it correctly dispatches actions to the reducers and reflects state changes.
137
+
138
+ ## Phase 4: Packaging and Publishing
139
+
140
+ Once your document model and editor are implemented and tested, you can package them for distribution. A Powerhouse Package is a modular unit that can group document models, editors, scripts, and processors.
141
+
142
+ ### 4.1. Prepare Project for Packaging
143
+ If you didn't initialize your project with `ph init` intending it as a package, ensure your project structure is set up correctly. The `ph init` command is designed to create this structure.
144
+ - `document-models/`: Contains your document models.
145
+ - `editors/`: Contains your editor components.
146
+ - `src/`: Often used for shared utilities or can be part of the model/editor structure.
147
+ - (Optional) `processors/`, `scripts/` for advanced functionalities.
148
+
149
+ ### 4.2. Specify Package Details in `package.json`
150
+ Navigate to the `package.json` file in your project root. This file is crucial for NPM publishing.
151
+ - **`name`**: Follow a scoped naming convention, e.g., `@your-org-ph/your-package-name`. The `-ph` suffix helps identify Powerhouse ecosystem packages.
152
+ - **`version`**: Use semantic versioning (e.g., `1.0.0`).
153
+ - **`author`**: Your name or organization.
154
+ - **`license`**: e.g., `AGPL-3.0-only`.
155
+ - **`main`**: The entry point of your package (e.g., `index.js` or `dist/index.js`).
156
+ - **`publishConfig`**: For scoped packages intended to be public, add:
157
+ ```json
158
+ "publishConfig": {
159
+ "access": "public"
160
+ }
161
+ ```
162
+
163
+ Example `package.json` snippet:
164
+ ```json
165
+ {
166
+ "name": "@your-org-ph/your-package-name",
167
+ "version": "1.0.0",
168
+ "author": "Your Name",
169
+ "license": "AGPL-3.0-only",
170
+ "main": "index.js",
171
+ "files": [ // Ensure your build output and necessary files are included
172
+ "dist",
173
+ "manifest.json",
174
+ "document-models",
175
+ "editors"
176
+ ],
177
+ "publishConfig": {
178
+ "access": "public"
179
+ }
180
+ }
181
+ ```
182
+
183
+ ### 4.3. Add a Manifest File (`manifest.json`)
184
+ Create a `manifest.json` file in your project root. This file describes your package's contents (document models, editors) and helps host applications like Connect understand and integrate your package.
185
+
186
+ Example `manifest.json`:
187
+ ```json
188
+ {
189
+ "name": "@yourorg-ph/your-package-name", // it's recommended to use an organization-specific NPM account (e.g., `yourorg-ph`).
190
+ "description": "A brief description of your package and its document models.",
191
+ "category": "your-category", // e.g., "Finance", "People Ops", "Legal"
192
+ "publisher": {
193
+ "name": "your-publisher-name", // Your organization or name
194
+ "url": "your-publisher-url" // Link to your website or repository
195
+ },
196
+ "documentModels": [
197
+ {
198
+ "id": "powerhouse/YourModelName", // Document type string as defined in Connect
199
+ "name": "YourModelName" // Human-readable name
200
+ }
201
+ ],
202
+ "editors": [
203
+ {
204
+ "id": "your-editor-id", // A unique ID for the editor component
205
+ "name": "YourModelName Editor", // Human-readable name
206
+ "documentTypes": ["powerhouse/YourModelName"] // Links editor to document type(s)
207
+ }
208
+ ]
209
+ }
210
+ ```
211
+ Update your project's main `index.js` or entry point to export your document models and editors so they can be discovered by Powerhouse applications.
212
+
213
+ ### 4.4. Build Your Project
214
+ Compile and optimize your project for production:
215
+ ```bash
216
+ pnpm build
217
+ ```
218
+ This command typically creates a `dist/` or `build/` directory with the compiled assets. Ensure your `package.json`'s `files` array includes this directory and other necessary assets like `manifest.json`, `document-models`, and `editors` if they are not part of the build output but need to be in the package.
219
+
220
+ ### 4.5. Version Control
221
+ Store your project in a Git repository for versioning and collaboration.
222
+ ```bash
223
+ git init
224
+ git add .
225
+ git commit -m "Initial commit of document model package"
226
+ # git remote add origin <your-remote-repository-url>
227
+ # git push -u origin main
228
+ ```
229
+
230
+ ### 4.6. Publish to NPM
231
+ To share your package with others or deploy it to different environments, publish it to the NPM registry.
232
+
233
+ 1. **Login to NPM:**
234
+ If you haven't already, log into your NPM account. It's recommended to use an organization-specific NPM account (e.g., `yourorg-ph`).
235
+ ```bash
236
+ npm login
237
+ ```
238
+ Follow the prompts in your terminal or browser.
239
+
240
+ 2. **Publish the Package:**
241
+ ```bash
242
+ npm publish
243
+ ```
244
+ If your package is scoped and public, NPM will use the `publishConfig` from your `package.json`. If not set there, you might need `npm publish --access public`.
245
+
246
+ ### 4.7. Using Your Published Package
247
+ Once published, your package can be installed and used in any Powerhouse environment (like another local Connect instance or a deployed Reactor setup).
248
+ ```bash
249
+ ph install @your-org-ph/your-package-name
250
+ ```
251
+ This command makes the document models and editors defined in your package available within that Powerhouse instance.
252
+
253
+ Congratulations! You've successfully created, packaged, and published a Powerhouse Document Model. This enables modularity, reusability, and collaboration within the Powerhouse ecosystem.
@@ -178,7 +178,7 @@ The Powerhouse Design System is a collection of reusable front-end components ba
178
178
  - Automatic inclusion as a dependency in new Document Model projects
179
179
  - Customization options using CSS variables
180
180
 
181
- Read more about the [design system here](/docs/academy/ComponentLibrary/PowerhouseDesignSystem)
181
+ We cover some of these topics in our design system documentation. Read more about the [design system here](/academy/ComponentLibrary/DocumentEngineering)
182
182
 
183
183
  ## Reactor Libraries
184
184
  ___
@@ -0,0 +1,7 @@
1
+ {
2
+ "label": "Builder Environment",
3
+ "link": {
4
+ "type": "doc",
5
+ "id": "academy/MasteryTrack/BuilderEnvironment/Prerequisites"
6
+ }
7
+ }
@@ -0,0 +1,188 @@
1
+ # What is a Document Model?
2
+
3
+ A Document Model is:
4
+ - A structured software framework that represents and **manages business logic** within a digital environment.
5
+ - A sophisticated template that **encapsulates the essential aspects of a digital process or a set of data**.
6
+ - A blueprints that define how data is **captured, manipulated, and visualised** within a system.
7
+ - A **standardized way to store, modify, and query data** in scalable, decentralized applications.
8
+
9
+ ### **How does a document model function?**
10
+
11
+ #### **Structure and Composition**
12
+
13
+ Each document model consists of three key components:
14
+
15
+ 1. **State Schema** – Defines the structure of the document.
16
+ 2. **Document Operations** – Defines how the document can be modified.
17
+ 3. **Event History** – Maintains an append-only log of changes.
18
+
19
+ Document models leverage **event sourcing, CQRS (Command Query Responsibility Segregation), and an append-only architecture** to ensure immutability, auditability, and scalability.
20
+
21
+ ---
22
+
23
+ ## **1. Structure of a Document Model**
24
+
25
+ A document model consists of the following key components:
26
+
27
+ ### **1.1 State Schema**
28
+
29
+ The **state schema** defines the structure of the document, including its fields and data types. It serves as a blueprint for how data is stored and validated.
30
+
31
+ Example of a **GraphQL-like state schema** for an invoice document:
32
+
33
+ ```graphql
34
+ type InvoiceState {
35
+ id: OID! # Unique identifier for the invoice
36
+ issuer: OID! # Reference to the issuing entity
37
+ recipient: OID! # Reference to the recipient entity
38
+ status: String @default(value: "DRAFT") # Invoice status
39
+ dueDate: DateTime # Payment due date
40
+ lineItems: [LineItem!]! # List of line items
41
+ totalAmount: Currency # Computed field for total invoice value
42
+ }
43
+
44
+ type LineItem {
45
+ id: OID!
46
+ description: String
47
+ quantity: Int @default(value: 1)
48
+ unitPrice: Currency
49
+ }
50
+ ```
51
+
52
+ ### **State Schema Features:**
53
+
54
+ - Uses **GraphQL-like definitions** for a **clear, structured schema**.
55
+ - Supports **custom scalar types** like `OID`, `Currency`, and `DateTime`. Or other Web3 specific scalars
56
+ - Allows **default values** using `@default(value: "DRAFT")`.
57
+ - Defines **relationships** using object references (`OID!`).
58
+
59
+ The state schema acts as a **template** for document instances. Every new invoice created will follow this structure.
60
+
61
+ ---
62
+
63
+ ### **1.2 Document Operations**
64
+
65
+ Document models are **append-only**, meaning changes are not made directly to the document state. Instead, **document operations** define valid state transitions.
66
+
67
+ Example operations for modifying an invoice:
68
+
69
+ ```graphql
70
+ input AddLineItemInput {
71
+ invoiceId: OID!
72
+ description: String
73
+ quantity: Int @default(value: 1)
74
+ unitPrice: Currency
75
+ }
76
+
77
+ input UpdateRecipientInput {
78
+ invoiceId: OID!
79
+ newRecipient: OID!
80
+ }
81
+
82
+ input MarkAsPaidInput {
83
+ invoiceId: OID!
84
+ }
85
+ ```
86
+
87
+ Each operation **modifies the document state** without altering past data. Instead, a new event is appended to the document history.
88
+
89
+ ---
90
+
91
+ ### **1.3 Event History (Append-Only Log)**
92
+
93
+ Every operation applied to a document is **stored as an event** in an append-only log.
94
+
95
+ #### **Example event log for an invoice document:**
96
+
97
+ ```json
98
+ [
99
+ { "timestamp": 1700000001, "operation": "CREATE_INVOICE", "data": { "id": "inv-001", "issuer": "company-123", "recipient": "client-456" } },
100
+ { "timestamp": 1700000100, "operation": "ADD_LINE_ITEM", "data": { "description": "Software Development", "quantity": 10, "unitPrice": 100 } },
101
+ { "timestamp": 1700000200, "operation": "MARK_AS_PAID", "data": {}
102
+ ```
103
+
104
+ ### **Event History Benefits:**
105
+
106
+ - Provides a **transparent audit trail** of changes.
107
+ - Enables **time travel debugging** by reconstructing past states.
108
+ - Supports **event sourcing**, allowing developers to **replay events** to restore state.
109
+
110
+ ---
111
+
112
+ ## **2. How Document Models Work Technically**
113
+
114
+ Document models in Powerhouse rely on **event-driven architecture, event sourcing, and CQRS principles**. Here’s a step-by-step breakdown:
115
+
116
+ ### **2.1 Document Creation**
117
+
118
+ 1. A user (or system) **submits an operation** to create a new document.
119
+ 2. The document model **validates** the input data against the state schema.
120
+ 3. The system **appends the operation** as an event in the document history.
121
+ 4. The **initial state is computed** by applying the recorded events.
122
+
123
+ **Example:**
124
+
125
+ ```json
126
+ {
127
+ "operation": "CREATE_INVOICE",
128
+ "data": { "id": "inv-001", "issuer": "company-123", "recipient": "client-456" }
129
+ }
130
+ ```
131
+
132
+ ---
133
+
134
+ ### **2.2 Document Modification**
135
+
136
+ 1. A user submits an **operation** (e.g., `ADD_LINE_ITEM`).
137
+ 2. The **event is appended** to the document history.
138
+ 3. The **state transition logic updates the computed state**.
139
+ 4. The UI re-renders the updated document.
140
+
141
+ **Example:**
142
+ Adding a line item:
143
+
144
+ ```json
145
+ {
146
+ "operation": "ADD_LINE_ITEM",
147
+ "data": { "description": "Software Development", "quantity": 10, "unitPrice": 100 }
148
+ }
149
+ ```
150
+
151
+ Since changes are **not applied directly**, this model is **highly scalable and auditable**.
152
+
153
+ ---
154
+
155
+ ### **2.3 Querying Document Models**
156
+
157
+ Powerhouse uses **GraphQL queries** to fetch document states efficiently. Because documents store structured data, developers can instantly query:
158
+
159
+ ```graphql
160
+ query {
161
+ invoice(id: "inv-001") {
162
+ issuer
163
+ recipient
164
+ status
165
+ lineItems {
166
+ description
167
+ quantity
168
+ unitPrice
169
+ }
170
+ }
171
+ }
172
+ ```
173
+
174
+ This removes the need for **complex database joins** and allows for **fast, structured access to data**.
175
+
176
+ ---
177
+
178
+ ### **What do document models unlock?**
179
+
180
+ Document Models offer a range of features that can be leveraged to create sophisticated, automated, and data-driven solutions:
181
+
182
+ - **API Integration**: Document Models can be integrated with Switchboard API or external APIs, allowing for the exchange of data between Connect and other systems or services.
183
+
184
+ - **Data Analysi**s**: The structured nature of Document Models makes them ideal for data analysis and reporting. Users can extract insights and generate reports based on the data captured within the models which is accessible through read models. (Operational data + Analytics data which takes into account time series of the data).
185
+
186
+ - **Version Control**: Similar to how Git manages changes to source code, Document Models in Connect will support version control, enabling users to track changes, compare different versions, and ensure data integrity over time.
187
+
188
+ Document Models are a powerful primitive within the Powerhouse vision, offering a flexible, structured, and efficient way to manage business logic and data.