@powerhousedao/academy 3.2.0 → 3.3.0-dev.1
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/CHANGELOG.md +53 -15
- package/docs/academy/01-GetStarted/00-ExploreDemoPackage.mdx +60 -51
- package/docs/academy/01-GetStarted/01-CreateNewPowerhouseProject.md +8 -28
- package/docs/academy/01-GetStarted/02-DefineToDoListDocumentModel.md +1 -1
- package/docs/academy/01-GetStarted/images/OperationsHistory.png +0 -0
- package/docs/academy/01-GetStarted/images/OperationsHistoryButton.png +0 -0
- package/docs/academy/01-GetStarted/images/OperationsHistorySignature.png +0 -0
- package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/02-ConfiguringDrives.md +53 -29
- package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/06-DocumentTools/images/Screenshot 2025-06-26 at 17.41.14.png +0 -0
- package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/images/AddDrive.png +0 -0
- package/docs/academy/02-MasteryTrack/04-WorkWithData/01-ReadingAndWritingThroughTheAPI.mdx +174 -56
- package/docs/academy/02-MasteryTrack/04-WorkWithData/04-analytics-processor.md +281 -1
- package/docs/academy/02-MasteryTrack/04-WorkWithData/05-AnalyticsProcessorTutorial/02-CreateNewPowerhouseProject.md +4 -2
- package/docs/academy/02-MasteryTrack/04-WorkWithData/images/AddNewDriveURL.png +0 -0
- package/docs/academy/02-MasteryTrack/04-WorkWithData/images/DocumentID.png +0 -0
- package/docs/academy/02-MasteryTrack/04-WorkWithData/images/OnboardingTasks.png +0 -0
- package/docs/academy/02-MasteryTrack/04-WorkWithData/images/QueryDocument.png +0 -0
- package/docs/academy/02-MasteryTrack/04-WorkWithData/images/QueryDocument2.png +0 -0
- package/docs/academy/03-ExampleUsecases/Chatroom/02-CreateNewPowerhouseProject.md +2 -1
- package/docs/academy/04-APIReferences/01-ReactHooks.md +0 -5
- package/docs/academy/06-ComponentLibrary/00-DocumentEngineering.md +52 -0
- package/docs/academy/07-Cookbook.md +2 -2
- package/package.json +2 -2
- package/src/css/custom.css +22 -1
- /package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/{07-DocumentTools → 06-DocumentTools}/00-DocumentToolbar.mdx +0 -0
- /package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/{07-DocumentTools → 06-DocumentTools}/01-OperationHistory.md +0 -0
- /package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/{07-DocumentTools → 06-DocumentTools}/02-RevisionHistoryTimeline.md +0 -0
- /package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/{07-DocumentTools → 06-DocumentTools}/_category_.json +0 -0
- /package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/{07-DocumentTools → 06-DocumentTools}/images/DocumentToolbar.png +0 -0
- /package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/{07-DocumentTools → 06-DocumentTools}/images/committer-address-popup.png +0 -0
- /package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/{07-DocumentTools → 06-DocumentTools}/images/revision-hash-popup.png +0 -0
- /package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/{07-DocumentTools → 06-DocumentTools}/images/revision-history-list.png +0 -0
- /package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/{07-DocumentTools → 06-DocumentTools}/images/revision-history-timeline.png +0 -0
- /package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/{07-DocumentTools → 06-DocumentTools}/images/signature-details-popup.png +0 -0
- /package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/{08-Authorization → 07-Authorization}/01-RenownAuthenticationFlow.md +0 -0
- /package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/{08-Authorization → 07-Authorization}/02-Authorization.md +0 -0
- /package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/{08-Authorization → 07-Authorization}/_category_.json +0 -0
- /package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/{08-Authorization → 07-Authorization}/images/ConnectAddress.png +0 -0
- /package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/{08-Authorization → 07-Authorization}/images/LoginComplete.png +0 -0
- /package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/{08-Authorization → 07-Authorization}/images/OperationsHistory.png +0 -0
- /package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/{08-Authorization → 07-Authorization}/images/RenownLogin.png +0 -0
- /package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/{08-Authorization → 07-Authorization}/images/ReturnToConnect.png +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,43 +1,81 @@
|
|
|
1
|
-
## 3.
|
|
1
|
+
## 3.3.0-dev.1 (2025-07-04)
|
|
2
2
|
|
|
3
3
|
This was a version bump only for @powerhousedao/academy to align it with other projects, there were no code changes.
|
|
4
4
|
|
|
5
|
-
## 3.
|
|
5
|
+
## 3.3.0-dev.0 (2025-07-02)
|
|
6
6
|
|
|
7
7
|
### 🚀 Features
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
9
|
+
- **academy:** add Drive Analytics documentation and examples ([daedc28a3](https://github.com/powerhouse-inc/powerhouse/commit/daedc28a3))
|
|
10
|
+
- starting to stub out a complete example of the analytics processor ([a84ed2dcf](https://github.com/powerhouse-inc/powerhouse/commit/a84ed2dcf))
|
|
11
|
+
- **connect:** use atom store and provider from state library ([28f646636](https://github.com/powerhouse-inc/powerhouse/commit/28f646636))
|
|
12
|
+
- added drive analytics processor ([#1607](https://github.com/powerhouse-inc/powerhouse/pull/1607))
|
|
13
|
+
|
|
14
|
+
### 🩹 Fixes
|
|
15
|
+
|
|
16
|
+
- fix build ([c0cd6988d](https://github.com/powerhouse-inc/powerhouse/commit/c0cd6988d))
|
|
17
|
+
- updated processor generator and added codegen test for it ([6af3bbcf7](https://github.com/powerhouse-inc/powerhouse/commit/6af3bbcf7))
|
|
18
|
+
- added test to generate and compile a generated document-model ([17bbca3bb](https://github.com/powerhouse-inc/powerhouse/commit/17bbca3bb))
|
|
19
|
+
- updated document-engineering ver ([3522179d6](https://github.com/powerhouse-inc/powerhouse/commit/3522179d6))
|
|
20
|
+
- updated atoms with header changes ([2b557197a](https://github.com/powerhouse-inc/powerhouse/commit/2b557197a))
|
|
11
21
|
|
|
12
22
|
### ❤️ Thank You
|
|
13
23
|
|
|
14
|
-
-
|
|
24
|
+
- acaldas @acaldas
|
|
25
|
+
- Benjamin Jordan (@thegoldenmule)
|
|
26
|
+
- Guillermo Puente @gpuente
|
|
27
|
+
- Guillermo Puente Sandoval @gpuente
|
|
28
|
+
- ryanwolhuter @ryanwolhuter
|
|
15
29
|
|
|
16
|
-
## 3.2.0-
|
|
30
|
+
## 3.2.0-dev.9 (2025-07-02)
|
|
31
|
+
|
|
32
|
+
### 🩹 Fixes
|
|
33
|
+
|
|
34
|
+
- updated processor generator and added codegen test for it ([6af3bbcf7](https://github.com/powerhouse-inc/powerhouse/commit/6af3bbcf7))
|
|
35
|
+
- added test to generate and compile a generated document-model ([17bbca3bb](https://github.com/powerhouse-inc/powerhouse/commit/17bbca3bb))
|
|
36
|
+
|
|
37
|
+
### ❤️ Thank You
|
|
38
|
+
|
|
39
|
+
- Benjamin Jordan (@thegoldenmule)
|
|
40
|
+
|
|
41
|
+
## 3.2.0-dev.8 (2025-07-01)
|
|
17
42
|
|
|
18
43
|
### 🚀 Features
|
|
19
44
|
|
|
20
|
-
- **
|
|
45
|
+
- **academy:** add Drive Analytics documentation and examples ([daedc28a3](https://github.com/powerhouse-inc/powerhouse/commit/daedc28a3))
|
|
21
46
|
|
|
22
47
|
### ❤️ Thank You
|
|
23
48
|
|
|
24
|
-
-
|
|
49
|
+
- Guillermo Puente @gpuente
|
|
25
50
|
|
|
26
|
-
## 3.2.0-
|
|
51
|
+
## 3.2.0-dev.7 (2025-06-28)
|
|
27
52
|
|
|
28
53
|
### 🚀 Features
|
|
29
54
|
|
|
30
|
-
-
|
|
31
|
-
- **connect:** use atom store and provider from state library ([d617a1fe2](https://github.com/powerhouse-inc/powerhouse/commit/d617a1fe2))
|
|
55
|
+
- starting to stub out a complete example of the analytics processor ([a84ed2dcf](https://github.com/powerhouse-inc/powerhouse/commit/a84ed2dcf))
|
|
32
56
|
|
|
33
57
|
### ❤️ Thank You
|
|
34
58
|
|
|
35
|
-
-
|
|
36
|
-
- ryanwolhuter
|
|
59
|
+
- Benjamin Jordan (@thegoldenmule)
|
|
37
60
|
|
|
38
|
-
## 3.2.0-
|
|
61
|
+
## 3.2.0-dev.6 (2025-06-27)
|
|
39
62
|
|
|
40
|
-
|
|
63
|
+
### 🚀 Features
|
|
64
|
+
|
|
65
|
+
- **connect:** use atom store and provider from state library ([28f646636](https://github.com/powerhouse-inc/powerhouse/commit/28f646636))
|
|
66
|
+
- added drive analytics processor ([#1607](https://github.com/powerhouse-inc/powerhouse/pull/1607))
|
|
67
|
+
|
|
68
|
+
### 🩹 Fixes
|
|
69
|
+
|
|
70
|
+
- updated document-engineering ver ([3522179d6](https://github.com/powerhouse-inc/powerhouse/commit/3522179d6))
|
|
71
|
+
- updated atoms with header changes ([2b557197a](https://github.com/powerhouse-inc/powerhouse/commit/2b557197a))
|
|
72
|
+
|
|
73
|
+
### ❤️ Thank You
|
|
74
|
+
|
|
75
|
+
- Benjamin Jordan (@thegoldenmule)
|
|
76
|
+
- Guillermo Puente
|
|
77
|
+
- Guillermo Puente Sandoval
|
|
78
|
+
- ryanwolhuter
|
|
41
79
|
|
|
42
80
|
## 3.2.0-dev.5 (2025-06-26)
|
|
43
81
|
|
|
@@ -1,18 +1,5 @@
|
|
|
1
1
|
# Explore the demo package
|
|
2
2
|
|
|
3
|
-
<details>
|
|
4
|
-
<summary>How long will this tutorial take?</summary>
|
|
5
|
-
|
|
6
|
-
We've designed this "Get Started" track to be as smooth as possible. The time it takes will vary based on your familiarity with modern web development tools.
|
|
7
|
-
|
|
8
|
-
- **For Experienced Developers** (familiar with TypeScript, React, and CLIs), you can expect to complete the entire four-part tutorial in approximately **1 to 1.5 hours**.
|
|
9
|
-
- **For Developers New to This Stack**, we recommend setting aside **3.5 to 4.5 hours**. This allows for time to understand not just the steps, but the core concepts behind them.
|
|
10
|
-
|
|
11
|
-
This is just a guideline. The goal is to learn comfortably and build a solid foundation with Powerhouse!
|
|
12
|
-
|
|
13
|
-
A more theoretical and advanced version of this tutorial can also be found in [Mastery Track - Document Model Creation](../MasteryTrack/DocumentModelCreation/WhatIsADocumentModel).
|
|
14
|
-
</details>
|
|
15
|
-
|
|
16
3
|
## Let's get started
|
|
17
4
|
|
|
18
5
|
To give you a quick idea of how the Powerhouse ecosystem operates on document models and packages, why don't you try installing a package?
|
|
@@ -109,7 +96,55 @@ Here, you'll see that you've installed the `@powerhousedao/todo-demo-package`, w
|
|
|
109
96
|
<figcaption>The Package Manager showing the installed todo-demo-package.</figcaption>
|
|
110
97
|
</figure>
|
|
111
98
|
|
|
112
|
-
## Step 4:
|
|
99
|
+
## Step 4: Create a todo list document
|
|
100
|
+
|
|
101
|
+
:::tip What is a 'drive' at Powerhouse?
|
|
102
|
+
A **drive** is a folder to store and organize your documents in. Powerhouse offers the ability to build customized 'Drive Apps' for your documents. Think of a Drive App as a specialized lens—it offers **different ways to visualize, organize, and interact with** the data stored within a drive, making it more intuitive and efficient for specific use cases. To learn more, visit [Building A Drive App](/academy/MasteryTrack/BuildingUserExperiences/BuildingADriveExplorer)
|
|
103
|
+
:::
|
|
104
|
+
|
|
105
|
+
### 4.1 Create a local todolist app drive
|
|
106
|
+
|
|
107
|
+
First, let's create a dedicated drive for your to-do lists:
|
|
108
|
+
|
|
109
|
+
- Click the new drive icon in the interface
|
|
110
|
+
- In the **Drive App** field, select 'To-do Drive App'
|
|
111
|
+
- This creates a specialized drive that's optimized for to-do list documents
|
|
112
|
+
|
|
113
|
+
### 4.2 Create a todolist document
|
|
114
|
+
|
|
115
|
+
Now move into the drive you've just created:
|
|
116
|
+
|
|
117
|
+
- Click the button at the bottom of the page to create a new to-do list document
|
|
118
|
+
- This opens the to-do list editor where you can start managing your tasks
|
|
119
|
+
|
|
120
|
+
### 4.3 Add a few todos and inspect the document history
|
|
121
|
+
|
|
122
|
+
- Add a few to-dos that are on your mind
|
|
123
|
+
- You'll see a statistics widget that counts the open to-dos
|
|
124
|
+
- After closing the document, look at the To-do Drive App interface—you'll see that it tracks your tasks and displays a progress bar
|
|
125
|
+
|
|
126
|
+
<figure className="image-container">
|
|
127
|
+
<img src={require("./images/TodoDriveApp.png").default} alt="Todo Drive App" />
|
|
128
|
+
<figcaption>A list of todo's in the custom todo drive app. </figcaption>
|
|
129
|
+
</figure>
|
|
130
|
+
|
|
131
|
+
A key feature you get with Connect is the **Operations History**. Every change to a document is stored as an individual operation, creating an immutable and replayable history. This provides complete auditability and transparency, as you can inspect each revision, its details, and any associated signatures. For example, you can see a chronological list of all modifications, along with who made them and when.
|
|
132
|
+
|
|
133
|
+
<figure className="image-container">
|
|
134
|
+
<img src={require("./images/OperationsHistoryButton.png").default} alt="Operations History Button" />
|
|
135
|
+
<figcaption> You can find the button to visit the operations history in the document model toolbar </figcaption>
|
|
136
|
+
</figure>
|
|
137
|
+
|
|
138
|
+
<figure className="image-container">
|
|
139
|
+
<img src={require("./images/OperationsHistory.png").default} alt="Operations History" />
|
|
140
|
+
<figcaption>Example of the operations history for a document, showing all modifications made to it in a list. </figcaption>
|
|
141
|
+
</figure>
|
|
142
|
+
|
|
143
|
+
Learn more about the [Operations History](../MasteryTrack/BuildingUserExperiences/DocumentTools/OperationHistory) and other document tools you get for free.
|
|
144
|
+
|
|
145
|
+
This is the power of Drive Apps. They offer a customized interface that works well with the different documents inside your drive. Read more about drive apps in the Mastery Track: [Drive Apps and Drive Explorers](/academy/MasteryTrack/BuildingUserExperiences/BuildingADriveExplorer).
|
|
146
|
+
|
|
147
|
+
## Step 5: Enable operation signing and verification through Renown
|
|
113
148
|
|
|
114
149
|
Renown is Powerhouse's **decentralized identity and reputation system** designed to address the challenge of trust within open organizations, where contributors often operate under pseudonyms. In traditional organizations, personal identity and reputation are key to establishing trust and accountability. Renown replicates this dynamic in the digital space, allowing contributors to earn experience and build reputation without revealing their real-world identities.
|
|
115
150
|
|
|
@@ -117,16 +152,18 @@ Renown is Powerhouse's **decentralized identity and reputation system** designed
|
|
|
117
152
|
When signing in with Renown, use an Ethereum or blockchain address that can function as your 'identity', as this address will accrue more experience and history over time.
|
|
118
153
|
:::
|
|
119
154
|
|
|
120
|
-
###
|
|
121
|
-
|
|
155
|
+
### 5.1 Click the renown icon and connect your eth identity
|
|
156
|
+
|
|
157
|
+
"**Log in with Renown**" is a decentralized authentication flow that enables you to log into applications by signing a credential with your Ethereum wallet. Upon signing in, a Decentralized Identifier (DID) is created based on your Ethereum key.
|
|
122
158
|
|
|
123
159
|
<figure className="image-container">
|
|
124
160
|
<img src={require("./images/RenownLogin.png").default} alt="Renown Login" />
|
|
125
161
|
<figcaption>The Renown login screen, prompting for a signature from a wallet.</figcaption>
|
|
126
162
|
</figure>
|
|
127
163
|
|
|
128
|
-
###
|
|
129
|
-
|
|
164
|
+
### 5.2 Authorize Connect to sign document edits on your behalf
|
|
165
|
+
|
|
166
|
+
This DID is then associated with a credential that authorizes a specific Connect instance to act on your behalf. That credential is stored securely on Ceramic, a decentralized data network. When you perform actions through the Powerhouse Connect interface, those operations are signed with the DID and transmitted to Switchboard, which serves as the verifier.
|
|
130
167
|
|
|
131
168
|
<figure className="image-container">
|
|
132
169
|
<img src={require("./images/ConnectAddress.png").default} alt="Connect Address for DID" />
|
|
@@ -138,45 +175,17 @@ This DID is then associated with a credential that authorizes a specific Connect
|
|
|
138
175
|
<figcaption>Confirmation of a successful login with Renown.</figcaption>
|
|
139
176
|
</figure>
|
|
140
177
|
|
|
141
|
-
###
|
|
142
|
-
**Switchboard**, our (remote & local) data processing engine, acts as a verifier in the Renown authentication flow. Switchboard checks the validity of the DID and credential, ensuring the operation request is legitimate. This flow is designed to offer a verifiable, cryptographically secure login system that replaces traditional password-based authentication with decentralized identity and signature-based trust.
|
|
178
|
+
### 5.3 Verify the signatures of new operations in the todo list
|
|
143
179
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
<figure className="image-container">
|
|
147
|
-
<img src={require("./images/OperationsHistory.png").default} alt="Operations History" />
|
|
148
|
-
<figcaption>Example of the operations history for a document, showing all modifications made to it in a list. </figcaption>
|
|
149
|
-
</figure>
|
|
180
|
+
By leveraging this system, every operation or modification made to a document is cryptographically signed by the contributor's Renown identity. This ensures that each change is verifiable, traceable, and attributable to a specific pseudonymous user, providing a robust audit trail for all document activity.
|
|
150
181
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
A key feature you get with Connect is the **Operations History**. Every change to a document is stored as an individual operation, creating an immutable and replayable history. This provides complete auditability and transparency, as you can inspect each revision, its details, and any associated signatures. For example, you can see a chronological list of all modifications, along with who made them and when. This ensures every action is traceable and verifiable.
|
|
154
|
-
Learn more about the [Operations History](../MasteryTrack/BuildingUserExperiences/DocumentTools/OperationHistory) and other document tools you get for free.
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
### 5.1 Create a to-do list
|
|
158
|
-
|
|
159
|
-
Now, move back to your local drive and create a to-do list. Add a few to-dos that are on your mind. You'll see a statistics widget that counts the open to-dos.
|
|
160
|
-
|
|
161
|
-
### 5.2 Create a specific to-do drive app
|
|
162
|
-
|
|
163
|
-
:::tip What is a 'drive' at Powerhouse?
|
|
164
|
-
A **drive** is a folder to store and organize your documents in. Powerhouse offers the ability to build customized 'Drive Apps' for your documents. Think of a Drive App as a specialized lens—it offers **different ways to visualize, organize, and interact with** the data stored within a drive, making it more intuitive and efficient for specific use cases. To learn more, visit [Building A Drive App](/academy/MasteryTrack/BuildingUserExperiences/BuildingADriveExplorer)
|
|
165
|
-
:::
|
|
166
|
-
|
|
167
|
-
Since your previous to-do list was created inside a local drive with a general-purpose drive explorer, it didn't look particularly special.
|
|
168
|
-
|
|
169
|
-
- Now let's create a new drive by clicking the new drive icon. In the **Drive App** field, select 'To-do Drive App'.
|
|
170
|
-
- Now move into the drive you've just created and create a new to-do list by clicking the button at the bottom of the page.
|
|
171
|
-
- Add a new set of random to-dos
|
|
172
|
-
- After closing the document, look at the To-do Drive App interface. You'll see that it tracks your tasks and displays a progress bar.
|
|
182
|
+
Now, return to your to-do list and make some additional changes. You'll notice that these operations are now signed with your Renown identity, making every action traceable and verifiable in the operations history.
|
|
173
183
|
|
|
174
184
|
<figure className="image-container">
|
|
175
|
-
<img src={require("./images/
|
|
176
|
-
<figcaption>
|
|
185
|
+
<img src={require("./images/OperationsHistorySignature.png").default} alt="Operation History Signature" />
|
|
186
|
+
<figcaption>Your DID is now signing the operations that are being added to the history.</figcaption>
|
|
177
187
|
</figure>
|
|
178
188
|
|
|
179
|
-
This is the power of Drive Apps. They offer a customized interface that works well with the different documents inside your drive. Read more about drive apps in the Mastery Track: [Drive Apps and Drive Explorers](/academy/MasteryTrack/BuildingUserExperiences/BuildingADriveExplorer).
|
|
180
189
|
## Step 6: Export a document
|
|
181
190
|
|
|
182
191
|
Export the document as a `.phd` (Powerhouse Document) file using the export button in the document toolbar at the top. In this toolbar, you will find all available functionality for your documents. The `.phd` file can be sent through any of your preferred channels to other users on your network.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Create a to-do list document
|
|
1
|
+
# Create a new to-do list document
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
4
|
This tutorial guides you through creating a simplified version of a 'Powerhouse project' for a **To-do List**.
|
|
@@ -18,52 +18,32 @@ Create a new Powerhouse project with a single command:
|
|
|
18
18
|
```bash
|
|
19
19
|
ph init
|
|
20
20
|
```
|
|
21
|
-
<details>
|
|
22
|
-
<summary>How to use different branches</summary>
|
|
23
|
-
|
|
24
|
-
When installing or using the Powerhouse CLI commands you are able to make use of the dev & staging branches.
|
|
25
|
-
These branches contain more experimental features then the latest stable release the PH CLI uses by default.
|
|
26
|
-
They can be used to get access to a bugfix or features under development.
|
|
27
|
-
|
|
28
|
-
| Command | Description |
|
|
29
|
-
|---------|-------------|
|
|
30
|
-
| **pnpm install -g ph-cmd** | Install latest stable version |
|
|
31
|
-
| **pnpm install -g ph-cmd@dev** | Install development version |
|
|
32
|
-
| **pnpm install -g ph-cmd@staging** | Install staging version |
|
|
33
|
-
| **ph init** | Use latest stable version of the boilerplate |
|
|
34
|
-
| **ph init --dev** | Use development version of the boilerplate |
|
|
35
|
-
| **ph init --staging** | Use staging version of the boilerplate |
|
|
36
|
-
| **ph use** | Switch all dependencies to latest production versions |
|
|
37
|
-
| **ph use dev** | Switch all dependencies to development versions |
|
|
38
|
-
| **ph use prod** | Switch all dependencies to production versions |
|
|
39
|
-
|
|
40
|
-
Please be aware that these versions can contain bugs and experimental features that aren't fully tested.
|
|
41
|
-
</details>
|
|
42
21
|
|
|
43
22
|
## Before you begin
|
|
44
23
|
1. Open your terminal (either your system terminal or IDE's integrated terminal)
|
|
45
|
-
2.
|
|
24
|
+
2. Optionally, create a folder first to keep your Powerhouse projects:
|
|
46
25
|
|
|
47
26
|
```bash
|
|
48
|
-
|
|
27
|
+
mkdir ph-projects
|
|
28
|
+
cd ph-projects
|
|
49
29
|
```
|
|
50
30
|
3. Ensure you're in the correct directory before running the `ph init` command.
|
|
51
31
|
In the terminal, you will be asked to enter the project name. Fill in the project name and press Enter.
|
|
52
32
|
```bash
|
|
53
|
-
you@yourmachine:~/
|
|
33
|
+
you@yourmachine:~/ph-projects % ph init
|
|
54
34
|
|
|
55
|
-
? What is the project name? ‣
|
|
35
|
+
? What is the project name? ‣ getting-started
|
|
56
36
|
```
|
|
57
37
|
|
|
58
38
|
Once the project is created, you will see the following output:
|
|
59
39
|
```bash
|
|
60
|
-
Initialized empty Git repository in /Users/
|
|
40
|
+
Initialized empty Git repository in /Users/you/ph-projects/getting-started/.git/
|
|
61
41
|
The installation is done!
|
|
62
42
|
```
|
|
63
43
|
|
|
64
44
|
Navigate to the newly created project directory:
|
|
65
45
|
```bash
|
|
66
|
-
cd
|
|
46
|
+
cd getting-started
|
|
67
47
|
```
|
|
68
48
|
Once in the project directory, run the `ph connect` command to start a local instance of the Connect application. This allows you to start your document model specification document.
|
|
69
49
|
Run the following command to start the Connect application:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Write the document specification
|
|
2
2
|
|
|
3
3
|
In this tutorial, you will learn how to define the specifications for a **To-do List** document model within the Connect application using its GraphQL schema, and then export the resulting document model specification document for your Powerhouse project.
|
|
4
4
|
If you don't have a document specification file created yet, have a look at the previous step of this tutorial to create a new document specification.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Configure a drive
|
|
2
2
|
|
|
3
|
-
A drive in Powerhouse is a container
|
|
3
|
+
A drive in Powerhouse is a container for documents and data. It's a place where you can organize and store your documents and share them with others. This guide walks you through configuring and managing drives in your Powerhouse environment.
|
|
4
4
|
|
|
5
5
|
:::info **Prerequisites**
|
|
6
6
|
|
|
@@ -14,64 +14,74 @@ Before configuring a drive, ensure you have:
|
|
|
14
14
|
|
|
15
15
|
### Local drives
|
|
16
16
|
|
|
17
|
-
A local drive is a container for local documents and data, hosted on your local machine. Technically a drive is
|
|
17
|
+
A local drive is a container for local documents and data, hosted on your local machine. Technically, a drive is itself a document that contains a list of the documents inside it. When you run Connect locally with `ph connect`, a local drive is automatically added. You can also create a new local drive by clicking **'Create New Drive'** in Connect.
|
|
18
18
|
|
|
19
19
|
### Remote drives vs. reactors
|
|
20
20
|
|
|
21
|
-
Remote drives in Powerhouse allow you to connect to and work with data stored in external systems or cloud services. These drives act as bridges between Powerhouse contributors
|
|
21
|
+
Remote drives in Powerhouse allow you to connect to and work with data stored in external systems or cloud services. These drives act as bridges between Powerhouse contributors or other data sources, enabling seamless data synchronization. Drives can exist in three types of locations:
|
|
22
22
|
|
|
23
23
|
- **Local Storage**: For offline or on-device access.
|
|
24
24
|
- **Cloud Storage**: For centralized, scalable data management.
|
|
25
25
|
- **Decentralized Storage**: Such as Ceramic or IPFS, enabling distributed and blockchain-based storage options.
|
|
26
26
|
|
|
27
27
|
:::tip **Explainer**
|
|
28
|
-
**Powerhouse Reactors** are the nodes in the network that store and
|
|
29
|
-
Reactors can be configured for local storage, centralized cloud storage or
|
|
28
|
+
**Powerhouse Reactors** are the nodes in the network that store and synchronize documents and drives, resolve conflicts, and rerun operations to verify document event histories.
|
|
29
|
+
Reactors can be configured for local storage, centralized cloud storage, or a decentralized storage network.
|
|
30
30
|
|
|
31
|
-
A reactor allows you to store multiple documents
|
|
31
|
+
A reactor allows you to store multiple documents and host **drives** and Drive Explorers with different organizational purposes, users, access rights, and more.
|
|
32
32
|
:::
|
|
33
33
|
|
|
34
|
-
A drive
|
|
34
|
+
A drive uses a reactor and its underlying storage layer. A reactor is the low-level component that enables the synchronization of documents and drives.
|
|
35
35
|
|
|
36
36
|
### Drive apps
|
|
37
37
|
|
|
38
|
-
**Drive Explorers** (also known as Drive Apps) are specialized interfaces that enhance how users interact with
|
|
38
|
+
**Drive Explorers** (also known as Drive Apps) are specialized interfaces that enhance how users interact with documents within a drive. As mentioned, a drive is technically just another document containing a list of other documents. This means you can create a custom editor for your drive document.
|
|
39
39
|
|
|
40
|
-
These customized editors are called Drive
|
|
40
|
+
These customized editors are called Drive Explorers or Drive Apps. They provide custom views, organization tools, and interactive features tailored to specific use cases. For example, a Drive Explorer might present data as a Kanban board, provide aggregated insights, or offer specialized widgets for data processing.
|
|
41
41
|
|
|
42
42
|
To learn more about building and customizing Drive Explorers, check out our [Building a Drive Explorer](/academy/MasteryTrack/BuildingUserExperiences/BuildingADriveExplorer) guide.
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
## Creating a new drive
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
<figure className="image-container">
|
|
48
|
+
<img src={require("./images/CreateDrive.png").default} alt="Create a new drive" />
|
|
49
|
+
<figcaption>The drive management modal after clicking the 'Create New Drive' button.</figcaption>
|
|
50
|
+
</figure>
|
|
48
51
|
|
|
49
52
|
To create a new drive in Powerhouse, follow these steps:
|
|
50
|
-
1. Click
|
|
53
|
+
1. Click the "**Create New Drive**" button in the Connect interface or the **+** icon in the Connect sidebar.
|
|
51
54
|
2. In the modal that appears, enter a name for your drive in the "**Drive Name**" field.
|
|
52
55
|
3. Select the desired Drive App (such as the Generic Drive Explorer, or any other Drive App you've installed).
|
|
53
56
|
4. Choose the location for your drive: **Local** (only available to you), **Cloud** (available to people in this drive), or **Public** (available to everyone).
|
|
54
57
|
5. (Optional) Enable the "Make available offline" toggle if you want to keep a local backup of your drive.
|
|
55
58
|
6. Once all options are set, click the "Create new drive" button to finalize and create your drive.
|
|
56
59
|
|
|
57
|
-
##
|
|
60
|
+
## Add a new remote drive via GraphQL mutation
|
|
58
61
|
|
|
59
62
|
You can also add a new remote drive to your Connect environment programmatically using GraphQL mutations. This is especially useful for automation, scripting, or integrating with external systems.
|
|
60
63
|
|
|
61
64
|
:::info **Prerequisites**
|
|
62
|
-
- Access to the Switchboard or remote reactor (server node) of your Connect instance.
|
|
63
|
-
|
|
65
|
+
- Access to the Switchboard or remote reactor (server node) of your Connect instance. In your local project, you can start your Reactor by running the following command in a different terminal from Connect Studio.
|
|
66
|
+
`bash
|
|
67
|
+
ph reactor
|
|
68
|
+
`
|
|
69
|
+
- The GraphQL endpoint of your instance. For example, for the staging environment, use: `https://staging.switchboard.phd/graphql/system` (this is a supergraph gateway. Read more about [subgraphs and supergraphs here](/academy/MasteryTrack/WorkWithData/WorkingWithSubgraphs).
|
|
64
70
|
- Appropriate permissions to perform mutations.
|
|
65
71
|
:::
|
|
66
72
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
73
|
+
<figure className="image-container">
|
|
74
|
+
<img src={require("./images/CreateNewDrive.png").default} alt="Create a new drive" />
|
|
75
|
+
<figcaption>The GraphQL interface for creating a new drive through a mutation.</figcaption>
|
|
76
|
+
</figure>
|
|
70
77
|
|
|
71
|
-
|
|
78
|
+
### 1. **Navigate to the GraphQL Playground or use a GraphQL client**
|
|
79
|
+
- Open [https://switchboard.phd/graphql/system](https://switchboard.phd/graphql/system) in your browser, or use a tool like [GraphQL Playground](https://www.apollographql.com/docs/apollo-server/testing/graphql-playground/).
|
|
80
|
+
|
|
81
|
+
### 2. **Prepare the Mutation**
|
|
72
82
|
- Use the following mutation to create a new drive:
|
|
73
83
|
|
|
74
|
-
```graphql
|
|
84
|
+
```graphql title="Create Drive Mutation"
|
|
75
85
|
mutation Mutation($name: String!, $icon: String, $addDriveId: String, $slug: String) {
|
|
76
86
|
addDrive(name: $name, icon: $icon, id: $addDriveId, slug: $slug) {
|
|
77
87
|
icon
|
|
@@ -82,8 +92,8 @@ You can also add a new remote drive to your Connect environment programmatically
|
|
|
82
92
|
}
|
|
83
93
|
```
|
|
84
94
|
|
|
85
|
-
-
|
|
86
|
-
```json
|
|
95
|
+
- These are the example variables, feel free to change these as you like and add a different name or logo for your drive:
|
|
96
|
+
```json title="Example Variables"
|
|
87
97
|
{
|
|
88
98
|
"name": "AcademyTest",
|
|
89
99
|
"icon": "https://static.thenounproject.com/png/3009860-200.png",
|
|
@@ -91,12 +101,12 @@ You can also add a new remote drive to your Connect environment programmatically
|
|
|
91
101
|
"slug": null
|
|
92
102
|
}
|
|
93
103
|
```
|
|
94
|
-
- You can also provide a custom `id
|
|
104
|
+
- You can also provide a custom `id` or `slug` if needed.
|
|
95
105
|
|
|
96
|
-
3. **Execute the Mutation**
|
|
106
|
+
### 3. **Execute the Mutation**
|
|
97
107
|
- Run the mutation. On success, you will receive a response containing the new drive's `icon`, `id`, `name`, and `slug`:
|
|
98
108
|
|
|
99
|
-
```json
|
|
109
|
+
```json title="Successful Response"
|
|
100
110
|
{
|
|
101
111
|
"data": {
|
|
102
112
|
"addDrive": {
|
|
@@ -109,16 +119,30 @@ You can also add a new remote drive to your Connect environment programmatically
|
|
|
109
119
|
}
|
|
110
120
|
```
|
|
111
121
|
|
|
112
|
-
4. **Construct the Drive URL**
|
|
122
|
+
### 4. **Construct the Drive URL**
|
|
113
123
|
- Once you have the `id` or `slug`, you can construct the drive URL for Connect:
|
|
114
|
-
- Format: `domain/d
|
|
115
|
-
-
|
|
124
|
+
- Format: `domain/d/<driveId>` or `domain/d/<driveSlug>`
|
|
125
|
+
- Depending on whether you are using a hosted or a local environment, the domain in your URL will change.
|
|
126
|
+
- Example: `https://connect.phd/d/6461580b-d317-4596-942d-f6b3d1bfc8fd`
|
|
127
|
+
- Example: `https://localhost:4001/d/6461580b-d317-4596-942d-f6b3d1bfc8fd`
|
|
128
|
+
|
|
129
|
+
### 5. **Add the Drive in Connect**
|
|
130
|
+
- Use the constructed URL to add or access the drive in your Connect environment via the 'Add Drive' button.
|
|
116
131
|
|
|
117
|
-
|
|
118
|
-
|
|
132
|
+
<figure className="image-container">
|
|
133
|
+
<img src={require("./images/AddDrive.png").default} alt="Create a new drive" />
|
|
134
|
+
<figcaption>The 'Add Drive' button that allows you to enter your constructed Drive URL.</figcaption>
|
|
135
|
+
</figure>
|
|
119
136
|
|
|
120
137
|
---
|
|
121
138
|
|
|
122
139
|
This approach allows you to automate drive creation and integration with other systems, making it easy to manage drives at scale.
|
|
123
140
|
|
|
141
|
+
## Up next
|
|
142
|
+
|
|
143
|
+
You've now experienced the use of GraphQL to modify or read data captured in Powerhouse for the first time.
|
|
144
|
+
You can now either continue with:
|
|
145
|
+
- User interfaces and [build a custom drive experiences](/academy/MasteryTrack/BuildingUserExperiences/BuildingADriveExplorer)
|
|
146
|
+
- Keep playing with data and the [Switchboard API](/academy/MasteryTrack/WorkWithData/ReadingAndWritingThroughTheAPI)
|
|
124
147
|
|
|
148
|
+
Enjoy!
|
|
Binary file
|