@powerhousedao/academy 5.1.0-dev.14 → 5.1.0-dev.17
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 +29 -0
- package/docs/academy/01-GetStarted/00-ExploreDemoPackage.mdx +11 -11
- package/docs/academy/01-GetStarted/01-CreateNewPowerhouseProject.md +22 -5
- package/docs/academy/01-GetStarted/02-DefineToDoListDocumentModel.md +2 -20
- package/docs/academy/01-GetStarted/03-ImplementOperationReducers.md +2 -3
- package/docs/academy/01-GetStarted/05-BuildToDoListEditor.md +4 -4
- package/docs/academy/01-GetStarted/home.mdx +43 -104
- package/docs/academy/01-GetStarted/images/DocumentModelOperations.png +0 -0
- package/docs/academy/01-GetStarted/styles.module.css +30 -6
- package/docs/academy/02-MasteryTrack/01-BuilderEnvironment/02-VetraStudio.md +95 -0
- package/docs/academy/02-MasteryTrack/01-BuilderEnvironment/{02-StandardDocumentModelWorkflow.md → 03-CreateAPackageWithVetra.md} +202 -33
- package/docs/academy/02-MasteryTrack/01-BuilderEnvironment/{03-BuilderTools.md → BuilderTools} +1 -1
- package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/02-ConfiguringDrives.md +4 -4
- package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/03-BuildingADriveExplorer.md +34 -34
- package/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/07-Authorization/03-DocumentPermissions.md +387 -0
- package/docs/academy/02-MasteryTrack/05-Launch/02-PublishYourProject.md +118 -184
- package/docs/academy/02-MasteryTrack/05-Launch/03-SetupEnvironment.md +1 -1
- package/docs/academy/02-MasteryTrack/05-Launch/05-DockerDeployment.md +1 -1
- package/docs/academy/02-MasteryTrack/_category_.json +1 -1
- package/docs/academy/03-ExampleUsecases/00-Overview.mdx +60 -0
- package/docs/academy/03-ExampleUsecases/Chatroom/02-CreateNewPowerhouseProject.md +38 -16
- package/docs/academy/03-ExampleUsecases/Chatroom/03-DefineChatroomDocumentModel.md +11 -14
- package/docs/academy/03-ExampleUsecases/Chatroom/04-ImplementOperationReducers.md +12 -95
- package/docs/academy/03-ExampleUsecases/Chatroom/05-ImplementChatroomEditor.md +30 -20
- package/docs/academy/03-ExampleUsecases/Chatroom/{06-LaunchALocalReactor.md → 06-LaunchALocalReactor} +13 -8
- package/docs/academy/03-ExampleUsecases/VetraPackageLibrary/VetraPackageLibrary.md +13 -0
- package/docs/academy/03-ExampleUsecases/_category_.json +9 -0
- package/docs/academy/04-APIReferences/00-PowerhouseCLI.md +168 -15
- package/docs/academy/04-APIReferences/01-ReactHooks.md +7 -0
- package/docs/academy/04-APIReferences/04-RelationalDatabase.md +6 -0
- package/docs/academy/04-APIReferences/renown-sdk/03-CLIIdentity.md +321 -0
- package/docs/academy/05-Architecture/00-PowerhouseArchitecture.md +46 -11
- package/docs/academy/07-Cookbook.md +598 -145
- package/docs/academy/08-Glossary.md +1 -1
- package/docusaurus.config.ts +13 -35
- package/package.json +1 -1
- package/sidebars.ts +11 -11
- package/src/css/custom.css +28 -30
- package/src/theme/DocSidebarItem/Category/index.tsx +47 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/docs/academy/02-MasteryTrack/01-BuilderEnvironment/05-VetraStudio.md +0 -253
- package/docs/academy/02-MasteryTrack/05-Launch/01-IntroductionToPackages.md +0 -78
|
@@ -1,78 +1,56 @@
|
|
|
1
1
|
# Publish your package
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
:::warning
|
|
4
|
+
**This guide assumes familiarity with building document models in Vetra Studio.**
|
|
5
|
+
Please start with the **'Get Started'** chapter or **'Document Model Creation'** section if you are new to building document models.
|
|
6
|
+
:::
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
Let's start with some **key concepts** that will help you understand the process we're going to go through in this tutorial.
|
|
8
|
+
This guide covers the process of **building** and **publishing** a Powerhouse package to NPM.
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
- **Powerhouse
|
|
13
|
-
- **Powerhouse
|
|
14
|
-
- **
|
|
10
|
+
:::info Key Concepts
|
|
11
|
+
- **Powerhouse Package**: A collection of modules published to NPM that can be installed on a server instance or locally. Organizations build packages for specific purposes or workflows.
|
|
12
|
+
- **Powerhouse Modules**: The building blocks of your package—document models, editors, processors, or scripts.
|
|
13
|
+
- **Vetra Studio**: The development hub where you assemble specifications for your package. Each module is defined through specification documents that drive code generation.
|
|
14
|
+
- **Powerhouse Drive-apps**: Customized drive interfaces that enhance document functionality and workflows within a drive.
|
|
15
15
|
|
|
16
16
|

