@powerhousedao/academy 5.0.0-staging.1 → 5.0.0-staging.11
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.
- package/.vscode/settings.json +1 -1
- package/CHANGELOG.md +64 -0
- package/README.md +3 -3
- package/babel.config.js +1 -1
- package/blog/BeyondCommunication-ABlueprintForDevelopment.md +25 -24
- package/blog/TheChallengeOfChange.md +21 -21
- package/docs/academy/01-GetStarted/00-ExploreDemoPackage.mdx +61 -24
- package/docs/academy/01-GetStarted/01-CreateNewPowerhouseProject.md +21 -12
- package/docs/academy/01-GetStarted/02-DefineToDoListDocumentModel.md +24 -19
- package/docs/academy/01-GetStarted/03-ImplementOperationReducers.md +44 -41
- package/docs/academy/01-GetStarted/04-BuildToDoListEditor.md +10 -10
- package/docs/academy/01-GetStarted/05-SpecDrivenAI.md +143 -0
- package/docs/academy/01-GetStarted/home.mdx +185 -90
- package/docs/academy/01-GetStarted/styles.module.css +5 -5
- package/docs/academy/02-MasteryTrack/01-BuilderEnvironment/01-Prerequisites.md +46 -18
- package/docs/academy/02-MasteryTrack/01-BuilderEnvironment/02-StandardDocumentModelWorkflow.md +118 -68
- package/docs/academy/02-MasteryTrack/01-BuilderEnvironment/03-BuilderTools.md +75 -33
- package/docs/academy/02-MasteryTrack/01-BuilderEnvironment/_category_.json +6 -6
- package/docs/academy/02-MasteryTrack/02-DocumentModelCreation/01-WhatIsADocumentModel.md +30 -21
- package/docs/academy/02-MasteryTrack/02-DocumentModelCreation/02-SpecifyTheStateSchema.md +41 -37
- package/docs/academy/02-MasteryTrack/02-DocumentModelCreation/03-SpecifyDocumentOperations.md +29 -25
- package/docs/academy/02-MasteryTrack/02-DocumentModelCreation/04-UseTheDocumentModelGenerator.md +36 -37
- package/docs/academy/02-MasteryTrack/02-DocumentModelCreation/05-ImplementDocumentReducers.md +128 -109
- package/docs/academy/02-MasteryTrack/02-DocumentModelCreation/06-ImplementDocumentModelTests.md +95 -86
- package/docs/academy/02-MasteryTrack/02-DocumentModelCreation/07-ExampleToDoListRepository.md +7 -9
- package/docs/academy/02-MasteryTrack/02-DocumentModelCreation/_category_.json +6 -6
- package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/01-BuildingDocumentEditors.md +65 -47
- package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/02-ConfiguringDrives.md +77 -62
- package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/03-BuildingADriveExplorer.md +360 -349
- package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/06-DocumentTools/00-DocumentToolbar.mdx +16 -10
- package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/06-DocumentTools/01-OperationHistory.md +10 -7
- package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/06-DocumentTools/02-RevisionHistoryTimeline.md +26 -11
- package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/06-DocumentTools/_category_.json +6 -6
- package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/07-Authorization/01-RenownAuthenticationFlow.md +14 -7
- package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/07-Authorization/02-Authorization.md +0 -1
- package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/07-Authorization/_category_.json +5 -5
- package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/_category_.json +1 -1
- package/docs/academy/02-MasteryTrack/04-WorkWithData/01-GraphQLAtPowerhouse.md +45 -33
- package/docs/academy/02-MasteryTrack/04-WorkWithData/02-UsingTheAPI.mdx +61 -18
- package/docs/academy/02-MasteryTrack/04-WorkWithData/03-UsingSubgraphs.md +50 -54
- package/docs/academy/02-MasteryTrack/04-WorkWithData/04-analytics-processor.md +126 -110
- package/docs/academy/02-MasteryTrack/04-WorkWithData/05-RelationalDbProcessor.md +75 -45
- package/docs/academy/02-MasteryTrack/04-WorkWithData/06-Analytics Engine/GraphQL References/QueryingADocumentWithGraphQL.md +23 -21
- package/docs/academy/02-MasteryTrack/04-WorkWithData/06-Analytics Engine/best-practices.md +9 -9
- package/docs/academy/02-MasteryTrack/04-WorkWithData/06-Analytics Engine/graphql/index.md +11 -23
- package/docs/academy/02-MasteryTrack/04-WorkWithData/06-Analytics Engine/graphql/integration.md +25 -9
- package/docs/academy/02-MasteryTrack/04-WorkWithData/06-Analytics Engine/intro.md +10 -10
- package/docs/academy/02-MasteryTrack/04-WorkWithData/06-Analytics Engine/typescript/benchmarks.md +1 -1
- package/docs/academy/02-MasteryTrack/04-WorkWithData/06-Analytics Engine/typescript/index.md +16 -11
- package/docs/academy/02-MasteryTrack/04-WorkWithData/06-Analytics Engine/typescript/memory.md +6 -5
- package/docs/academy/02-MasteryTrack/04-WorkWithData/06-Analytics Engine/typescript/schema.md +2 -2
- package/docs/academy/02-MasteryTrack/04-WorkWithData/06-Analytics Engine/typescript/utilities.md +7 -5
- package/docs/academy/02-MasteryTrack/04-WorkWithData/06-Analytics Engine/use-cases/maker.md +32 -58
- package/docs/academy/02-MasteryTrack/04-WorkWithData/06-Analytics Engine/use-cases/processors.md +1 -1
- package/docs/academy/02-MasteryTrack/04-WorkWithData/07-drive-analytics.md +105 -71
- package/docs/academy/02-MasteryTrack/04-WorkWithData/_ARCHIVE-AnalyticsProcessorTutorial/_01-SetupBuilderEnvironment.md +22 -0
- package/docs/academy/02-MasteryTrack/04-WorkWithData/_ARCHIVE-AnalyticsProcessorTutorial/_02-CreateNewPowerhouseProject.md +9 -8
- package/docs/academy/02-MasteryTrack/04-WorkWithData/_ARCHIVE-AnalyticsProcessorTutorial/_03-GenerateAnAnalyticsProcessor.md +28 -32
- package/docs/academy/02-MasteryTrack/04-WorkWithData/_ARCHIVE-AnalyticsProcessorTutorial/_04-UpdateAnalyticsProcessor.md +25 -26
- package/docs/academy/02-MasteryTrack/04-WorkWithData/_ARCHIVE-AnalyticsProcessorTutorial/_category_.json +1 -1
- package/docs/academy/02-MasteryTrack/04-WorkWithData/_category_.json +7 -7
- package/docs/academy/02-MasteryTrack/05-Launch/01-IntroductionToPackages.md +3 -4
- package/docs/academy/02-MasteryTrack/05-Launch/02-PublishYourProject.md +69 -45
- package/docs/academy/02-MasteryTrack/05-Launch/03-SetupEnvironment.md +70 -40
- package/docs/academy/02-MasteryTrack/05-Launch/04-ConfigureEnvironment.md +1 -0
- package/docs/academy/02-MasteryTrack/05-Launch/_category_.json +7 -7
- package/docs/academy/02-MasteryTrack/_category_.json +6 -6
- package/docs/academy/03-ExampleUsecases/Chatroom/02-CreateNewPowerhouseProject.md +5 -3
- package/docs/academy/03-ExampleUsecases/Chatroom/03-DefineChatroomDocumentModel.md +38 -37
- package/docs/academy/03-ExampleUsecases/Chatroom/04-ImplementOperationReducers.md +45 -41
- package/docs/academy/03-ExampleUsecases/Chatroom/05-ImplementChatroomEditor.md +14 -14
- package/docs/academy/03-ExampleUsecases/Chatroom/06-LaunchALocalReactor.md +6 -6
- package/docs/academy/03-ExampleUsecases/Chatroom/_category_.json +1 -1
- package/docs/academy/04-APIReferences/00-PowerhouseCLI.md +9 -7
- package/docs/academy/04-APIReferences/01-ReactHooks.md +177 -129
- package/docs/academy/04-APIReferences/04-RelationalDatabase.md +121 -113
- package/docs/academy/04-APIReferences/05-PHDocumentMigrationGuide.md +48 -41
- package/docs/academy/04-APIReferences/_category_.json +6 -6
- package/docs/academy/05-Architecture/00-PowerhouseArchitecture.md +1 -2
- package/docs/academy/05-Architecture/01-WorkingWithTheReactor.md +11 -8
- package/docs/academy/05-Architecture/05-DocumentModelTheory/_category_.json +1 -1
- package/docs/academy/05-Architecture/_category_.json +6 -6
- package/docs/academy/06-ComponentLibrary/00-DocumentEngineering.md +25 -23
- package/docs/academy/06-ComponentLibrary/02-CreateCustomScalars.md +105 -93
- package/docs/academy/06-ComponentLibrary/03-IntegrateIntoAReactComponent.md +1 -0
- package/docs/academy/06-ComponentLibrary/_category_.json +7 -7
- package/docs/academy/07-Cookbook.md +267 -34
- package/docs/academy/08-Glossary.md +7 -1
- package/docs/bookofpowerhouse/01-Overview.md +2 -2
- package/docs/bookofpowerhouse/02-GeneralFrameworkAndPhilosophy.md +1 -7
- package/docs/bookofpowerhouse/03-PowerhouseSoftwareArchitecture.md +10 -7
- package/docs/bookofpowerhouse/04-DevelopmentApproaches.md +10 -4
- package/docs/bookofpowerhouse/05-SNOsandANewModelForOSSandPublicGoods.md +23 -30
- package/docs/bookofpowerhouse/06-SNOsInActionAndPlatformEconomies.md +0 -7
- package/docusaurus.config.ts +64 -66
- package/package.json +1 -1
- package/scripts/generate-combined-cli-docs.ts +43 -13
- package/sidebars.ts +1 -0
- package/src/components/HomepageFeatures/index.tsx +171 -78
- package/src/components/HomepageFeatures/styles.module.css +1 -2
- package/src/css/custom.css +89 -89
- package/src/pages/_archive-homepage.tsx +17 -16
- package/src/theme/DocCardList/index.tsx +9 -8
- package/static.json +6 -6
|
@@ -15,6 +15,7 @@ Version 4.0.0 introduced a significant refactor of the `PHDocument` structure th
|
|
|
15
15
|
The most significant change is the consolidation of document metadata into a `header` field. Previously, document properties were scattered at the root level of the document object.
|
|
16
16
|
|
|
17
17
|
**Before (v3.2.0 and earlier):**
|
|
18
|
+
|
|
18
19
|
```javascript
|
|
19
20
|
const document = {
|
|
20
21
|
id: "doc-123",
|
|
@@ -25,10 +26,11 @@ const document = {
|
|
|
25
26
|
name: "My Todo List",
|
|
26
27
|
slug: "my-todo-list",
|
|
27
28
|
// ... other properties
|
|
28
|
-
}
|
|
29
|
+
};
|
|
29
30
|
```
|
|
30
31
|
|
|
31
32
|
**After (v4.0.0):**
|
|
33
|
+
|
|
32
34
|
```javascript
|
|
33
35
|
const document = {
|
|
34
36
|
header: {
|
|
@@ -41,26 +43,26 @@ const document = {
|
|
|
41
43
|
slug: "my-todo-list",
|
|
42
44
|
branch: "main",
|
|
43
45
|
sig: { nonce: "", publicKey: {} },
|
|
44
|
-
meta: {}
|
|
46
|
+
meta: {},
|
|
45
47
|
},
|
|
46
48
|
// ... other properties
|
|
47
|
-
}
|
|
49
|
+
};
|
|
48
50
|
```
|
|
49
51
|
|
|
50
52
|
## Complete Property Migration Map
|
|
51
53
|
|
|
52
|
-
| **Old Property**
|
|
53
|
-
|
|
54
|
-
| `document.id`
|
|
55
|
-
| `document.created`
|
|
56
|
-
| `document.lastModified` | `document.header.lastModifiedAtUtcIso` | **Renamed** to include UTC ISO specification
|
|
57
|
-
| `document.revision`
|
|
58
|
-
| `document.documentType` | `document.header.documentType`
|
|
59
|
-
| `document.name`
|
|
60
|
-
| `document.slug`
|
|
61
|
-
| `document.branch`
|
|
62
|
-
| `document.meta`
|
|
63
|
-
| N/A
|
|
54
|
+
| **Old Property** | **New Property** | **Additional Changes** |
|
|
55
|
+
| ----------------------- | -------------------------------------- | ------------------------------------------------------------------- |
|
|
56
|
+
| `document.id` | `document.header.id` | Now an Ed25519 signature for signed documents |
|
|
57
|
+
| `document.created` | `document.header.createdAtUtcIso` | **Renamed** to include UTC ISO specification |
|
|
58
|
+
| `document.lastModified` | `document.header.lastModifiedAtUtcIso` | **Renamed** to include UTC ISO specification |
|
|
59
|
+
| `document.revision` | `document.header.revision` | Now an **object** with scope keys (e.g., `{ global: 5, local: 0 }`) |
|
|
60
|
+
| `document.documentType` | `document.header.documentType` | No additional changes |
|
|
61
|
+
| `document.name` | `document.header.name` | No additional changes |
|
|
62
|
+
| `document.slug` | `document.header.slug` | No additional changes |
|
|
63
|
+
| `document.branch` | `document.header.branch` | Now explicitly included |
|
|
64
|
+
| `document.meta` | `document.header.meta` | Now explicitly included |
|
|
65
|
+
| N/A | `document.header.sig` | **New** - Signature information for document verification |
|
|
64
66
|
|
|
65
67
|
## Step-by-Step Migration Guide
|
|
66
68
|
|
|
@@ -72,6 +74,7 @@ Replace all instances of direct property access with header-based access:
|
|
|
72
74
|
<summary>**Common Property Access Patterns**</summary>
|
|
73
75
|
|
|
74
76
|
**Document ID Access:**
|
|
77
|
+
|
|
75
78
|
```javascript
|
|
76
79
|
// Before
|
|
77
80
|
const documentId = document.id;
|
|
@@ -81,6 +84,7 @@ const documentId = document.header.id;
|
|
|
81
84
|
```
|
|
82
85
|
|
|
83
86
|
**Document Name Access:**
|
|
87
|
+
|
|
84
88
|
```javascript
|
|
85
89
|
// Before
|
|
86
90
|
const documentName = document.name;
|
|
@@ -90,6 +94,7 @@ const documentName = document.header.name;
|
|
|
90
94
|
```
|
|
91
95
|
|
|
92
96
|
**Document Type Access:**
|
|
97
|
+
|
|
93
98
|
```javascript
|
|
94
99
|
// Before
|
|
95
100
|
const docType = document.documentType;
|
|
@@ -99,6 +104,7 @@ const docType = document.header.documentType;
|
|
|
99
104
|
```
|
|
100
105
|
|
|
101
106
|
**Timestamp Access:**
|
|
107
|
+
|
|
102
108
|
```javascript
|
|
103
109
|
// Before
|
|
104
110
|
const created = document.created;
|
|
@@ -110,6 +116,7 @@ const lastModified = document.header.lastModifiedAtUtcIso;
|
|
|
110
116
|
```
|
|
111
117
|
|
|
112
118
|
**Revision Access:**
|
|
119
|
+
|
|
113
120
|
```javascript
|
|
114
121
|
// Before
|
|
115
122
|
const revision = document.revision; // Was a number
|
|
@@ -135,11 +142,13 @@ const allRevisions = document.header.revision; // { global: 5, local: 0, ... }
|
|
|
135
142
|
function DocumentList({ documents }) {
|
|
136
143
|
return (
|
|
137
144
|
<div>
|
|
138
|
-
{documents.map(doc => (
|
|
145
|
+
{documents.map((doc) => (
|
|
139
146
|
<div key={doc.id} className="document-item">
|
|
140
147
|
<h3>{doc.name}</h3>
|
|
141
148
|
<p>Type: {doc.documentType}</p>
|
|
142
|
-
<p>
|
|
149
|
+
<p>
|
|
150
|
+
Last modified: {new Date(doc.lastModified).toLocaleDateString()}
|
|
151
|
+
</p>
|
|
143
152
|
<p>Revision: {doc.revision}</p>
|
|
144
153
|
</div>
|
|
145
154
|
))}
|
|
@@ -151,11 +160,14 @@ function DocumentList({ documents }) {
|
|
|
151
160
|
function DocumentList({ documents }) {
|
|
152
161
|
return (
|
|
153
162
|
<div>
|
|
154
|
-
{documents.map(doc => (
|
|
163
|
+
{documents.map((doc) => (
|
|
155
164
|
<div key={doc.header.id} className="document-item">
|
|
156
165
|
<h3>{doc.header.name}</h3>
|
|
157
166
|
<p>Type: {doc.header.documentType}</p>
|
|
158
|
-
<p>
|
|
167
|
+
<p>
|
|
168
|
+
Last modified:{" "}
|
|
169
|
+
{new Date(doc.header.lastModifiedAtUtcIso).toLocaleDateString()}
|
|
170
|
+
</p>
|
|
159
171
|
<p>Global Revision: {doc.header.revision.global}</p>
|
|
160
172
|
</div>
|
|
161
173
|
))}
|
|
@@ -218,16 +230,17 @@ interface MyDocument {
|
|
|
218
230
|
<summary>**GraphQL Query Compatibility**</summary>
|
|
219
231
|
|
|
220
232
|
**GraphQL Queries:**
|
|
233
|
+
|
|
221
234
|
```graphql
|
|
222
235
|
# Your existing queries continue to work unchanged
|
|
223
236
|
query GetDocument($id: ID!) {
|
|
224
237
|
document(id: $id) {
|
|
225
|
-
id
|
|
226
|
-
name
|
|
227
|
-
documentType
|
|
228
|
-
created
|
|
229
|
-
lastModified
|
|
230
|
-
revision
|
|
238
|
+
id # Still works due to response transformation
|
|
239
|
+
name # Still works due to response transformation
|
|
240
|
+
documentType # Still works due to response transformation
|
|
241
|
+
created # Still works due to response transformation
|
|
242
|
+
lastModified # Still works due to response transformation
|
|
243
|
+
revision # Still works due to response transformation
|
|
231
244
|
}
|
|
232
245
|
}
|
|
233
246
|
```
|
|
@@ -238,10 +251,6 @@ query GetDocument($id: ID!) {
|
|
|
238
251
|
|
|
239
252
|
</details>
|
|
240
253
|
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
254
|
## Common Migration Issues and Solutions
|
|
246
255
|
|
|
247
256
|
### Issue 1: Undefined Property Errors
|
|
@@ -299,15 +308,15 @@ Create tests to verify your migration:
|
|
|
299
308
|
|
|
300
309
|
```javascript
|
|
301
310
|
// Test document property access
|
|
302
|
-
describe(
|
|
303
|
-
it(
|
|
311
|
+
describe("Document Migration", () => {
|
|
312
|
+
it("should access document properties correctly", () => {
|
|
304
313
|
const mockDocument = {
|
|
305
314
|
header: {
|
|
306
|
-
id:
|
|
307
|
-
name:
|
|
308
|
-
documentType:
|
|
309
|
-
createdAtUtcIso:
|
|
310
|
-
lastModifiedAtUtcIso:
|
|
315
|
+
id: "test-id",
|
|
316
|
+
name: "Test Document",
|
|
317
|
+
documentType: "powerhouse/test",
|
|
318
|
+
createdAtUtcIso: "2023-01-01T00:00:00.000Z",
|
|
319
|
+
lastModifiedAtUtcIso: "2023-01-01T12:00:00.000Z",
|
|
311
320
|
revision: { global: 5, local: 0 },
|
|
312
321
|
// ... other header properties
|
|
313
322
|
},
|
|
@@ -315,8 +324,8 @@ describe('Document Migration', () => {
|
|
|
315
324
|
};
|
|
316
325
|
|
|
317
326
|
// Test property access
|
|
318
|
-
expect(mockDocument.header.id).toBe(
|
|
319
|
-
expect(mockDocument.header.name).toBe(
|
|
327
|
+
expect(mockDocument.header.id).toBe("test-id");
|
|
328
|
+
expect(mockDocument.header.name).toBe("Test Document");
|
|
320
329
|
expect(mockDocument.header.revision.global).toBe(5);
|
|
321
330
|
});
|
|
322
331
|
});
|
|
@@ -324,8 +333,6 @@ describe('Document Migration', () => {
|
|
|
324
333
|
|
|
325
334
|
</details>
|
|
326
335
|
|
|
327
|
-
|
|
328
|
-
|
|
329
336
|
## Related Documentation
|
|
330
337
|
|
|
331
338
|
- [PHDocument Architecture](/academy/Architecture/PowerhouseArchitecture)
|
|
@@ -334,4 +341,4 @@ describe('Document Migration', () => {
|
|
|
334
341
|
|
|
335
342
|
---
|
|
336
343
|
|
|
337
|
-
|
|
344
|
+
_This migration guide covers the major changes in v4.0.0. For additional technical details, refer to the [RELEASE-NOTES.md](https://github.com/powerhouse-dao/powerhouse/blob/main/RELEASE-NOTES.md) in the main repository._
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
"label": "API References",
|
|
3
|
+
"link": {
|
|
4
|
+
"type": "generated-index",
|
|
5
|
+
"description": "A reference for the Powerhouse API."
|
|
6
|
+
}
|
|
7
|
+
}
|
|
@@ -14,7 +14,6 @@ Each application is designed to be modular yet complementary, ensuring smooth da
|
|
|
14
14
|
|
|
15
15
|

|
|
16
16
|
|
|
17
|
-
|
|
18
17
|
## How the Five Applications Work Together
|
|
19
18
|
|
|
20
19
|
The Powerhouse ecosystem functions as a decentralized operating system, where each of the four core applications works in synergy to ensure seamless collaboration, structured data management, and automated workflows. Each application has a distinct purpose, yet their interconnectivity is what makes the system powerful.
|
|
@@ -50,4 +49,4 @@ Renown is the trust and identity layer, ensuring security, reputation tracking,
|
|
|
50
49
|
|
|
51
50
|
- It acts as the authentication gateway, determining who has permission to view, edit, or execute specific operations within the system.
|
|
52
51
|
- Every action performed in Connect is tracked in the document history, making it fully auditable through Switchboard.
|
|
53
|
-
- Fusion utilizes Renown to verify contributor credibility, ensuring that data-driven decisions are based on trusted and authenticated inputs.
|
|
52
|
+
- Fusion utilizes Renown to verify contributor credibility, ensuring that data-driven decisions are based on trusted and authenticated inputs.
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
:::tip
|
|
4
4
|
Document models are the common design pattern that is used for all documents and files.
|
|
5
|
-
DocSync is a decentralized synchronization protocol that is storage agnostic.
|
|
5
|
+
DocSync is a decentralized synchronization protocol that is storage agnostic.
|
|
6
6
|
|
|
7
7
|
**Document Models** are _what_ is synced and **DocSync** is _how_ document models are synced.
|
|
8
|
-
But who is doing the syncing?
|
|
8
|
+
But who is doing the syncing?
|
|
9
9
|
|
|
10
10
|
We call these participants **Reactors**.
|
|
11
11
|
:::
|
|
12
12
|
|
|
13
|
-
### Powerhouse Reactors
|
|
13
|
+
### Powerhouse Reactors
|
|
14
14
|
|
|
15
15
|
**What is a Reactor?**
|
|
16
16
|
Powerhouse Reactors are the nodes in the network that store documents, resolve conflicts and rerun operations to verify document event histories. Reactors can be configured for local storage, centralized cloud storage or on a decentralized storage network. A Reactor is essentially a storage node used in Powerhouse's framework to handle documents and traditional files. It supports multiple storage solutions, including:
|
|
@@ -20,29 +20,32 @@ Powerhouse Reactors are the nodes in the network that store documents, resolve c
|
|
|
20
20
|
- **Decentralized Storage**: Such as Ceramic or IPFS, enabling distributed and blockchain-based storage options.
|
|
21
21
|
|
|
22
22
|
### Core Functions of Reactors
|
|
23
|
+
|
|
23
24
|
- **Data Synchronization**: Reactors ensure that all data, whether local or distributed, remains up-to-date and consistent across the system.
|
|
24
25
|
- **Modular Storage Adapters**: They support integration with different storage backends depending on organizational needs.
|
|
25
26
|
- **Collaboration Support**: Reactors facilitate document sharing and peer-to-peer collaboration across contributors within the network.
|
|
26
27
|
|
|
27
28
|
:::tip
|
|
28
|
-
The DocSync protocol
|
|
29
|
+
The DocSync protocol _sends updates from one reactor to another_ - **smashing document operations into one another** - to ensure all data is synced.
|
|
29
30
|
:::
|
|
30
31
|
|
|
31
32
|
A **reactor** is responsible for storing data and resolving merge conflicts.
|
|
32
|
-
Editing data and submitting new operations must be done through Powerhouse's native applications (Connect, Switchboard, Fusion). Each instance of these applications contains a Reactor that is responsible for storing data and syncing data through DocSync. In other words, Powerhouse applications are how Reactors can be accessed, manipulated, steered, visualized and modified. A local Connect desktop application's reactor can therefore sync with the Reactor of a remote drive (e.g. Switchboard instance).
|
|
33
|
+
Editing data and submitting new operations must be done through Powerhouse's native applications (Connect, Switchboard, Fusion). Each instance of these applications contains a Reactor that is responsible for storing data and syncing data through DocSync. In other words, Powerhouse applications are how Reactors can be accessed, manipulated, steered, visualized and modified. A local Connect desktop application's reactor can therefore sync with the Reactor of a remote drive (e.g. Switchboard instance).
|
|
33
34
|
|
|
34
35
|
<img src="/img/Powerhouse Website Drive.png" alt="Powerhouse Storage Layer"/>
|
|
35
36
|
|
|
36
37
|
### Why Are Reactors Important?
|
|
38
|
+
|
|
37
39
|
They are key to ensuring the scalability and resilience of decentralized operations.
|
|
38
40
|
By acting as the backbone for document models in the Powerhouse framework, they enable seamless version control and event-driven updates.
|
|
39
41
|
Reactors provide the foundation for advanced features like real-time collaboration, history tracking, and decentralized audits.
|
|
40
42
|
This modular, flexible infrastructure enables organizations to build efficient and robust decentralized systems, tailored for modern network organizations
|
|
41
43
|
|
|
42
44
|
## Configuring your reactor
|
|
43
|
-
|
|
44
|
-
In addition to the choice of storage, Reactors also have other configurations.
|
|
45
|
-
|
|
45
|
+
|
|
46
|
+
In addition to the choice of storage, Reactors also have other configurations.
|
|
47
|
+
|
|
48
|
+
- The **operational data** and **read models** associated with the document models inside a reactor allow to query the gathered data inside a document model or quickly visualize the crucial insights at a glance.
|
|
46
49
|
- **Listeners**, which continuously listen to any changes in a document model, help us to connect additional tools such as codegenerators and scripts to the reactors and the document models it holds
|
|
47
50
|
|
|
48
51
|
> Jump to: Configure a listener for your reactor and add a codegenerator
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
"label": "Architecture",
|
|
3
|
+
"link": {
|
|
4
|
+
"type": "generated-index",
|
|
5
|
+
"description": "Learn about the architecture of Powerhouse."
|
|
6
|
+
}
|
|
7
|
+
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
# Document-Engineering
|
|
2
2
|
|
|
3
|
-
The reusable components in the Document-Engineering system are a set of of front-end components based on graphQL scalars.
|
|
3
|
+
The reusable components in the Document-Engineering system are a set of of front-end components based on graphQL scalars.
|
|
4
4
|
Powerhouse also has a set of custom scalars that are not part of the graphQL standard but are specific to the web3 ecosystem.
|
|
5
|
-
These components are offered through the **Powerhouse Document-Engineering system** with the help of storybook & the Academy documentation.
|
|
5
|
+
These components are offered through the **Powerhouse Document-Engineering system** with the help of storybook & the Academy documentation.
|
|
6
6
|
|
|
7
|
-
It provides a collection of pre-built, reusable UI components designed for consistency and efficiency across Powerhouse applications and editors. Think of it as a toolkit of standard UI elements like buttons, inputs, and checkboxes with many of these components based on graphql scalars.
|
|
7
|
+
It provides a collection of pre-built, reusable UI components designed for consistency and efficiency across Powerhouse applications and editors. Think of it as a toolkit of standard UI elements like buttons, inputs, and checkboxes with many of these components based on graphql scalars.
|
|
8
8
|
|
|
9
9
|
:::info
|
|
10
|
-
A GraphQL scalar is essentially a primitive, indivisible value in the GraphQL type system.
|
|
10
|
+
A GraphQL scalar is essentially a primitive, indivisible value in the GraphQL type system.
|
|
11
11
|
Here are the key points to understand:
|
|
12
12
|
|
|
13
13
|
- **Basic Building Blocks:** Scalars are the basic data types—like String, Int, Float, Boolean, and ID—that represent atomic values.
|
|
14
14
|
- **Leaf Nodes:** Scalars are the "leaves" of a GraphQL query. They can't have any sub-fields, meaning once you hit a scalar in a query, that's the final value.
|
|
15
|
-
- **Custom Scalars:** Besides the built-in scalars, you can define custom scalars (e.g., a Date type) if you need to handle more specific formats or validations. Powerhouse does this specific for the web3 ecosystem.
|
|
16
|
-
:::
|
|
15
|
+
- **Custom Scalars:** Besides the built-in scalars, you can define custom scalars (e.g., a Date type) if you need to handle more specific formats or validations. Powerhouse does this specific for the web3 ecosystem.
|
|
16
|
+
:::
|
|
17
17
|
|
|
18
18
|
## What are Components?
|
|
19
19
|
|
|
@@ -43,7 +43,7 @@ There are two applications of scalar components in the document model workflow:
|
|
|
43
43
|
|
|
44
44
|
These are specialized form components, each corresponding to a GraphQL scalar type (e.g., String, Number, Boolean, Currency, PHID). They are built on top of react-hook-form, offering out-of-the-box validation but must be wrapped with a Form component in order to work properly.
|
|
45
45
|
|
|
46
|
-
**Location:** @powerhousedao/document-engineering/scalars
|
|
46
|
+
**Location:** @powerhousedao/document-engineering/scalars
|
|
47
47
|
https://github.com/powerhouse-inc/document-engineering
|
|
48
48
|
|
|
49
49
|
**Key Feature**: Must be used within a Form component provided by this library.
|
|
@@ -52,7 +52,7 @@ https://github.com/powerhouse-inc/document-engineering
|
|
|
52
52
|
|
|
53
53
|
This category includes a broader range of UI elements such as simplified versions of the Scalar components (which don't require a Form wrapper but lack built-in validation), as well as other versatile components like Dropdown, Tooltip, Sidebar, ObjectSetTable and more. These are designed for crafting diverse and complex user interfaces.
|
|
54
54
|
|
|
55
|
-
**Location:** @powerhousedao/document-engineering/ui
|
|
55
|
+
**Location:** @powerhousedao/document-engineering/ui
|
|
56
56
|
https://github.com/powerhouse-inc/document-engineering
|
|
57
57
|
|
|
58
58
|
## Component Types Classification
|
|
@@ -60,18 +60,22 @@ https://github.com/powerhouse-inc/document-engineering
|
|
|
60
60
|
Inspired by atomic design methodology, Powerhouse classifies components into the following categories:
|
|
61
61
|
|
|
62
62
|
### Fragment
|
|
63
|
+
|
|
63
64
|
The smallest element that combined together makes up a scalar or other simple component.
|
|
64
65
|
**Examples:** Character counter, Checkbox field, Label
|
|
65
66
|
|
|
66
67
|
### Scalar (Simple Component)
|
|
68
|
+
|
|
67
69
|
The simplest component that contains the basic input field for one-dimensional data type (single value).
|
|
68
70
|
**Examples:** Integer, Boolean, String, Powerhouse ID (PHID)
|
|
69
71
|
|
|
70
72
|
### Complex Component
|
|
73
|
+
|
|
71
74
|
Compound component that has an object/array value. It's made up of multiple scalars combined to serve a specific function.
|
|
72
75
|
**Examples:** Sidebar (tree structure navigation component with content-style navigation for hierarchical data)
|
|
73
76
|
|
|
74
77
|
### Layout Component
|
|
78
|
+
|
|
75
79
|
Purpose-specific container for other components like lists of other components, color layouts, sections, etc.
|
|
76
80
|
**Examples:** Homepage section layout
|
|
77
81
|
|
|
@@ -81,16 +85,16 @@ The Powerhouse team is building a Component library with a wide range of compone
|
|
|
81
85
|
|
|
82
86
|
## Component Behavior & UX Principles
|
|
83
87
|
|
|
84
|
-
Besides the ability to input data, components have another crucial utility: they describe the mechanism of user interaction through implementing a defined set of behavior rules.
|
|
88
|
+
Besides the ability to input data, components have another crucial utility: they describe the mechanism of user interaction through implementing a defined set of behavior rules.
|
|
85
89
|
|
|
86
90
|
**Best Practices for Component Behavior:**
|
|
91
|
+
|
|
87
92
|
- Implementing behaviors at a component level is much more efficient than at the document level
|
|
88
93
|
- Good component behavior feels natural to the user and is easily understood
|
|
89
94
|
- Components should be intuitive and not require additional tutorials or explanations
|
|
90
95
|
- Start with the most simple/basic behaviors first, then layer additional behaviors on top
|
|
91
96
|
- Keep behaviors as simple as needed - less is more
|
|
92
97
|
|
|
93
|
-
|
|
94
98
|
## Exploring Components with Storybook
|
|
95
99
|
|
|
96
100
|
We use Storybook as an interactive catalog for our design system components. It allows you to visually explore each component, interact with different states, and understand how to integrate them into your projects. [https://storybook.powerhouse.academy](https://storybook.powerhouse.academy)
|
|
@@ -112,13 +116,13 @@ Let's walk through the typical workflow for using a component from the document-
|
|
|
112
116
|
|
|
113
117
|
1. **Identify the Need:** While building your feature (e.g., the To-do List editor in `editor.tsx`), you determine the need for a standard UI element, like a checkbox.
|
|
114
118
|
2. **Consult the Document Engineering Components in Storybook:**
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
+
- Open the Powerhouse Storybook instance. [https://storybook.powerhouse.academy](https://storybook.powerhouse.academy)
|
|
120
|
+
- Navigate or search to find the `Checkbox` component.
|
|
121
|
+
- Review the visual examples and interactive demo.
|
|
122
|
+
- Examine the "Usage" snippet and the **Props table** to understand the basic implementation and available configuration options (`label`, `value`, `onChange`, etc.).
|
|
119
123
|
3. **Import the Component:** In your code editor, open the relevant file (e.g., `editors/to-do-list/editor.tsx`). Add an import statement at the top to bring the component into your file's scope:
|
|
120
124
|
```typescript
|
|
121
|
-
import { Checkbox } from
|
|
125
|
+
import { Checkbox } from "@powerhousedao/document-engineering/scalars";
|
|
122
126
|
// Or import other components as needed:
|
|
123
127
|
// import { Checkbox, InputField, Button } from '@powerhousedao/document-engineering/scalars';
|
|
124
128
|
```
|
|
@@ -128,9 +132,9 @@ Let's walk through the typical workflow for using a component from the document-
|
|
|
128
132
|
// Example from the To-do List Editor:
|
|
129
133
|
<Checkbox
|
|
130
134
|
// Bind the checked state to data within editor.tsx
|
|
131
|
-
value={item.checked}
|
|
135
|
+
value={item.checked}
|
|
132
136
|
// Provide a function from editor.tsx to handle changes
|
|
133
|
-
onChange={() => {
|
|
137
|
+
onChange={() => {
|
|
134
138
|
dispatch(actions.updateTodoItem({
|
|
135
139
|
id: item.id,
|
|
136
140
|
checked: !item.checked,
|
|
@@ -179,7 +183,7 @@ import { ... } from '@powerhousedao/document-engineering/graphql';
|
|
|
179
183
|
To include the package's styles:
|
|
180
184
|
|
|
181
185
|
```typescript
|
|
182
|
-
import
|
|
186
|
+
import "@powerhousedao/document-engineering/style.css";
|
|
183
187
|
```
|
|
184
188
|
|
|
185
189
|
## Import Maps
|
|
@@ -188,14 +192,12 @@ Within the project, the following import maps are available:
|
|
|
188
192
|
|
|
189
193
|
- `#assets` - Assets utilities and components
|
|
190
194
|
- `#scalars` - Scalar transformations and utilities
|
|
191
|
-
- `#ui` - UI components
|
|
195
|
+
- `#ui` - UI components
|
|
192
196
|
- `#graphql` - GraphQL related utilities
|
|
193
197
|
|
|
194
|
-
Please don't hesitate to reach out in our discord channels with any questions.
|
|
195
|
-
Happy designing!
|
|
198
|
+
Please don't hesitate to reach out in our discord channels with any questions.
|
|
199
|
+
Happy designing!
|
|
196
200
|
|
|
197
201
|
### Up next: Create Custom Scalars
|
|
198
202
|
|
|
199
203
|
You can learn how to do so in our guide on [Creating Custom Scalars](/academy/ComponentLibrary/CreateCustomScalars).
|
|
200
|
-
|
|
201
|
-
|