@powerhousedao/academy 0.1.0-dev.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (226) hide show
  1. package/.vscode/settings.json +3 -0
  2. package/CHANGELOG.md +9 -0
  3. package/Dockerfile +31 -0
  4. package/ProcFile +1 -0
  5. package/README.md +43 -0
  6. package/babel.config.js +3 -0
  7. package/blog/BeyondCommunication-ABlueprintForDevelopment.md +88 -0
  8. package/blog/TheChallengeOfChange.md +86 -0
  9. package/blog/images/Iteration.png +0 -0
  10. package/blog/images/RAD.png +0 -0
  11. package/docs/academy/01-GetStarted/00-GetStarted.mdx +181 -0
  12. package/docs/academy/01-GetStarted/01_InstallDemoPackage.md +38 -0
  13. package/docs/academy/01-GetStarted/02-ToDoList/01-CreateNewPowerhouseProject.md +97 -0
  14. package/docs/academy/01-GetStarted/02-ToDoList/02-DefineToDoListDocumentModel.md +86 -0
  15. package/docs/academy/01-GetStarted/02-ToDoList/03-ImplementOperationReducers.md +201 -0
  16. package/docs/academy/01-GetStarted/02-ToDoList/04-BuildToDoListEditor.md +494 -0
  17. package/docs/academy/01-GetStarted/02-ToDoList/_category_.json +8 -0
  18. package/docs/academy/01-GetStarted/02-ToDoList/images/DocumentModelHeader.png +0 -0
  19. package/docs/academy/01-GetStarted/02-ToDoList/images/DocumentModelOperations.png +0 -0
  20. package/docs/academy/01-GetStarted/02-ToDoList/images/OpenDocumentModelEditor.gif +0 -0
  21. package/docs/academy/01-GetStarted/02-ToDoList/images/completeEditor.png +0 -0
  22. package/docs/academy/01-GetStarted/02-ToDoList/images/connectApp.gif +0 -0
  23. package/docs/academy/01-GetStarted/02-ToDoList/images/form.png +0 -0
  24. package/docs/academy/01-GetStarted/02-ToDoList/images/mytodolist.gif +0 -0
  25. package/docs/academy/01-GetStarted/02-ToDoList/images/reducers.png +0 -0
  26. package/docs/academy/01-GetStarted/02-ToDoList/images/vscode.png +0 -0
  27. package/docs/academy/01-GetStarted/styles.module.css +99 -0
  28. package/docs/academy/02-AdvancedTutorial/01-Create/00-BuilderTools.md +234 -0
  29. package/docs/academy/02-AdvancedTutorial/01-Create/01-SetupBuilderEnvironment.md +247 -0
  30. package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/04-UtilitiesAndTips.md +79 -0
  31. package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/01-SetupBuilderEnvironment.md +216 -0
  32. package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/02-CreateNewPowerhouseProject.md +78 -0
  33. package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/03-DefineChatroomDocumentModel.md +139 -0
  34. package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/04-ImplementOperationReducers.md +364 -0
  35. package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/05-ImplementChatroomEditor.md +194 -0
  36. package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/06-LaunchALocalReactor.md +15 -0
  37. package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/_category_.json +8 -0
  38. package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/image-1.png +0 -0
  39. package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/image-2.png +0 -0
  40. package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/image-3.png +0 -0
  41. package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/image-4.png +0 -0
  42. package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/image-5.png +0 -0
  43. package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/image.png +0 -0
  44. package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/images/ChatRoomConnectApp.gif +0 -0
  45. package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/images/ChatRoomTest.gif +0 -0
  46. package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/images/completeEditor.png +0 -0
  47. package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/images/form.png +0 -0
  48. package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/images/reducers.png +0 -0
  49. package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/images/vscode.png +0 -0
  50. package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/_category_.json +8 -0
  51. package/docs/academy/02-AdvancedTutorial/01-Create/02-StandardDocumentModelWorkflow.md +229 -0
  52. package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/01-BuildingBeautifulDocumentEditors.md +109 -0
  53. package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/02-ConfiguringDrives.md +51 -0
  54. package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/03-BuildingADriveExplorer.md +174 -0
  55. package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/07-DocumentTools/01-OperationHistory.md +67 -0
  56. package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/07-DocumentTools/02-RevisionHistoryTimeline.md +132 -0
  57. package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/07-DocumentTools/_category_.json +7 -0
  58. package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/07-DocumentTools/images/committer-address-popup.png +0 -0
  59. package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/07-DocumentTools/images/revision-hash-popup.png +0 -0
  60. package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/07-DocumentTools/images/revision-history-list.png +0 -0
  61. package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/07-DocumentTools/images/signature-details-popup.png +0 -0
  62. package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/_category_.json +8 -0
  63. package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/images/CreateDrive.png +0 -0
  64. package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/images/mytodolist.gif +0 -0
  65. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/01-ReadingAndWritingThroughTheAPI.mdx +121 -0
  66. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/02-GraphQLAtPowerhouse.md +156 -0
  67. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/03-WorkingWithSubgraphs/02-GraphQLAndSubgraphs.mdx +119 -0
  68. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/03-WorkingWithSubgraphs/03-WorkingWithSubgraphs.md +312 -0
  69. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/03-WorkingWithSubgraphs/_category_.json +8 -0
  70. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/04-analytics-processor.md +342 -0
  71. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/05-AnalyticsProcessorTutorial/01-SetupBuilderEnvironment.md +215 -0
  72. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/05-AnalyticsProcessorTutorial/02-CreateNewPowerhouseProject.md +55 -0
  73. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/05-AnalyticsProcessorTutorial/03-GenerateAnAnalyticsProcessor.md +173 -0
  74. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/05-AnalyticsProcessorTutorial/04-UpdateAnalyticsProcessor.md +223 -0
  75. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/05-AnalyticsProcessorTutorial/_category_.json +8 -0
  76. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/05-AnalyticsProcessorTutorial/images/Create-SPV.gif +0 -0
  77. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/05-AnalyticsProcessorTutorial/images/Create-a-new-asset.png +0 -0
  78. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/05-AnalyticsProcessorTutorial/images/Create-a-transaction.gif +0 -0
  79. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/05-AnalyticsProcessorTutorial/images/Transaction-table.png +0 -0
  80. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/05-AnalyticsProcessorTutorial/images/create-a-new-RWA-document.gif +0 -0
  81. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/05-AnalyticsProcessorTutorial/images/granularity.png +0 -0
  82. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/GraphQL References/QueryingADocumentWithGraphQL.md +244 -0
  83. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/GraphQL References/rwa-reports/listener-raw.png +0 -0
  84. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/GraphQL References/rwa-reports/raw-reports1.png +0 -0
  85. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/GraphQL References/rwa-reports/raw-reports2.png +0 -0
  86. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/GraphQL References/rwa-reports/rwaRegister.png +0 -0
  87. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/apse.png +0 -0
  88. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/best-practices.md +60 -0
  89. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/filter.png +0 -0
  90. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/filteroptions.png +0 -0
  91. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/graphql/index.md +166 -0
  92. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/graphql/integration.md +75 -0
  93. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/dbs.png +0 -0
  94. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/high-level.jpg +0 -0
  95. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/indexeddb.png +0 -0
  96. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/libs-core.jpg +0 -0
  97. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/libs.jpg +0 -0
  98. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/lod.jpg +0 -0
  99. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/logo.png +0 -0
  100. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/navbar.png +0 -0
  101. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/overview-1.jpg +0 -0
  102. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/overview-2.jpg +0 -0
  103. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/overview-3.jpg +0 -0
  104. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/overview-4.jpg +0 -0
  105. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/overview-5.jpg +0 -0
  106. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/overview-6.jpg +0 -0
  107. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/paths-1.jpg +0 -0
  108. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/paths-2.jpg +0 -0
  109. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/intro.md +149 -0
  110. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/typescript/benchmarks.md +27 -0
  111. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/typescript/browser.md +77 -0
  112. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/typescript/compatibility.md +14 -0
  113. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/typescript/index.md +230 -0
  114. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/typescript/memory.md +72 -0
  115. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/typescript/pg.md +63 -0
  116. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/typescript/schema.md +14 -0
  117. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/typescript/utilities.md +102 -0
  118. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/use-cases/index.md +7 -0
  119. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/use-cases/maker.md +652 -0
  120. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/use-cases/processors.md +3 -0
  121. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/_category_.json +8 -0
  122. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/images/OperationHistory.png +0 -0
  123. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/images/OperationsQuery.png +0 -0
  124. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/images/QueryDocumentID.png +0 -0
  125. package/docs/academy/02-AdvancedTutorial/04-WorkWithData/images/SwitchboardButton.png +0 -0
  126. package/docs/academy/02-AdvancedTutorial/05-Launch/00-IntegrateInAFront-End +3 -0
  127. package/docs/academy/02-AdvancedTutorial/05-Launch/01-IntroducingFusion +18 -0
  128. package/docs/academy/02-AdvancedTutorial/05-Launch/02-IntroductionToPackages.md +79 -0
  129. package/docs/academy/02-AdvancedTutorial/05-Launch/02-PublishYourProject.md +230 -0
  130. package/docs/academy/02-AdvancedTutorial/05-Launch/03-RunOnACloudServer.md +279 -0
  131. package/docs/academy/02-AdvancedTutorial/05-Launch/03-SetupEnvironment.md +436 -0
  132. package/docs/academy/02-AdvancedTutorial/05-Launch/04-GraphQLNamespacing +44 -0
  133. package/docs/academy/02-AdvancedTutorial/05-Launch/05-LaunchYourBackend.md +3 -0
  134. package/docs/academy/02-AdvancedTutorial/05-Launch/06-LaunchYourFrontend.md +3 -0
  135. package/docs/academy/02-AdvancedTutorial/05-Launch/_category_.json +8 -0
  136. package/docs/academy/02-AdvancedTutorial/05-Launch/images/SSHConnection.png +0 -0
  137. package/docs/academy/02-AdvancedTutorial/05-Launch/images/homedesign.png +0 -0
  138. package/docs/academy/02-AdvancedTutorial/05-Launch/images/keyconcepts.png +0 -0
  139. package/docs/academy/02-AdvancedTutorial/05-Launch/images/tutorialschema.png +0 -0
  140. package/docs/academy/02-AdvancedTutorial/06-Authorization/Authorization.md +100 -0
  141. package/docs/academy/02-AdvancedTutorial/_category_.json +7 -0
  142. package/docs/academy/03-APIReferences/00-PowerhouseCLI.md +1 -0
  143. package/docs/academy/03-APIReferences/_category_.json +7 -0
  144. package/docs/academy/04-ComponentLibrary/01-PowerhouseDesignSystem.md +94 -0
  145. package/docs/academy/04-ComponentLibrary/02-BuildingWithScalars.md +54 -0
  146. package/docs/academy/04-ComponentLibrary/03-Scalar-Components/01-phid-field.mdx +72 -0
  147. package/docs/academy/04-ComponentLibrary/03-Scalar-Components/02-input-field.mdx +0 -0
  148. package/docs/academy/04-ComponentLibrary/04-Complex-Components/01-sidebar.mdx +36 -0
  149. package/docs/academy/04-ComponentLibrary/05-Layout-Components/01-test-toupdate.mdx +61 -0
  150. package/docs/academy/04-ComponentLibrary/06-Fragments/01-test-toupdate.mdx +61 -0
  151. package/docs/academy/04-ComponentLibrary/_category_.json +8 -0
  152. package/docs/academy/05-Architecture/00-PowerhouseArchitecture.md +50 -0
  153. package/docs/academy/05-Architecture/01-WorkingWithTheReactor.md +48 -0
  154. package/docs/academy/05-Architecture/02-ReferencingMonorepoPackages +65 -0
  155. package/docs/academy/05-Architecture/04-MovingBeyondCRUD +61 -0
  156. package/docs/academy/05-Architecture/05-DocumentModelTheory/01-WhatIsADocumentModel.md +188 -0
  157. package/docs/academy/05-Architecture/05-DocumentModelTheory/02-DAOandDocumentsModelsQ+A.md +177 -0
  158. package/docs/academy/05-Architecture/05-DocumentModelTheory/02-domain-modeling.md +103 -0
  159. package/docs/academy/05-Architecture/05-DocumentModelTheory/03-BenefitsOfDocumentModels.md +95 -0
  160. package/docs/academy/05-Architecture/05-DocumentModelTheory/05-best-practices.md +257 -0
  161. package/docs/academy/05-Architecture/05-DocumentModelTheory/_category_.json +8 -0
  162. package/docs/academy/05-Architecture/05-DocumentModelTheory/three-data-layers.png +0 -0
  163. package/docs/academy/05-Architecture/_category_.json +7 -0
  164. package/docs/academy/05-Architecture/images/image.png +0 -0
  165. package/docs/academy/06-Cookbook.md +905 -0
  166. package/docs/academy/07-Glossary.md +50 -0
  167. package/docs/bookofpowerhouse/01-Overview.md +29 -0
  168. package/docs/bookofpowerhouse/02-GeneralFrameworkAndPhilosophy.md +15 -0
  169. package/docs/bookofpowerhouse/03-PowerhouseSoftwareArchitecture.md +33 -0
  170. package/docs/bookofpowerhouse/04-DevelopmentApproaches.md +36 -0
  171. package/docs/bookofpowerhouse/05-SNOsandANewModelForOSSandPublicGoods.md +73 -0
  172. package/docs/bookofpowerhouse/06-SNOsInActionAndPlatformEconomies.md +17 -0
  173. package/docs/renown/01-intro.md +18 -0
  174. package/docs/renown/02-renown-login-flow.md +60 -0
  175. package/docusaurus +0 -0
  176. package/docusaurus.config.ts +170 -0
  177. package/package.json +50 -0
  178. package/powerhouse-docs@0.0.0 +0 -0
  179. package/sidebars.ts +33 -0
  180. package/src/components/HomepageFeatures/index.tsx +250 -0
  181. package/src/components/HomepageFeatures/styles.module.css +267 -0
  182. package/src/css/custom.css +450 -0
  183. package/src/pages/index.module.css +37 -0
  184. package/src/pages/index.tsx +42 -0
  185. package/src/pages/markdown-page.md +7 -0
  186. package/static/.nojekyll +0 -0
  187. package/static/fonts/FranieBold.otf +0 -0
  188. package/static/fonts/FranieRegular.otf +0 -0
  189. package/static/img/Powerhouse Website Drive.png +0 -0
  190. package/static/img/Powerhouse Website Storage Layer (1).png +0 -0
  191. package/static/img/Powerhouse Website Storage Layer.png +0 -0
  192. package/static/img/Powerhouse-main-light.svg +13 -0
  193. package/static/img/Powerhouse-main.svg +13 -0
  194. package/static/img/Renown Intro Diagram.png +0 -0
  195. package/static/img/Union.svg +3 -0
  196. package/static/img/academy/icons/Advanced.svg +4 -0
  197. package/static/img/academy/icons/Book.svg +5 -0
  198. package/static/img/academy/icons/Cookbook.svg +3 -0
  199. package/static/img/academy/icons/Create.svg +3 -0
  200. package/static/img/academy/icons/Data.svg +3 -0
  201. package/static/img/academy/icons/Editor.svg +3 -0
  202. package/static/img/academy/icons/Flash.svg +3 -0
  203. package/static/img/academy/icons/Launch.svg +3 -0
  204. package/static/img/academy-icon.png +0 -0
  205. package/static/img/connect-icon.png +0 -0
  206. package/static/img/connect.png +0 -0
  207. package/static/img/docusaurus-social-card.jpg +0 -0
  208. package/static/img/docusaurus.png +0 -0
  209. package/static/img/empty-background.png +0 -0
  210. package/static/img/favicon.ico +0 -0
  211. package/static/img/fusion-icon.png +0 -0
  212. package/static/img/fusion.png +0 -0
  213. package/static/img/ph-icon-light.svg +3 -0
  214. package/static/img/powerhouse-layer.png +0 -0
  215. package/static/img/powerhouse-storage-layer.png +0 -0
  216. package/static/img/reactor.png +0 -0
  217. package/static/img/renown-icon.png +0 -0
  218. package/static/img/renown.png +0 -0
  219. package/static/img/switchboard-icon.png +0 -0
  220. package/static/img/switchboard.png +0 -0
  221. package/static/img/undraw_docusaurus_mountain.svg +171 -0
  222. package/static/img/undraw_docusaurus_react.svg +170 -0
  223. package/static/img/undraw_docusaurus_tree.svg +40 -0
  224. package/static/img/video-placeholder.svg +16 -0
  225. package/static.json +7 -0
  226. package/tsconfig.json +7 -0