|
|
17
17
|
:::
|
|
18
18
|
|
|
19
19
|
## 1. Building your project
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
### 1.1. Initialize your project
|
|
22
|
+
|
|
23
|
+
Start by initializing a new Powerhouse project:
|
|
22
24
|
|
|
23
25
|
```bash
|
|
24
|
-
|
|
26
|
+
ph init
|
|
25
27
|
```
|
|
26
28
|
|
|
29
|
+
You'll be prompted to name your project, which will become the package name when published to NPM.
|
|
30
|
+
|
|
27
31
|
<details>
|
|
28
|
-
<summary>
|
|
32
|
+
<summary>Command not working? Did you install `ph-cmd`?</summary>
|
|
29
33
|
|
|
30
|
-
The Powerhouse CLI (`ph-cmd`) is a command-line interface tool that provides essential commands for managing Powerhouse projects.
|
|
34
|
+
The Powerhouse CLI (`ph-cmd`) is a command-line interface tool that provides essential commands for managing Powerhouse projects. Install it globally using:
|
|
31
35
|
|
|
32
36
|
```bash
|
|
33
37
|
pnpm install -g ph-cmd
|
|
34
38
|
```
|
|
35
39
|
|
|
36
|
-
For experimental features, use --version [version] which allows selecting a specific branch of our document-model-boilerplate. There are --dev and --staging options. Select `ph init --dev` to use the latest development version. Please be aware that this version can contain bugs and experimental features that aren't fully tested.
|
|
37
|
-
|
|
38
40
|
Key commands include:
|
|
39
41
|
|
|
40
|
-
- `ph
|
|
42
|
+
- `ph vetra` for launching Vetra Studio
|
|
43
|
+
- `ph connect` for running Connect locally (alternative)
|
|
41
44
|
- `ph switchboard` or `ph reactor` for starting the API service
|
|
42
|
-
- `ph init` to start a new project
|
|
43
|
-
- `ph help` to get an overview of all
|
|
44
|
-
|
|
45
|
-
This tool will be fundamental on your journey when creating, building, and running document models
|
|
46
|
-
|
|
47
|
-
</details>
|
|
48
|
-
|
|
49
|
-
<details>
|
|
50
|
-
<summary> Got `ph-cmd` installed, but command not working? Reset your package manager cache</summary>
|
|
51
|
-
|
|
52
|
-
If you need to reset your package manager, you can run the following commands for your package manager: (pnpm, npm, yarn)
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
pnpm cache verify
|
|
56
|
-
pnpm store prune
|
|
57
|
-
pnpm cache clean --force
|
|
58
|
-
|
|
59
|
-
npx clear-npx-cache
|
|
60
|
-
|
|
61
|
-
npm cache verify
|
|
62
|
-
npm cache clean --force
|
|
63
|
-
npm cache verify
|
|
64
|
-
|
|
65
|
-
yarn cache list
|
|
66
|
-
yarn cache clean --force
|
|
67
|
-
yarn cache list
|
|
68
|
-
```
|
|
45
|
+
- `ph init` to start a new project
|
|
46
|
+
- `ph help` to get an overview of all available commands
|
|
69
47
|
|
|
70
48
|
</details>
|
|
71
49
|
|
|
72
50
|
<details>
|
|
73
|
-
<summary>
|
|
51
|
+
<summary>How to use different branches?</summary>
|
|
74
52
|
|
|
75
|
-
When
|
|
53
|
+
When using the Powerhouse CLI, you can access dev & staging branches for experimental features or bugfixes under development.
|
|
76
54
|
|
|
77
55
|
| Command | Description |
|
|
78
56
|
| ---------------------------------- | ----------------------------------------------------- |
|
|
@@ -90,84 +68,90 @@ Please be aware that these versions can contain bugs and experimental features t
|
|
|
90
68
|
|
|
91
69
|
</details>
|
|
92
70
|
|
|
93
|
-
### 1.
|
|
94
|
-
|
|
95
|
-
When you are creating your own project, you will be asked to name your project.
|
|
96
|
-
Which will also become the package name when someone else wants to install it in a cloud environment via npm in the future.
|
|
71
|
+
### 1.2. Launch Vetra Studio
|
|
97
72
|
|
|
98
|
-
|
|
73
|
+
Launch Vetra Studio in interactive watch mode for development:
|
|
99
74
|
|
|
100
75
|
```bash
|
|
101
|
-
|
|
102
|
-
"name": "@your-org-ph/package-name", #Your organization name with the -ph suffix to indicate it's a powerhouse related organization & package.
|
|
103
|
-
"version": "1.0.0",
|
|
104
|
-
"author": "Your Name",
|
|
105
|
-
"license": "AGPL-3.0-only",
|
|
106
|
-
"main": "index.js"
|
|
107
|
-
}
|
|
76
|
+
ph vetra --interactive --watch
|
|
108
77
|
```
|
|
109
78
|
|
|
110
|
-
|
|
79
|
+
This mode provides:
|
|
80
|
+
- **Interactive confirmations** before code generation
|
|
81
|
+
- **Dynamic reloading** for document-models and editors
|
|
82
|
+
- **Live preview** of your changes in Vetra Studio
|
|
83
|
+
|
|
84
|
+
<details>
|
|
85
|
+
<summary>Alternatively: Use Connect</summary>
|
|
86
|
+
|
|
87
|
+
You can also use Connect for local development:
|
|
111
88
|
|
|
112
89
|
```bash
|
|
113
|
-
ph
|
|
90
|
+
ph connect
|
|
114
91
|
```
|
|
115
92
|
|
|
116
|
-
|
|
117
|
-
|
|
93
|
+
This opens Connect in your browser at `http://localhost:3000/`, providing a local Reactor for testing.
|
|
94
|
+
|
|
95
|
+
</details>
|
|
118
96
|
|
|
119
|
-
|
|
120
|
-
- `editors`: A folder containing the editors you've defined in react, potentially making use of the reusable components.
|
|
121
|
-
- `processors`: A folder containing the processors you might be running on your document models later on.
|
|
122
|
-
- `scripts`: A folder containing the scripts you might use.
|
|
123
|
-
- `tests`: A folder containing your unit tests.
|
|
97
|
+
### 1.3. Configure package details
|
|
124
98
|
|
|
125
|
-
|
|
99
|
+
In Vetra Studio, navigate to the **Package Details** section of your Vetra Studio drive to configure:
|
|
126
100
|
|
|
127
|
-
|
|
128
|
-
|
|
101
|
+
- **Package name**: Use the format `@your-org-ph/package-name` (the `-ph` suffix identifies Powerhouse ecosystem packages)
|
|
102
|
+
- **Description**: A meaningful description of your package
|
|
103
|
+
- **Keywords**: Search terms for discoverability
|
|
104
|
+
- **Version**: Following semantic versioning (e.g., `1.0.0`)
|
|
105
|
+
- **Author** and **License** information
|
|
129
106
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
107
|
+
These details are stored in your `package.json` and a `manifest.json` file is automatically generated from this configuration.
|
|
108
|
+
|
|
109
|
+
```json
|
|
110
|
+
{
|
|
111
|
+
"name": "@your-org-ph/package-name",
|
|
112
|
+
"version": "1.0.0",
|
|
113
|
+
"author": "Your Name",
|
|
114
|
+
"license": "AGPL-3.0-only",
|
|
115
|
+
"publishConfig": {
|
|
116
|
+
"access": "public"
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
```
|
|
133
120
|
|
|
134
|
-
1.
|
|
135
|
-
2. Defining your Document Model **Operations** in the document model document operations editor and their graphQL counterparts.
|
|
136
|
-
3. Generating the scaffolding code by **exporting** the Zip file from connect and **importing** it into your project. (Save it in the directory you've created in the previous step) Run `ph generate <zipfile>`.
|
|
137
|
-
4. Implementing the **reducer code** and unit tests of your document models reducers.
|
|
138
|
-
5. Implementing the **document editors** to visualize and interact with your document models.
|
|
139
|
-
6. Run **unit tests** and verify the editor functionality via `ph connect` for local testing.
|
|
140
|
-
7. Add a **manifest file** to your project and updating your index.js file to export your modules.
|
|
121
|
+
### 1.4. Build your modules
|
|
141
122
|
|
|
142
|
-
|
|
123
|
+
With Vetra Studio running, build your package modules:
|
|
143
124
|
|
|
144
|
-
|
|
125
|
+
1. **Document Models**: Define your document model specifications in Vetra Studio. The state schema and operations are automatically generated into code.
|
|
126
|
+
2. **Editors**: Create editor specifications linked to your document models. Vetra generates the scaffolding code.
|
|
127
|
+
3. **Reducers**: Implement the state transition logic in the generated reducer files.
|
|
128
|
+
4. **Unit Tests**: Write tests for your reducer logic in the `tests/` directory.
|
|
145
129
|
|
|
146
|
-
|
|
130
|
+
Run tests to verify your implementation:
|
|
147
131
|
|
|
148
132
|
```bash
|
|
149
|
-
pnpm
|
|
133
|
+
pnpm run test
|
|
150
134
|
```
|
|
151
135
|
|
|
152
|
-
|
|
136
|
+
### 1.5. Verify your build
|
|
153
137
|
|
|
154
|
-
|
|
155
|
-
Inspect the build output and verify that the document models are working correctly.
|
|
156
|
-
Instead of `pnpm serve`, we'll be using:
|
|
138
|
+
Build your project to verify everything compiles correctly:
|
|
157
139
|
|
|
158
140
|
```bash
|
|
159
|
-
|
|
141
|
+
pnpm build
|
|
160
142
|
```
|
|
161
143
|
|
|
162
|
-
|
|
144
|
+
This creates an optimized build output ready for distribution. Test the build locally:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
ph vetra --interactive --watch
|
|
148
|
+
```
|
|
163
149
|
|
|
164
|
-
|
|
165
|
-
Why?
|
|
150
|
+
Create documents of your defined types and verify all functionality works as expected.
|
|
166
151
|
|
|
167
|
-
|
|
168
|
-
- So you can publish your project to the npm registry and install it on a server instance or locally on your machine.
|
|
152
|
+
### 1.6. Store in version control
|
|
169
153
|
|
|
170
|
-
|
|
154
|
+
Initialize a git repository to track changes:
|
|
171
155
|
|
|
172
156
|
```bash
|
|
173
157
|
git init
|
|
@@ -175,145 +159,95 @@ git add .
|
|
|
175
159
|
git commit -m "Initial commit"
|
|
176
160
|
```
|
|
177
161
|
|
|
178
|
-
This will initialize a git repository and add all the files to the repository.
|
|
179
|
-
|
|
180
162
|
## 2. Publishing your project
|
|
181
163
|
|
|
182
|
-
|
|
183
|
-
If you haven't already registered your organization on npm, you can do so by running the following command:
|
|
184
|
-
|
|
185
|
-
```bash
|
|
186
|
-
pnpm adduser
|
|
187
|
-
```
|
|
164
|
+
### 2.1. Set up NPM organization
|
|
188
165
|
|
|
189
|
-
Create an organization on [NPM](https://www.npmjs.com/) using the naming convention
|
|
166
|
+
Create an organization on [NPM](https://www.npmjs.com/) using the naming convention `@yourorganization-ph`:
|
|
190
167
|
|
|
191
|
-
- The `-ph` suffix
|
|
168
|
+
- The `-ph` suffix identifies Powerhouse ecosystem packages
|
|
192
169
|
- Example: `@acme-ph`
|
|
193
170
|
|
|
194
|
-
|
|
195
|
-
We advise you to **use a dedicated npm account for your organization and not your personal account**.
|
|
171
|
+
We recommend using a **dedicated NPM account** for your organization rather than a personal account.
|
|
196
172
|
|
|
197
|
-
|
|
198
|
-
Log in via the command line:
|
|
173
|
+
### 2.2. Log in to NPM
|
|
199
174
|
|
|
200
175
|
```bash
|
|
201
176
|
npm login
|
|
202
177
|
```
|
|
203
178
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
Once you've logged in, you can configure your package.json for npm before publishing.
|
|
207
|
-
If you're publishing a package under a scope (like @your-org/my-package), you might need to add the `publishConfig` to ensure it's public, otherwise scoped packages default to private:
|
|
208
|
-
|
|
209
|
-
```json
|
|
210
|
-
{
|
|
211
|
-
"name": "@your-org/my-package",
|
|
212
|
-
"version": "1.0.0",
|
|
213
|
-
"main": "index.js",
|
|
214
|
-
"publishConfig": {
|
|
215
|
-
"access": "public"
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
### 2.1 Versioning, tagging, and publishing your package
|
|
221
|
-
|
|
222
|
-
Before publishing, it's crucial to version your package correctly and tag the release in your Git repository. This helps track changes and allows users to depend on specific versions.
|
|
179
|
+
Follow the prompts in your terminal or browser to authenticate.
|
|
223
180
|
|
|
224
|
-
|
|
181
|
+
### 2.3. Version your package
|
|
225
182
|
|
|
226
|
-
Use
|
|
227
|
-
|
|
228
|
-
-
|
|
229
|
-
- Create a Git
|
|
230
|
-
- Create a Git tag for the new version (e.g., `v1.0.1`).
|
|
183
|
+
Use semantic versioning to update your package version. The `pnpm version` command will:
|
|
184
|
+
- Update the `version` in `package.json`
|
|
185
|
+
- Create a Git commit for the version change
|
|
186
|
+
- Create a Git tag (e.g., `v1.0.1`)
|
|
231
187
|
|
|
232
188
|
```bash
|
|
233
|
-
#
|
|
189
|
+
# Patch release (1.0.0 → 1.0.1) - bugfixes
|
|
234
190
|
pnpm version patch
|
|
235
191
|
|
|
236
|
-
#
|
|
192
|
+
# Minor release (1.0.1 → 1.1.0) - new features
|
|
237
193
|
pnpm version minor
|
|
238
194
|
|
|
239
|
-
#
|
|
195
|
+
# Major release (1.1.0 → 2.0.0) - breaking changes
|
|
240
196
|
pnpm version major
|
|
241
197
|
```
|
|
242
198
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
#### 2. Pushing changes to Git
|
|
199
|
+
### 2.4. Push to Git
|
|
246
200
|
|
|
247
|
-
|
|
201
|
+
Push your commits and version tag to your remote repository:
|
|
248
202
|
|
|
249
203
|
```bash
|
|
250
|
-
# Push your current branch (e.g., main or master)
|
|
251
|
-
# Replace 'main' with your default branch name if different
|
|
252
204
|
git push origin main
|
|
253
|
-
|
|
254
|
-
# Push the specific tag created by pnpm version
|
|
255
|
-
# Replace vX.Y.Z with the actual tag name (e.g., v1.0.1)
|
|
256
|
-
git push origin vX.Y.Z
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
The specific tag name (e.g., `v1.0.1`) is usually output by the `pnpm version` command. Pushing the specific tag is recommended to avoid unintentionally pushing other local tags.
|
|
260
|
-
|
|
261
|
-
Alternatively, to push all new local tags (use with caution):
|
|
262
|
-
|
|
263
|
-
```bash
|
|
264
|
-
# git push --tags
|
|
205
|
+
git push origin vX.Y.Z # Replace with your actual tag
|
|
265
206
|
```
|
|
266
207
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
It's important to distinguish between Git tags and NPM distributor tags (dist-tags):
|
|
270
|
-
|
|
271
|
-
- **Git Tags**: These are markers in your Git repository's history. They are primarily for developers to pinpoint specific release versions in the codebase (e.g., `v1.0.0`, `v1.0.1`). The `pnpm version` command creates these.
|
|
272
|
-
- **NPM Distributor Tags (dist-tags)**: These are labels used by the NPM registry to point to specific published versions of your package. Common NPM tags include:
|
|
273
|
-
- `latest`: This is the default tag. When someone runs `pnpm install my-package`, NPM installs the version tagged as `latest`.
|
|
274
|
-
- `beta`, `next`, `alpha`: Often used for pre-release versions.
|
|
275
|
-
When you publish a package without specifying an NPM tag, it usually gets the `latest` tag by default.
|
|
276
|
-
|
|
277
|
-
#### 4. Publishing to npm
|
|
278
|
-
|
|
279
|
-
Now you are ready to publish your package to the NPM registry. Ensure you are logged into NPM (the `npm login` command shown in previous steps should be used, or `pnpm login` which is an alias).
|
|
208
|
+
### 2.5. Publish to NPM
|
|
280
209
|
|
|
281
210
|
```bash
|
|
282
211
|
pnpm publish
|
|
283
212
|
```
|
|
284
213
|
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
If your package is scoped (e.g., `@your-org/my-package`) and intended to be public, ensure your `package.json` includes the `publishConfig` shown earlier. If this is not set in `package.json` (and your package is scoped), you might need to use:
|
|
214
|
+
For scoped packages intended to be public, ensure your `package.json` includes the `publishConfig` shown earlier, or use:
|
|
288
215
|
|
|
289
216
|
```bash
|
|
290
217
|
pnpm publish --access public
|
|
291
218
|
```
|
|
292
219
|
|
|
293
|
-
|
|
220
|
+
To publish a pre-release version:
|
|
294
221
|
|
|
295
222
|
```bash
|
|
296
|
-
# Ensure your
|
|
223
|
+
# Ensure your version reflects the pre-release (e.g., 1.1.0-beta.0)
|
|
297
224
|
pnpm publish --tag beta
|
|
298
225
|
```
|
|
299
226
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
## 3. Deploying the host apps and project
|
|
227
|
+
:::info Git Tags vs NPM Tags
|
|
228
|
+
- **Git Tags**: Markers in your repository history (e.g., `v1.0.0`) created by `pnpm version`
|
|
229
|
+
- **NPM Dist-Tags**: Labels pointing to published versions (`latest`, `beta`, `next`). When publishing without a tag, the version gets the `latest` tag by default.
|
|
230
|
+
:::
|
|
305
231
|
|
|
306
|
-
|
|
232
|
+
## 3. Installing your package
|
|
307
233
|
|
|
308
|
-
|
|
234
|
+
Once published, install your package in any Powerhouse environment:
|
|
309
235
|
|
|
310
236
|
```bash
|
|
311
|
-
ph install
|
|
237
|
+
ph install @your-org-ph/package-name
|
|
312
238
|
```
|
|
313
239
|
|
|
314
|
-
|
|
315
|
-
|
|
240
|
+
This makes your document models and editors available within that Powerhouse instance.
|
|
241
|
+
|
|
242
|
+
<details>
|
|
243
|
+
<summary>Future: Package Manager UI</summary>
|
|
244
|
+
|
|
245
|
+
A visual package manager is planned for Connect's settings, allowing installation at the click of a button.
|
|
316
246
|
|
|
317
247
|

|
|
318
248
|
|
|
319
|
-
|
|
249
|
+
</details>
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
**Congratulations on publishing your package!** Your document models and editors are now available for installation across the Powerhouse ecosystem.
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"label": "Mastery track",
|
|
3
3
|
"link": {
|
|
4
4
|
"type": "generated-index",
|
|
5
|
-
"description": "A set of tutorials that support the creation of more complex Powerhouse documents, drive
|
|
5
|
+
"description": "A set of tutorials that support the creation of more complex Powerhouse documents, drive-apps and packages."
|
|
6
6
|
}
|
|
7
7
|
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Example use-cases
|
|
3
|
+
sidebar_class_name: category-index-page
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
import styles from "../01-GetStarted/styles.module.css";
|
|
7
|
+
|
|
8
|
+
# Example use-cases
|
|
9
|
+
|
|
10
|
+
Explore real-world examples of applications built with the Powerhouse ecosystem. Each use-case provides a complete walkthrough from project setup to a fully functional application.
|
|
11
|
+
|
|
12
|
+
<div className={styles.learningPath} style={{ gridTemplateColumns: 'repeat(3, 1fr)' }}>
|
|
13
|
+
|
|
14
|
+
<div className={styles.pathCard}>
|
|
15
|
+
<div className={styles.cardHeader}>
|
|
16
|
+
<h3 className="card-title">
|
|
17
|
+
<img src="/img/academy/icons/Editor.svg" alt="" className={styles.titleIcon} />
|
|
18
|
+
Chatroom
|
|
19
|
+
</h3>
|
|
20
|
+
</div>
|
|
21
|
+
<div className={styles.cardContent}>
|
|
22
|
+
<p style={{ fontSize: '0.9rem', color: 'var(--ifm-color-content-secondary)', marginBottom: '1rem' }}>
|
|
23
|
+
Build a real-time chat application with message posting and emoji reactions. Learn document models, reducers, and real-time synchronization.
|
|
24
|
+
</p>
|
|
25
|
+
<a href="/academy/ExampleUsecases/Chatroom/CreateNewPowerhouseProject" className="path-button">Start tutorial</a>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<div className={styles.pathCard}>
|
|
30
|
+
<div className={styles.cardHeader}>
|
|
31
|
+
<h3 className="card-title">
|
|
32
|
+
<img src="/img/academy/icons/Editor.svg" alt="" className={styles.titleIcon} />
|
|
33
|
+
Todo List
|
|
34
|
+
</h3>
|
|
35
|
+
</div>
|
|
36
|
+
<div className={styles.cardContent}>
|
|
37
|
+
<p style={{ fontSize: '0.9rem', color: 'var(--ifm-color-content-secondary)', marginBottom: '1rem' }}>
|
|
38
|
+
Create a complete todo list application with document models, editors, and a custom drive explorer.
|
|
39
|
+
</p>
|
|
40
|
+
<a href="/academy/ExampleUsecases/TodoList/GetTheStarterCode" className="path-button">Start tutorial</a>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<div className={styles.pathCard}>
|
|
45
|
+
<div className={styles.cardHeader}>
|
|
46
|
+
<h3 className="card-title">
|
|
47
|
+
<img src="/img/academy/icons/Data.svg" alt="" className={styles.titleIcon} />
|
|
48
|
+
Vetra Package Library
|
|
49
|
+
</h3>
|
|
50
|
+
</div>
|
|
51
|
+
<div className={styles.cardContent}>
|
|
52
|
+
<p style={{ fontSize: '0.9rem', color: 'var(--ifm-color-content-secondary)', marginBottom: '1rem' }}>
|
|
53
|
+
Explore the Vetra package library and learn how to leverage existing packages in your projects.
|
|
54
|
+
</p>
|
|
55
|
+
<a href="/academy/ExampleUsecases/VetraPackageLibrary/VetraPackageLibrary" className="path-button">Explore library</a>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
</div>
|
|
60
|
+
|
|
@@ -75,14 +75,6 @@ A Powerhouse project primarily consists of a document model and its editor. The
|
|
|
75
75
|
|
|
76
76
|
If you need help with installing the prerequisites you can visit our page [prerequisites](/academy/MasteryTrack/BuilderEnvironment/Prerequisites)
|
|
77
77
|
|
|
78
|
-
## Quick start
|
|
79
|
-
|
|
80
|
-
Create a new Powerhouse project with a single command:
|
|
81
|
-
|
|
82
|
-
```bash
|
|
83
|
-
ph init
|
|
84
|
-
```
|
|
85
|
-
|
|
86
78
|
## Before you begin
|
|
87
79
|
|
|
88
80
|
1. Open your terminal (either your system terminal or IDE's integrated terminal)
|
|
@@ -115,7 +107,41 @@ Navigate to the newly created project directory:
|
|
|
115
107
|
cd ChatRoom
|
|
116
108
|
```
|
|
117
109
|
|
|
118
|
-
## Develop your document model in
|
|
110
|
+
## Develop your document model in Vetra Studio
|
|
111
|
+
|
|
112
|
+
**Vetra Studio** is the builder's orchestration hub for assembling all specifications needed for your package. It provides a **Vetra Studio Drive** to access, manage, and share document model specifications, editors, and data integrations—all through a visual interface. For deeper coverage, see the [Vetra Studio documentation](/academy/MasteryTrack/BuilderEnvironment/VetraStudio).
|
|
113
|
+
|
|
114
|
+
Once in the project directory, run the `ph vetra` command to start a Vetra Studio Drive where you'll be defining your specifications.
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
ph vetra
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
The host application for Vetra Studio will start and you will see the following output:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
ℹ [reactor-api] [package-manager] Loading packages: @powerhousedao/vetra
|
|
124
|
+
ℹ [reactor-api] [server] WebSocket server attached at /graphql/subscriptions
|
|
125
|
+
ℹ [reactor-api] [graphql-manager] Registered /graphql/system subgraph.
|
|
126
|
+
ℹ [reactor-api] [graphql-manager] Registered /graphql supergraph
|
|
127
|
+
ℹ [reactor-api] [server] MCP server available at http://localhost:4001/mcp
|
|
128
|
+
Switchboard initialized
|
|
129
|
+
➜ Drive URL: http://localhost:4001/d/vetra-bac239dd
|
|
130
|
+
➜ Local: http://localhost:3000/
|
|
131
|
+
➜ Network: use --host to expose
|
|
132
|
+
➜ press h + enter to show help
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
A new browser window will open when visiting localhost and you will see the Vetra Studio Drive. If it doesn't open automatically, you can open it manually by navigating to `http://localhost:3000/` in your browser.
|
|
136
|
+
|
|
137
|
+
Create a new document model by clicking the Document Models **'Add new specification'** button. Name your document `ChatRoom` (PascalCase, no spaces or hyphens).
|
|
138
|
+
|
|
139
|
+
**Pay close attention to capitalization, as it influences code generation.**
|
|
140
|
+
|
|
141
|
+
If you've followed the steps correctly, you'll have an empty `ChatRoom` document where you can define the **'Document Specifications'**.
|
|
142
|
+
|
|
143
|
+
<details>
|
|
144
|
+
<summary>Alternatively: Develop a single document model in Connect</summary>
|
|
119
145
|
|
|
120
146
|
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.
|
|
121
147
|
|
|
@@ -138,14 +164,10 @@ If your local drive is not present, navigate to Settings in the bottom left corn
|
|
|
138
164
|
Clear the storage of your localhost application as it might have an old session cached.
|
|
139
165
|
:::
|
|
140
166
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
**Pay close attention to capitalization, as it influences code generation.**
|
|
167
|
+
Move into your local drive.
|
|
168
|
+
Create a new document model by clicking the `DocumentModel` button, found in the 'New Document' section at the bottom of the page. Name your document `ChatRoom` (PascalCase, no spaces or hyphens).
|
|
145
169
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
If you've followed the steps correctly, you'll have an empty `ChatRoom` document where you can define the **'Document Specifications'**.
|
|
170
|
+
</details>
|
|
149
171
|
|
|
150
172
|
## Verify your setup
|
|
151
173
|
|