@powerhousedao/academy 3.2.0-dev.2 → 3.2.0-dev.4
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 +20 -0
- package/docs/academy/01-GetStarted/00-ExploreDemoPackage.mdx +188 -0
- package/docs/academy/01-GetStarted/01-CreateNewPowerhouseProject.md +10 -12
- package/docs/academy/01-GetStarted/02-DefineToDoListDocumentModel.md +8 -8
- package/docs/academy/01-GetStarted/03-ImplementOperationReducers.md +11 -11
- package/docs/academy/01-GetStarted/04-BuildToDoListEditor.md +13 -13
- package/docs/academy/01-GetStarted/_04-BuildToDoListEditor +12 -12
- package/docs/academy/01-GetStarted/home.mdx +50 -51
- package/docs/academy/01-GetStarted/images/Connect.png +0 -0
- package/docs/academy/01-GetStarted/images/Packagemanager.png +0 -0
- package/docs/academy/01-GetStarted/images/TodoDriveApp.png +0 -0
- package/docs/academy/01-GetStarted/styles.module.css +7 -14
- package/docs/academy/02-MasteryTrack/01-BuilderEnvironment/02-StandardDocumentModelWorkflow.md +25 -24
- package/docs/academy/02-MasteryTrack/01-BuilderEnvironment/03-BuilderTools.md +17 -17
- package/docs/academy/02-MasteryTrack/01-BuilderEnvironment/_category_.json +1 -1
- package/docs/academy/02-MasteryTrack/02-DocumentModelCreation/01-WhatIsADocumentModel.md +15 -15
- package/docs/academy/02-MasteryTrack/02-DocumentModelCreation/02-SpecifyTheStateSchema.md +11 -9
- package/docs/academy/02-MasteryTrack/02-DocumentModelCreation/03-SpecifyDocumentOperations.md +15 -15
- package/docs/academy/02-MasteryTrack/02-DocumentModelCreation/04-UseTheDocumentModelGenerator.md +9 -9
- package/docs/academy/02-MasteryTrack/02-DocumentModelCreation/05-ImplementDocumentReducers.md +15 -15
- package/docs/academy/02-MasteryTrack/02-DocumentModelCreation/06-ImplementDocumentModelTests.md +14 -14
- package/docs/academy/02-MasteryTrack/02-DocumentModelCreation/07-ExampleToDoListRepository.md +6 -6
- package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/01-BuildingDocumentEditors.md +31 -32
- package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/02-ConfiguringDrives.md +7 -9
- package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/03-BuildingADriveExplorer.md +485 -92
- package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/07-DocumentTools/{00-DocumentToolbar.md → 00-DocumentToolbar.mdx} +7 -2
- package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/07-DocumentTools/01-OperationHistory.md +12 -12
- package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/07-DocumentTools/02-RevisionHistoryTimeline.md +18 -7
- package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/07-DocumentTools/images/DocumentToolbar.png +0 -0
- package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/07-DocumentTools/images/revision-history-timeline.png +0 -0
- package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/08-Authorization/01-RenownAuthenticationFlow.md +22 -11
- package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/08-Authorization/02-Authorization.md +8 -8
- package/docs/academy/02-MasteryTrack/04-WorkWithData/01-ReadingAndWritingThroughTheAPI.mdx +13 -19
- package/docs/academy/02-MasteryTrack/04-WorkWithData/02-GraphQLAtPowerhouse.md +3 -3
- package/docs/academy/02-MasteryTrack/04-WorkWithData/03-WorkingWithSubgraphs/02-GraphQLAndSubgraphs.mdx +8 -8
- package/docs/academy/02-MasteryTrack/04-WorkWithData/03-WorkingWithSubgraphs/03-WorkingWithSubgraphs.md +28 -28
- package/docs/academy/02-MasteryTrack/04-WorkWithData/04-analytics-processor.md +4 -4
- package/docs/academy/02-MasteryTrack/04-WorkWithData/05-AnalyticsProcessorTutorial/01-SetupBuilderEnvironment.md +14 -14
- package/docs/academy/02-MasteryTrack/04-WorkWithData/05-AnalyticsProcessorTutorial/02-CreateNewPowerhouseProject.md +2 -2
- package/docs/academy/02-MasteryTrack/04-WorkWithData/05-AnalyticsProcessorTutorial/03-GenerateAnAnalyticsProcessor.md +6 -6
- package/docs/academy/02-MasteryTrack/04-WorkWithData/05-AnalyticsProcessorTutorial/04-UpdateAnalyticsProcessor.md +1 -1
- package/docs/academy/02-MasteryTrack/04-WorkWithData/06-Analytics Engine/GraphQL References/QueryingADocumentWithGraphQL.md +2 -2
- package/docs/academy/02-MasteryTrack/04-WorkWithData/06-Analytics Engine/best-practices.md +4 -4
- package/docs/academy/02-MasteryTrack/04-WorkWithData/06-Analytics Engine/graphql/index.md +7 -7
- package/docs/academy/02-MasteryTrack/04-WorkWithData/06-Analytics Engine/graphql/integration.md +1 -1
- package/docs/academy/02-MasteryTrack/04-WorkWithData/06-Analytics Engine/intro.md +6 -6
- package/docs/academy/02-MasteryTrack/04-WorkWithData/06-Analytics Engine/typescript/browser.md +1 -1
- package/docs/academy/02-MasteryTrack/04-WorkWithData/06-Analytics Engine/typescript/index.md +5 -5
- package/docs/academy/02-MasteryTrack/04-WorkWithData/06-Analytics Engine/typescript/memory.md +1 -1
- package/docs/academy/02-MasteryTrack/04-WorkWithData/06-Analytics Engine/typescript/pg.md +2 -2
- package/docs/academy/02-MasteryTrack/04-WorkWithData/06-Analytics Engine/typescript/schema.md +1 -1
- package/docs/academy/02-MasteryTrack/04-WorkWithData/06-Analytics Engine/typescript/utilities.md +1 -1
- package/docs/academy/02-MasteryTrack/04-WorkWithData/06-Analytics Engine/use-cases/index.md +1 -1
- package/docs/academy/02-MasteryTrack/04-WorkWithData/06-Analytics Engine/use-cases/maker.md +12 -12
- package/docs/academy/02-MasteryTrack/05-Launch/01-IntroductionToPackages.md +9 -9
- package/docs/academy/02-MasteryTrack/05-Launch/02-PublishYourProject.md +8 -8
- package/docs/academy/02-MasteryTrack/05-Launch/03-SetupEnvironment.md +35 -35
- package/docs/academy/02-MasteryTrack/05-Launch/04-ConfigureEnvironment.md +8 -8
- package/docs/academy/02-MasteryTrack/_category_.json +1 -1
- package/docs/academy/03-ExampleUsecases/Chatroom/03-DefineChatroomDocumentModel.md +5 -5
- package/docs/academy/04-APIReferences/01-ReactHooks.md +209 -0
- package/docs/academy/07-Cookbook.md +105 -105
- package/package.json +1 -1
- package/sidebars.ts +9 -10
- package/src/css/custom.css +18 -0
- package/docs/academy/01-GetStarted/00-ExploreDemoPackage.md +0 -88
- package/docs/academy/04-APIReferences/01-ReactHooks +0 -98
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
## 3.2.0-dev.4 (2025-06-25)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- added drive analytics processor ([#1607](https://github.com/powerhouse-inc/powerhouse/pull/1607))
|
|
6
|
+
|
|
7
|
+
### ❤️ Thank You
|
|
8
|
+
|
|
9
|
+
- Guillermo Puente Sandoval
|
|
10
|
+
|
|
11
|
+
## 3.2.0-dev.3 (2025-06-24)
|
|
12
|
+
|
|
13
|
+
### 🩹 Fixes
|
|
14
|
+
|
|
15
|
+
- **connect, builder-tools:** disable external packages in dev mode ([e13243874](https://github.com/powerhouse-inc/powerhouse/commit/e13243874))
|
|
16
|
+
|
|
17
|
+
### ❤️ Thank You
|
|
18
|
+
|
|
19
|
+
- acaldas
|
|
20
|
+
|
|
1
21
|
## 3.2.0-dev.2 (2025-06-20)
|
|
2
22
|
|
|
3
23
|
This was a version bump only for @powerhousedao/academy to align it with other projects, there were no code changes.
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
# Explore the demo package
|
|
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
|
+
## Let's get started
|
|
17
|
+
|
|
18
|
+
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?
|
|
19
|
+
We will show you how to install the Powerhouse command-line tool `ph-cmd` and then use it to install a pre-built demo package with a document models, an editor and a drive-app.
|
|
20
|
+
|
|
21
|
+
## Step 1: Install the Powerhouse CLI
|
|
22
|
+
|
|
23
|
+
You will use the Powerhouse CLI to launch a local environment with a "To-do List Demo Package".
|
|
24
|
+
This is also the package that you'll recreate during the tutorials and gets you familiar with Powerhouse.
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pnpm install -g ph-cmd
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Verify the installation:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
ph-cmd --version
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Step 2: Install the to-do list demo package
|
|
37
|
+
|
|
38
|
+
Now, use the `ph` command to install the demo package into a global project.
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# Install the package
|
|
42
|
+
ph install @powerhousedao/todo-demo-package
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
This command downloads and sets up the `@powerhousedao/todo-demo-package`, making its features available in your Powerhouse environment.
|
|
46
|
+
|
|
47
|
+
<details>
|
|
48
|
+
<summary>Expected CLI result</summary>
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
installing dependencies 📦 ...
|
|
52
|
+
WARN 19 deprecated subdependencies found: @esbuild-kit/core-utils@3.3.2, @esbuild-kit/esm-loader@2.6.5, @npmcli/move-file@1.1.2, @paulmillr/qr@0.2.1, are-we-there-yet@3.0.1, gauge@4.0.4, glob@7.2.3, graphql-language-service-interface@2.10.2, graphql-language-service-parser@1.10.4, graphql-language-service-types@1.8.7, graphql-language-service-utils@2.7.1, inflight@1.0.6, multibase@4.0.6, multicodec@3.2.1, node-domexception@1.0.0, npmlog@6.0.2, rimraf@2.7.1, rimraf@3.0.2, sudo-prompt@8.2.5
|
|
53
|
+
Packages: +1
|
|
54
|
+
+
|
|
55
|
+
Progress: resolved 2277, reused 2106, downloaded 1, added 1, done
|
|
56
|
+
WARN Issues with peer dependencies found
|
|
57
|
+
.
|
|
58
|
+
├─┬ @powerhousedao/reactor-browser 3.1.0
|
|
59
|
+
│ └─┬ @powerhousedao/analytics-engine-browser 0.6.0
|
|
60
|
+
│ └── ✕ unmet peer @powerhousedao/analytics-engine-knex@0.5.1: found 0.6.0
|
|
61
|
+
├─┬ @types/react-dom 19.1.6
|
|
62
|
+
│ └── ✕ unmet peer @types/react@^19.0.0: found 18.3.23
|
|
63
|
+
└─┬ react-native 0.80.0
|
|
64
|
+
├── ✕ unmet peer @types/react@^19.1.0: found 18.3.23
|
|
65
|
+
├── ✕ unmet peer react@^19.1.0: found 18.3.1
|
|
66
|
+
└─┬ @react-native/virtualized-lists 0.80.0
|
|
67
|
+
└── ✕ unmet peer @types/react@^19.0.0: found 18.3.23
|
|
68
|
+
|
|
69
|
+
dependencies:
|
|
70
|
+
+ @powerhousedao/todo-demo-package 1.1.1
|
|
71
|
+
|
|
72
|
+
╭ Warning ───────────────────────────────────────────────────────────────────────────────────────────────╮
|
|
73
|
+
│ │
|
|
74
|
+
│ Ignored build scripts: @acaldas/graphql-codegen-typescript-validation-schema, @apollo/protobufjs, │
|
|
75
|
+
│ @datadog/pprof, @ipshipyard/node-datachannel, @parcel/watcher, @prisma/client, @prisma/engines, │
|
|
76
|
+
│ @tailwindcss/oxide, bufferutil, esbuild, keccak, prisma, sqlite3, utf-8-validate. │
|
|
77
|
+
│ Run "pnpm approve-builds" to pick which dependencies should be allowed to run scripts. │
|
|
78
|
+
│ │
|
|
79
|
+
╰────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
|
80
|
+
|
|
81
|
+
Done in 6s using pnpm v10.9.0
|
|
82
|
+
Dependency installed successfully 🎉
|
|
83
|
+
⚙️ Updating powerhouse config file...
|
|
84
|
+
Config file updated successfully 🎉
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
</details>
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
You have now successfully installed `ph-cmd` and added your first package!
|
|
91
|
+
|
|
92
|
+
## Step 3: Run the connect app in studio mode
|
|
93
|
+
To run the package locally in Connect Studio (our collaboration and contributor app), run:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
ph connect
|
|
97
|
+
```
|
|
98
|
+
Click the returned localhost URL and you should see Connect Studio appear in your browser.
|
|
99
|
+
<figure className="image-container">
|
|
100
|
+
<img src={require("./images/Connect.png").default} alt="Connect Home" />
|
|
101
|
+
<figcaption>The Powerhouse Connect Studio interface.</figcaption>
|
|
102
|
+
</figure>
|
|
103
|
+
|
|
104
|
+
When you move to the settingswheel in the bottom right corner you'll get access to the **Package Manager**.
|
|
105
|
+
Here, you'll see that you've installed the `@powerhousedao/todo-demo-package`, which contains not only a **Document Model** and its accompanying editor but also a **Drive App** specific to the to-do document model.
|
|
106
|
+
|
|
107
|
+
<figure className="image-container">
|
|
108
|
+
<img src={require("./images/Packagemanager.png").default} alt="Package Manager" />
|
|
109
|
+
<figcaption>The Package Manager showing the installed todo-demo-package.</figcaption>
|
|
110
|
+
</figure>
|
|
111
|
+
|
|
112
|
+
## Step 4: Log in with Renown
|
|
113
|
+
|
|
114
|
+
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
|
+
|
|
116
|
+
:::tip
|
|
117
|
+
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
|
+
:::
|
|
119
|
+
|
|
120
|
+
### Login flow
|
|
121
|
+
"**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
|
+
|
|
123
|
+
<figure className="image-container">
|
|
124
|
+
<img src={require("./images/RenownLogin.png").default} alt="Renown Login" />
|
|
125
|
+
<figcaption>The Renown login screen, prompting for a signature from a wallet.</figcaption>
|
|
126
|
+
</figure>
|
|
127
|
+
|
|
128
|
+
### Generate a DID to sign operations in Connect
|
|
129
|
+
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
|
+
|
|
131
|
+
<figure className="image-container">
|
|
132
|
+
<img src={require("./images/ConnectAddress.png").default} alt="Connect Address for DID" />
|
|
133
|
+
<figcaption>A newly generated DID and address shown within the Connect interface.</figcaption>
|
|
134
|
+
</figure>
|
|
135
|
+
|
|
136
|
+
<figure className="image-container">
|
|
137
|
+
<img src={require("./images/LoginComplete.png").default} alt="Renown Login Complete" />
|
|
138
|
+
<figcaption>Confirmation of a successful login with Renown.</figcaption>
|
|
139
|
+
</figure>
|
|
140
|
+
|
|
141
|
+
### Verifying signatures
|
|
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.
|
|
143
|
+
|
|
144
|
+
## Step 5: Create a to-do list and explore the document operations history
|
|
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>
|
|
150
|
+
|
|
151
|
+
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.
|
|
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.
|
|
173
|
+
|
|
174
|
+
<figure className="image-container">
|
|
175
|
+
<img src={require("./images/TodoDriveApp.png").default} alt="Operations History" />
|
|
176
|
+
<figcaption>A list of todo's in the custom todo drive app. </figcaption>
|
|
177
|
+
</figure>
|
|
178
|
+
|
|
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
|
+
## Step 6: Export a document
|
|
181
|
+
|
|
182
|
+
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.
|
|
183
|
+
|
|
184
|
+
### Up next
|
|
185
|
+
|
|
186
|
+
Now that you have explored a Powerhouse package and discovered its basic functionalities, it is time to start building your own.
|
|
187
|
+
Our next tutorial focuses on creating a simple to-do list document and will introduce you to the world of **Document Models**.
|
|
188
|
+
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
# Create a
|
|
1
|
+
# Create a to-do list document
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
|
-
This tutorial guides you through creating a simplified version of a 'Powerhouse project' for a **
|
|
4
|
+
This tutorial guides you through creating a simplified version of a 'Powerhouse project' for a **To-do List**.
|
|
5
5
|
A Powerhouse project primarily consists of a document model and its editor.
|
|
6
6
|
For this purpose, you'll be using Connect, our use-centric collaboration tool, locally, known as Connect in 'Studio mode'.
|
|
7
7
|
|
|
@@ -13,13 +13,13 @@ For this purpose, you'll be using Connect, our use-centric collaboration tool, l
|
|
|
13
13
|
|
|
14
14
|
If you need help with installing the prerequisites you can visit our page [prerequisites](/academy/MasteryTrack/BuilderEnvironment/Prerequisites)
|
|
15
15
|
|
|
16
|
-
## Quick
|
|
16
|
+
## Quick start
|
|
17
17
|
Create a new Powerhouse project with a single command:
|
|
18
18
|
```bash
|
|
19
19
|
ph init
|
|
20
20
|
```
|
|
21
21
|
<details>
|
|
22
|
-
<summary>
|
|
22
|
+
<summary>How to use different branches</summary>
|
|
23
23
|
|
|
24
24
|
When installing or using the Powerhouse CLI commands you are able to make use of the dev & staging branches.
|
|
25
25
|
These branches contain more experimental features then the latest stable release the PH CLI uses by default.
|
|
@@ -40,7 +40,7 @@ They can be used to get access to a bugfix or features under development.
|
|
|
40
40
|
Please be aware that these versions can contain bugs and experimental features that aren't fully tested.
|
|
41
41
|
</details>
|
|
42
42
|
|
|
43
|
-
## Before
|
|
43
|
+
## Before you begin
|
|
44
44
|
1. Open your terminal (either your system terminal or IDE's integrated terminal)
|
|
45
45
|
2. Navigate to your desired project directory using:
|
|
46
46
|
|
|
@@ -52,12 +52,12 @@ In the terminal, you will be asked to enter the project name. Fill in the projec
|
|
|
52
52
|
```bash
|
|
53
53
|
you@yourmachine:~/Powerhouse$ ph init
|
|
54
54
|
|
|
55
|
-
? What is the project name? ‣ <
|
|
55
|
+
? What is the project name? ‣ <ToDoList>
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
Once the project is created, you will see the following output:
|
|
59
59
|
```bash
|
|
60
|
-
Initialized empty Git repository in /Users/yourmachine/<
|
|
60
|
+
Initialized empty Git repository in /Users/yourmachine/<ToDoList>/.git/
|
|
61
61
|
The installation is done!
|
|
62
62
|
```
|
|
63
63
|
|
|
@@ -86,13 +86,11 @@ In the terminal, you will be asked to enter the project name. Fill in the projec
|
|
|
86
86
|
If you local drive is not present navigate into Settings in the bottom left corner. Settings > Danger Zone > Clear Storage.
|
|
87
87
|
Clear the storage of your localhost application as it might has an old session cached.
|
|
88
88
|
|
|
89
|
-
|
|
90
|
-
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)
|
|
91
|
-
:::
|
|
92
|
-
|
|
93
|
-
Move into your local drive.
|
|
89
|
+
4. Move into your local drive.
|
|
94
90
|
Create a new document model by clicking the `DocumentModel` button, found in the 'New Document' section at the bottom of the page.
|
|
95
91
|
|
|
96
92
|
If you've followed the steps correctly, you'll have an empty document where you can define the **'Document Specifications'**.
|
|
97
93
|
|
|
94
|
+
## Up next
|
|
95
|
+
|
|
98
96
|
In the next tutorials, you will learn how to specify, add code and build an editor for your document model and export it to be used in your Powerhouse package.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Define the
|
|
1
|
+
# Define the to-do list document specification
|
|
2
2
|
|
|
3
|
-
In this tutorial, you will learn how to define the specifications for a **
|
|
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.
|
|
5
5
|
|
|
6
6
|
Before you start, make sure you have the Connect application running locally with the command:
|
|
@@ -15,14 +15,14 @@ The Connect application will start and you will see the following output:
|
|
|
15
15
|
➜ press h + enter to show help
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
##
|
|
18
|
+
## To-do list document specification
|
|
19
19
|
|
|
20
20
|
Likely you have called your project 'ToDoList'.
|
|
21
21
|
If you've used a different name, please create a new document specification named 'ToDoList'.
|
|
22
22
|
**Pay close attention to capitalization, as it influences our code.**
|
|
23
23
|
|
|
24
24
|
We'll continue with this project to teach you how to create a document model specification and later an editor for your document model. We use the **GraphQL Schema Definition Language** (SDL) to define the schema for the document model.
|
|
25
|
-
Below, you can see the SDL for the `
|
|
25
|
+
Below, you can see the SDL for the `To-do List` document model.
|
|
26
26
|
|
|
27
27
|
:::info
|
|
28
28
|
This schema defines the **data structure** of the document model and the types involved in its operations, which are detailed further as input types.
|
|
@@ -30,7 +30,7 @@ Documents in Powerhouse leverage **event sourcing principles**, where every stat
|
|
|
30
30
|
:::
|
|
31
31
|
|
|
32
32
|
<details>
|
|
33
|
-
<summary>State
|
|
33
|
+
<summary>State schema of our simplified To-do list</summary>
|
|
34
34
|
|
|
35
35
|
```graphql
|
|
36
36
|
# The state of our ToDoList
|
|
@@ -50,7 +50,7 @@ type ToDoItem {
|
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
<details>
|
|
53
|
-
<summary>Operations
|
|
53
|
+
<summary>Operations schema of our simplified to-do list</summary>
|
|
54
54
|
```graphql
|
|
55
55
|
# Defines a GraphQL input type for adding a new to-do item
|
|
56
56
|
input AddTodoItemInput {
|
|
@@ -72,7 +72,7 @@ input DeleteTodoItemInput {
|
|
|
72
72
|
```
|
|
73
73
|
</details>
|
|
74
74
|
|
|
75
|
-
## Define the
|
|
75
|
+
## Define the document model specification
|
|
76
76
|
|
|
77
77
|
To be able to define the document model, you need to open the document model editor in Connect.
|
|
78
78
|
|
|
@@ -106,6 +106,6 @@ Check below screenshot for the complete implementation:
|
|
|
106
106
|
|
|
107
107
|

|
|
108
108
|
|
|
109
|
-
### Up next:
|
|
109
|
+
### Up next: reducers
|
|
110
110
|
|
|
111
111
|
Up next, you'll learn how to implement the runtime logic and components that will use the `ToDoList` document model specification you've just created and exported.
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
# Implement the
|
|
1
|
+
# Implement the document model
|
|
2
2
|
|
|
3
|
-
In this section, we will implement and test the operation reducers for the **
|
|
3
|
+
In this section, we will implement and test the operation reducers for the **To-do List** document model. For this, you have to export the document model specification from the Connect application and import it into your Powerhouse project directory.
|
|
4
4
|
|
|
5
5
|
To export the document model specification, follow the steps in the [Define ToDoList Document Model](/academy/GetStarted/DefineToDoListDocumentModel) section.
|
|
6
6
|
|
|
7
|
-
## Understanding
|
|
7
|
+
## Understanding reducers in document models
|
|
8
8
|
|
|
9
9
|
Reducers are a core concept in Powerhouse document models. They implement the state transition logic for each operation defined in your schema.
|
|
10
10
|
|
|
11
11
|
:::info
|
|
12
|
-
**Connection to
|
|
12
|
+
**Connection to schema definition language (SDL)**: The reducers directly implement the operations you defined in your SDL. Remember how we defined `AddTodoItemInput`, `UpdateTodoItemInput`, and `DeleteTodoItemInput` in our schema?
|
|
13
13
|
The reducers provide the actual implementation of what happens when those operations are performed.
|
|
14
14
|
:::
|
|
15
15
|
|
|
@@ -21,12 +21,12 @@ Either step will import the document model specification into your Powerhouse pr
|
|
|
21
21
|
|
|
22
22
|

|
|
23
23
|
|
|
24
|
-
## In your
|
|
24
|
+
## In your project directory
|
|
25
25
|
|
|
26
26
|
The next steps will take place in the VSCode editor. Make sure to have it open and the terminal window inside VSCode open as well.
|
|
27
27
|
|
|
28
28
|
|
|
29
|
-
To write the operation reducers of the **
|
|
29
|
+
To write the operation reducers of the **To-do List** document model, you need to generate the document model code from the document model specification file you have exported into the Powerhouse project directory.
|
|
30
30
|
|
|
31
31
|
To do this, run the following command in the terminal:
|
|
32
32
|
|
|
@@ -40,7 +40,7 @@ Open the `to-do-list.ts` file and you should see the code that needs to be fille
|
|
|
40
40
|
|
|
41
41
|

|
|
42
42
|
|
|
43
|
-
## Write the
|
|
43
|
+
## Write the operation reducers
|
|
44
44
|
|
|
45
45
|
1. Copy and paste the code below into the `to-do-list.ts` file in the `reducers` folder.
|
|
46
46
|
2. Save the file.
|
|
@@ -100,7 +100,7 @@ export const reducer: ToDoListToDoListOperations = {
|
|
|
100
100
|
```
|
|
101
101
|
</details>
|
|
102
102
|
|
|
103
|
-
## Write the
|
|
103
|
+
## Write the operation reducers tests
|
|
104
104
|
|
|
105
105
|
In order to make sure the operation reducers are working as expected, you need to write tests for them.
|
|
106
106
|
|
|
@@ -192,7 +192,7 @@ Output should be as follows:
|
|
|
192
192
|
Duration 417ms (transform 79ms, setup 0ms, collect 174ms, tests 12ms, environment 0ms, prepare 158ms)
|
|
193
193
|
```
|
|
194
194
|
|
|
195
|
-
If you got the same output, you have successfully implemented the operation reducers and tests for the **
|
|
195
|
+
If you got the same output, you have successfully implemented the operation reducers and tests for the **To-do List** document model. Congratulations, you've successfully set up the backbone for a simple **To-do List** document.
|
|
196
196
|
|
|
197
|
-
## Up
|
|
198
|
-
In the next chapter of this introduction track you will learn how to implement an editor for your document model so you can see a simple user interface for the **
|
|
197
|
+
## Up next: To-do list editor
|
|
198
|
+
In the next chapter of this introduction track you will learn how to implement an editor for your document model so you can see a simple user interface for the **To-do List** document model in action.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
# Build a
|
|
1
|
+
# Build a to-do list editor
|
|
2
2
|
|
|
3
|
-
In this chapter we will continue with the interface or editor implementation of the **
|
|
3
|
+
In this chapter we will continue with the interface or editor implementation of the **To-do List** document model. This means you will create a simple user interface for the **To-do List** document model which will be used inside the Connect app to create, update and delete your ToDoList items.
|
|
4
4
|
|
|
5
5
|
## Generate the editor template
|
|
6
6
|
|
|
7
|
-
Run the command below to generate the editor template for the **
|
|
8
|
-
This command reads the **
|
|
7
|
+
Run the command below to generate the editor template for the **To-do List** document model.
|
|
8
|
+
This command reads the **To-do List** document model definition from the `document-models` folder and generates the editor template in the `editors/to-do-list` folder as `editor.tsx`.
|
|
9
9
|
|
|
10
|
-
Notice the `--editor` flag which specifies the **
|
|
10
|
+
Notice the `--editor` flag which specifies the **To-do List** document model, and the `--document-types` flag defines the document type `powerhouse/todolist`.
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
13
|
ph generate --editor ToDoList --document-types powerhouse/todolist
|
|
@@ -16,7 +16,7 @@ ph generate --editor ToDoList --document-types powerhouse/todolist
|
|
|
16
16
|
Once complete, navigate to the `editors/to-do-list/editor.tsx` file and open it in your editor.
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
### Editor
|
|
19
|
+
### Editor implementation options
|
|
20
20
|
|
|
21
21
|
When building your editor component within the Powerhouse ecosystem, you have several options for styling, allowing you to leverage your preferred methods:
|
|
22
22
|
|
|
@@ -27,7 +27,7 @@ When building your editor component within the Powerhouse ecosystem, you have se
|
|
|
27
27
|
Connect Studio provides a dynamic local environment, by running `ph connect` to visualize your components instantly as you build them, regardless of the styling method you choose.
|
|
28
28
|
Manual build steps are typically only needed when publishing packages.
|
|
29
29
|
|
|
30
|
-
##
|
|
30
|
+
## To-do List editor
|
|
31
31
|
|
|
32
32
|
Below is the complete code for the To-Do List editor. Paste this code in `editors/to-do-list/editor.tsx`.
|
|
33
33
|
|
|
@@ -191,25 +191,25 @@ export default function Editor(props: IProps) {
|
|
|
191
191
|
```
|
|
192
192
|
</details>
|
|
193
193
|
|
|
194
|
-
Now you can run the Connect app and see the **
|
|
194
|
+
Now you can run the Connect app and see the **To-do List** editor in action.
|
|
195
195
|
|
|
196
196
|
```bash
|
|
197
197
|
ph connect
|
|
198
198
|
```
|
|
199
199
|
|
|
200
|
-
In Connect, in the bottom right corner you'll find a new Document Model that you can create: **
|
|
201
|
-
Click on it to create a new
|
|
200
|
+
In Connect, in the bottom right corner you'll find a new Document Model that you can create: **To-do List**.
|
|
201
|
+
Click on it to create a new To-do List document.
|
|
202
202
|
|
|
203
203
|
:::info
|
|
204
204
|
The editor will update dynamically, so you can play around with your editor styling while seeing your results appear in Connect Studio.
|
|
205
205
|
:::
|
|
206
206
|
|
|
207
207
|
Congratulations!
|
|
208
|
-
If you managed to follow this tutorial until this point, you have successfully implemented the **
|
|
208
|
+
If you managed to follow this tutorial until this point, you have successfully implemented the **To-do List** document model with its reducer operations and editor.
|
|
209
209
|
|
|
210
|
-
### Up
|
|
210
|
+
### Up next: Mastery Track
|
|
211
211
|
|
|
212
|
-
In the [Mastery Track chapther: Document Model Creation](/academy/MasteryTrack/DocumentModelCreation/WhatIsADocumentModel) we guide you through the theoretics of the previous steps while created a more advanced version of the
|
|
212
|
+
In the [Mastery Track chapther: Document Model Creation](/academy/MasteryTrack/DocumentModelCreation/WhatIsADocumentModel) we guide you through the theoretics of the previous steps while created a more advanced version of the To-do List.
|
|
213
213
|
|
|
214
214
|
You will learn:
|
|
215
215
|
- The in's & out's of a document model.
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
# Build a ToDoList Editor
|
|
2
2
|
|
|
3
|
-
In this chapter we will continue with the interface or editor implementation of the **
|
|
3
|
+
In this chapter we will continue with the interface or editor implementation of the **To-do List** document model. This means you will create a simple user interface for the **To-do List** document model which will be used inside the Connect app to create, update and delete your To-do List items, but also dispaly the statistics we've implemented in our reducers.
|
|
4
4
|
|
|
5
5
|
## Generate the editor template
|
|
6
6
|
|
|
7
|
-
Run the command below to generate the editor template for the **
|
|
8
|
-
This command reads the **
|
|
7
|
+
Run the command below to generate the editor template for the **To-do List** document model.
|
|
8
|
+
This command reads the **To-do List** document model definition from the `document-models` folder and generates the editor template in the `editors/to-do-list` folder as `editor.tsx`.
|
|
9
9
|
|
|
10
|
-
Notice the `--editor` flag which specifies the **
|
|
10
|
+
Notice the `--editor` flag which specifies the **To-do List** document model, and the `--document-types` flag defines the document type `powerhouse/todolist`.
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
13
|
ph generate --editor ToDoList --document-types powerhouse/todolist
|
|
@@ -28,7 +28,7 @@ Connect Studio provides a dynamic local environment (`ph connect`) to visualize
|
|
|
28
28
|
|
|
29
29
|
---
|
|
30
30
|
|
|
31
|
-
##
|
|
31
|
+
## To-do List Editor
|
|
32
32
|
|
|
33
33
|
:::tip
|
|
34
34
|
### Implementing Components
|
|
@@ -113,7 +113,7 @@ export const InputField = (props: InputFieldProps) => {
|
|
|
113
113
|
Below is the complete code for the To-Do List editor. It primarily uses Tailwind CSS for styling and imports the local `Checkbox` and `InputField` components you created in the previous step. These local components, in turn, utilize elements from the Powerhouse Document Engineering design system.
|
|
114
114
|
|
|
115
115
|
<details>
|
|
116
|
-
<summary>Complete
|
|
116
|
+
<summary>Complete To-do List Editor Example (using Tailwind CSS)</summary>
|
|
117
117
|
|
|
118
118
|
```typescript
|
|
119
119
|
import { EditorProps } from 'document-model'; // Core type for editor components.
|
|
@@ -337,24 +337,24 @@ export default function Editor(props: IProps) {
|
|
|
337
337
|
```
|
|
338
338
|
</details>
|
|
339
339
|
|
|
340
|
-
Now you can run the Connect app and see the **
|
|
340
|
+
Now you can run the Connect app and see the **to-do list** editor in action.
|
|
341
341
|
|
|
342
342
|
```bash
|
|
343
343
|
ph connect
|
|
344
344
|
```
|
|
345
345
|
|
|
346
|
-
In Connect, in the bottom right corner you'll find a new Document Model that you can create: **
|
|
347
|
-
Click on it to create a new
|
|
346
|
+
In Connect, in the bottom right corner you'll find a new Document Model that you can create: **to-do list**.
|
|
347
|
+
Click on it to create a new to-do list document.
|
|
348
348
|
|
|
349
349
|
:::info
|
|
350
350
|
The editor will update dynamically, so you can play around with your editor styling while seeing your results appear in Connect Studio.
|
|
351
351
|
:::
|
|
352
352
|
|
|
353
353
|
Congratulations!
|
|
354
|
-
If you managed to follow this tutorial until this point, you have successfully implemented the **
|
|
354
|
+
If you managed to follow this tutorial until this point, you have successfully implemented the **to-do list** document model with its reducer operations and editor.
|
|
355
355
|
|
|
356
|
-
Now you can move on to creating a [custom drive explorer](/academy/MasteryTrack/BuildingUserExperiences/BuildingADriveExplorer) for your
|
|
357
|
-
Imagine you have many
|
|
356
|
+
Now you can move on to creating a [custom drive explorer](/academy/MasteryTrack/BuildingUserExperiences/BuildingADriveExplorer) for your to-do list document.
|
|
357
|
+
Imagine you have many to-do Lists sitting in a drive. A custom drive explorer will allow you to organize and track them at a glance, opening up a new world of possibilities to increase the functionality of your documents!
|
|
358
358
|
|
|
359
359
|
|
|
360
360
|
|