@@ -0,0 +1,257 @@
1
+ ---
2
+ id: best-practices
3
+ title: Best Practices for Writing Powerhouse Document Models
4
+ description: essential patterns and techniques to help you create robust, maintainable, and efficient document models using the Powerhouse Connect tool.
5
+ slug: /best-practices
6
+ ---
7
+
8
+ ## Introduction
9
+
10
+ Welcome to this tutorial on best practices for writing Powerhouse Document Models. In this guide, we'll walk you through essential patterns and techniques to help you create robust, maintainable, and efficient document models using the Powerhouse Connect tool.
11
+
12
+ ## Why Best Practices Matter
13
+
14
+ Following best practices ensures that your document models are consistent, maintainable, and scalable. It helps you avoid common pitfalls, streamline your development process, and produce high-quality, reliable models that can significantly enhance the functionality and efficiency of its integration within the rest of the Powerhouse tool stack.
15
+
16
+ :::info
17
+ ### Background on Document Models
18
+
19
+ Document Models are structured frameworks that represent and manage business logic and data. They are more than just templates; they define how data is captured, manipulated, and visualized, transforming documents into dynamic, data-rich resources that drive business processes and automation.
20
+ :::
21
+
22
+ ## Best Practices
23
+
24
+ ### General GraphQL Patterns
25
+
26
+ #### Follow Standard GraphQL Conventions
27
+
28
+ When defining your document models, adhere to standard GraphQL conventions. This includes using appropriate naming conventions, structuring your types and queries correctly, and ensuring that your schema is both intuitive and efficient.
29
+
30
+ - **Enum Values in ALL_CAPS:** Use ALL_CAPS for enum values to maintain consistency and clarity.
31
+
32
+ ```graphql
33
+ enum TaskStatus {
34
+ PENDING
35
+ COMPLETED
36
+ IN_PROGRESS
37
+ }
38
+ ```
39
+
40
+
41
+ ### Using Slugs and IDs
42
+
43
+ #### Create Stable, Readable URLs
44
+
45
+ Using slugs and IDs together ensures your URLs are both human-readable and stable. This improves usability and SEO, making it easier to reference and share resources.
46
+
47
+ - **Slugs:** Human-readable strings that uniquely identify a resource.
48
+ - **IDs:** Unique identifiers that remain constant even if the resource name changes.
49
+
50
+ ### Flux Pattern
51
+
52
+ #### Implement Unidirectional Data Flow
53
+
54
+ The Flux pattern is a state management approach that centralizes state updates, ensuring a predictable state flow. This is crucial for debugging and state tracking in complex applications.
55
+
56
+ - **Actions:** Represent the intention to change the state.
57
+ - **Dispatcher:** Central hub that manages all actions.
58
+ - **Stores:** Hold the application state and logic.
59
+ - **Views:** Render the data from stores.
60
+
61
+ ```jsx
62
+ // Example action
63
+ const addAction = {
64
+ type: 'ADD_ITEM',
65
+ payload: newItem
66
+ };
67
+ ```
68
+
69
+
70
+ ### Event Sourcing
71
+
72
+ #### Store Changes as a Sequence of Events
73
+
74
+ Event sourcing involves storing all changes to the application state as events. This allows you to reconstruct past states, audit changes, and implement features like undo functionality.
75
+
76
+ - **Events:** Immutable facts that represent state changes.
77
+ - **Event Store:** Repository for all events.
78
+ - **Event Handlers:** Apply events to update the state.
79
+
80
+ ```jsx
81
+ const itemAddedEvent = {
82
+ type: 'ITEM_ADDED',
83
+ data: {
84
+ id: 1,
85
+ name: 'New Item'
86
+ }
87
+ };
88
+ ```
89
+
90
+
91
+ ### Command Query Responsibility Segregation (CQRS)
92
+
93
+ #### Separate Read and Write Operations
94
+
95
+ CQRS separates the methods for reading and writing data, optimizing performance and scalability. This distinction helps in maintaining clear and distinct command (write) and query (read) models.
96
+
97
+ - **Commands:** Handle write operations (e.g., create, update, delete).
98
+ - **Queries:** Handle read operations (e.g., fetch data).
99
+
100
+ ```graphql
101
+ type Mutation {
102
+ createItem(input: CreateItemInput!): Item!
103
+ }
104
+
105
+ type Query {
106
+ getItem(id: ID!): Item
107
+ }
108
+
109
+ ```
110
+
111
+
112
+ ### Domain Modeling
113
+
114
+ #### Create a Conceptual Model Based on Real-World Domain
115
+
116
+ Domain modeling involves creating a conceptual model that mirrors the real-world domain. This helps in structuring your system around core business logic and rules.
117
+
118
+ - **Entities:** Represent core business objects.
119
+ - **Value Objects:** Objects that describe some aspect of the domain with no identity.
120
+ - **Aggregates:** Clusters of domain objects that are treated as a single unit.
121
+
122
+ ```graphql
123
+ type Order {
124
+ id: ID!
125
+ customer: Customer!
126
+ items: [OrderItem!]!
127
+ }
128
+ ```
129
+
130
+
131
+ ### Root Object Naming
132
+
133
+ #### Use `DocumentModelState` as the Root Object
134
+
135
+ Name your root object `DocumentModelState` to clearly indicate the primary entry point for state management. This consistency makes your model more understandable and maintainable.
136
+
137
+ ```graphql
138
+
139
+ type ExampleModelNameState {
140
+ lists: [LIST]
141
+ exampleObjects: [Examples]
142
+ }
143
+ ```
144
+
145
+ ### Composition vs Aggregation vs Association
146
+
147
+ #### Define Relationships Appropriately
148
+
149
+ - **Composition:** Use when the parent-child relationship is immutable.
150
+ - **Aggregation:** Use when the parent can exist independently.
151
+ - **Association:** Use for flexible relationships without cascading deletes.
152
+
153
+ ### ObjectRef vs ObjectInfo
154
+
155
+ #### Distinguish Between References and Detailed Information
156
+
157
+ - **ObjectRef:** References the unique identifier of an object.
158
+
159
+ ```graphql
160
+ type Order {
161
+ customer: CustomerRef!
162
+ }
163
+ ```
164
+
165
+ - **ObjectInfo:** Contains detailed information about the object.
166
+
167
+ ```graphql
168
+ type Order {
169
+ customer: CustomerInfo!
170
+ }
171
+ ```
172
+
173
+
174
+ ### Reusing State Types as Input Subtypes
175
+
176
+ #### Maintain Consistency and Reduce Redundancy
177
+
178
+ Reuse state types as input subtypes to simplify your codebase and ensure alignment between state representations and input types.
179
+
180
+ ```graphql
181
+ input CreateItemInput {
182
+ name: String!
183
+ description: String
184
+ }
185
+
186
+ type Item {
187
+ name: String!
188
+ description: String
189
+ }
190
+ ```
191
+
192
+ ### Minimal Mandatory Input Fields
193
+
194
+ #### Keep Inputs Optional When Appropriate
195
+
196
+ Make input fields optional when the corresponding state fields are optional or have default values. This practice ensures flexibility and reduces unnecessary complexity.
197
+
198
+ ```graphql
199
+ input UpdateItemInput {
200
+ id: ID!
201
+ name: String
202
+ description: String
203
+ }
204
+ ```
205
+
206
+ ### Array `!` Rules
207
+
208
+ #### Use Mandatory Arrays Appropriately
209
+
210
+ - **Mandatory Inner Elements:** Always use `!` for array element types.
211
+ - **Mandatory Arrays in State:** Use `!` for arrays in the state with a default value of `[]`.
212
+ - **Optional Arrays in Inputs:** Follow the state field with default value rule for input types.
213
+
214
+ ```graphql
215
+ type Order {
216
+ items: [OrderItem!]! # Mandatory array with default value []
217
+ }
218
+ ```
219
+
220
+
221
+ ### Input Type-Specific Fields
222
+
223
+ #### Capture User Intentions Effectively
224
+
225
+ Use specific fields in input types to clearly capture user intentions, such as removing optional state fields or adding contextual information.
226
+
227
+ ```graphql
228
+
229
+ input UpdateStatusInput {
230
+ id: ID!
231
+ status: String!
232
+ comment: String # Contextual field not reflected in the state
233
+ }
234
+ ```
235
+
236
+ ### Object References
237
+
238
+ #### Resolve Object References to Complete Objects in API
239
+
240
+ Ensure that object references in your API resolve to full, complete objects. This practice provides comprehensive data and improves usability.
241
+
242
+ ```graphql
243
+
244
+ // Document Model
245
+ type OwnerType {
246
+ users: [ID!]!
247
+ }
248
+
249
+ // API Implementation
250
+ type OwnerType {
251
+ users: [User!]!
252
+ }
253
+ ```
254
+
255
+ ## Conclusion
256
+
257
+ By following these best practices, you can develop Document Models that are robust, maintainable, and efficient. These guidelines will help you create models that enhance the functionality of your applications, making them more scalable and easier to manage. Happy document modeling!
@@ -0,0 +1,8 @@
1
+ {
2
+ "label": "Document Model Theory",
3
+ "position": 1,
4
+ "link": {
5
+ "type": "generated-index",
6
+ "description": "Intro to Document Models"
7
+ }
8
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "label": "Architecture",
3
+ "link": {
4
+ "type": "generated-index",
5
+ "description": "Learn about the architecture of Powerhouse."
6
+ }
7
+ }