@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,3 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
toc_max_heading_level: 2
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
# Cookbook
|
|
2
6
|
|
|
3
7
|
## Powerhouse CLI recipes
|
|
@@ -7,21 +11,21 @@ This section covers recipes related to the `ph-cmd`, the command-line tool for P
|
|
|
7
11
|
<details id="installing-ph-cmd">
|
|
8
12
|
<summary>Installing 'ph-cmd'</summary>
|
|
9
13
|
|
|
10
|
-
|
|
14
|
+
### How to install Powerhouse CLI
|
|
11
15
|
|
|
12
16
|
---
|
|
13
17
|
|
|
14
|
-
|
|
18
|
+
### Problem statement
|
|
15
19
|
|
|
16
20
|
You need to install the Powerhouse CLI (`ph-cmd`) to create and manage Powerhouse projects.
|
|
17
21
|
|
|
18
|
-
|
|
22
|
+
### Prerequisites
|
|
19
23
|
|
|
20
24
|
- node.js 22 installed
|
|
21
25
|
- pnpm package manager 10 installed
|
|
22
26
|
- Terminal or command prompt access
|
|
23
27
|
|
|
24
|
-
|
|
28
|
+
### Solution
|
|
25
29
|
|
|
26
30
|
### Step 1: Install the CLI globally
|
|
27
31
|
|
|
@@ -45,25 +49,25 @@ pnpm install -g ph-cmd@staging
|
|
|
45
49
|
pnpm install -g ph-cmd@<version>
|
|
46
50
|
```
|
|
47
51
|
|
|
48
|
-
|
|
52
|
+
### Expected outcome
|
|
49
53
|
|
|
50
54
|
- Powerhouse CLI (`ph-cmd`) installed globally on your system
|
|
51
55
|
- Access to all Powerhouse CLI commands for project creation and management
|
|
52
56
|
|
|
53
|
-
|
|
57
|
+
### Common issues and solutions
|
|
54
58
|
|
|
55
59
|
- Issue: Permission errors during installation
|
|
56
60
|
- Solution: Use `sudo` on Unix-based systems or run as administrator on Windows
|
|
57
61
|
- Issue: Version conflicts
|
|
58
62
|
- Solution: Clean your system using the uninstallation recipe before installing a new version
|
|
59
63
|
|
|
60
|
-
|
|
64
|
+
### Related recipes
|
|
61
65
|
|
|
62
66
|
- [Installing 'ph-cmd'](#installing-ph-cmd)
|
|
63
67
|
- [Uninstalling 'ph-cmd'](#uninstalling-ph-cmd)
|
|
64
68
|
- [Setting up or Resetting the Global Powerhouse Configuration](#setting-up-or-resetting-the-global-powerhouse-configuration)
|
|
65
69
|
|
|
66
|
-
|
|
70
|
+
### Further reading
|
|
67
71
|
|
|
68
72
|
- [Powerhouse Builder Tools](/academy/MasteryTrack/BuilderEnvironment/BuilderTools)
|
|
69
73
|
</details>
|
|
@@ -71,20 +75,20 @@ pnpm install -g ph-cmd@<version>
|
|
|
71
75
|
<details id="uninstalling-ph-cmd">
|
|
72
76
|
<summary>Uninstalling 'ph-cmd'</summary>
|
|
73
77
|
|
|
74
|
-
|
|
78
|
+
### How to uninstall Powerhouse CLI
|
|
75
79
|
|
|
76
80
|
---
|
|
77
81
|
|
|
78
|
-
|
|
82
|
+
### Problem statement
|
|
79
83
|
|
|
80
84
|
You want to perform a clean installation of the Powerhouse CLI.
|
|
81
85
|
|
|
82
|
-
|
|
86
|
+
### Prerequisites
|
|
83
87
|
|
|
84
88
|
- Powerhouse CLI (`ph-cmd`) installed
|
|
85
89
|
- A terminal or IDE
|
|
86
90
|
|
|
87
|
-
|
|
91
|
+
### Solution
|
|
88
92
|
|
|
89
93
|
### Step 1: Uninstall `ph-cmd`
|
|
90
94
|
|
|
@@ -98,22 +102,22 @@ pnpm uninstall -g ph-cmd
|
|
|
98
102
|
rm -rf ~/.ph
|
|
99
103
|
```
|
|
100
104
|
|
|
101
|
-
|
|
105
|
+
### Expected outcome
|
|
102
106
|
|
|
103
107
|
- Your system should now be clean from the Powerhouse CLI
|
|
104
108
|
|
|
105
|
-
|
|
109
|
+
### Common issues and solutions
|
|
106
110
|
|
|
107
111
|
- Issue: Outdated version
|
|
108
112
|
- Solution: Uninstall and reinstall the Powerhouse CLI
|
|
109
113
|
|
|
110
|
-
|
|
114
|
+
### Related recipes
|
|
111
115
|
|
|
112
116
|
- [Installing 'ph-cmd'](#installing-ph-cmd)
|
|
113
117
|
- [Uninstalling 'ph-cmd'](#uninstalling-ph-cmd)
|
|
114
118
|
- [Setting up or Resetting the Global Powerhouse Configuration](#setting-up-or-resetting-the-global-powerhouse-configuration)
|
|
115
119
|
|
|
116
|
-
|
|
120
|
+
### Further reading
|
|
117
121
|
|
|
118
122
|
- [Powerhouse Builder Tools](/academy/MasteryTrack/BuilderEnvironment/BuilderTools)
|
|
119
123
|
- [Create A New Powerhouse Project](/academy/GetStarted/CreateNewPowerhouseProject)
|
|
@@ -122,20 +126,20 @@ rm -rf ~/.ph
|
|
|
122
126
|
<details id="setting-up-or-resetting-the-global-powerhouse-configuration">
|
|
123
127
|
<summary>Setting up or Resetting the Global Powerhouse Configuration</summary>
|
|
124
128
|
|
|
125
|
-
|
|
129
|
+
### How to set up or reset the global Powerhouse configuration
|
|
126
130
|
|
|
127
131
|
---
|
|
128
132
|
|
|
129
|
-
|
|
133
|
+
### Problem statement
|
|
130
134
|
|
|
131
135
|
You need to initialize the global Powerhouse configuration for the first time, or reset it to resolve issues or start fresh. This might also involve switching to a specific dependency environment like staging.
|
|
132
136
|
|
|
133
|
-
|
|
137
|
+
### Prerequisites
|
|
134
138
|
|
|
135
139
|
- Powerhouse CLI (`ph-cmd`) installed
|
|
136
140
|
- Terminal or command prompt access
|
|
137
141
|
|
|
138
|
-
|
|
142
|
+
### Solution
|
|
139
143
|
|
|
140
144
|
### Step 1: (Optional) Remove existing configuration
|
|
141
145
|
|
|
@@ -166,26 +170,26 @@ ph use staging
|
|
|
166
170
|
# ph use latest
|
|
167
171
|
```
|
|
168
172
|
|
|
169
|
-
|
|
173
|
+
### Expected outcome
|
|
170
174
|
|
|
171
175
|
- A `~/.ph` directory is created or reset.
|
|
172
176
|
- The global project is configured, potentially using the specified environment (e.g., staging).
|
|
173
177
|
- You are ready to initialize or work with Powerhouse projects using the defined global settings.
|
|
174
178
|
|
|
175
|
-
|
|
179
|
+
### Common issues and solutions
|
|
176
180
|
|
|
177
181
|
- Issue: Commands fail after removing `~/.ph`.
|
|
178
182
|
- Solution: Ensure you run `ph setup-globals` afterwards.
|
|
179
183
|
- Issue: Need to use specific local dependencies globally.
|
|
180
184
|
- Solution: Use `ph use local /path/to/local/packages`.
|
|
181
185
|
|
|
182
|
-
|
|
186
|
+
### Related recipes
|
|
183
187
|
|
|
184
188
|
- [Installing 'ph-cmd'](#installing-ph-cmd)
|
|
185
189
|
- [Uninstalling 'ph-cmd'](#uninstalling-ph-cmd)
|
|
186
190
|
- [Using Different Branches in Powerhouse](#using-different-branches-in-powerhouse)
|
|
187
191
|
|
|
188
|
-
|
|
192
|
+
### Further reading
|
|
189
193
|
|
|
190
194
|
- [Powerhouse Builder Tools](/academy/MasteryTrack/BuilderEnvironment/BuilderTools)
|
|
191
195
|
- [GraphQL Schema Best Practices](/academy/MasteryTrack/WorkWithData/GraphQLAtPowerhouse)
|
|
@@ -194,21 +198,21 @@ ph use staging
|
|
|
194
198
|
<details id="using-different-branches-in-powerhouse">
|
|
195
199
|
<summary>Using Different Branches in Powerhouse</summary>
|
|
196
200
|
|
|
197
|
-
|
|
201
|
+
### How to use different branches in Powerhouse
|
|
198
202
|
|
|
199
203
|
---
|
|
200
204
|
|
|
201
|
-
|
|
205
|
+
### Problem statement
|
|
202
206
|
|
|
203
207
|
You need to access experimental features, bugfixes, or development versions of Powerhouse components that aren't yet available in the stable release.
|
|
204
208
|
|
|
205
|
-
|
|
209
|
+
### Prerequisites
|
|
206
210
|
|
|
207
211
|
- Terminal or command prompt access
|
|
208
212
|
- pnpm package manager 10 installed
|
|
209
213
|
- Node.js 22 installed
|
|
210
214
|
|
|
211
|
-
|
|
215
|
+
### Solution
|
|
212
216
|
|
|
213
217
|
### Step 1: Install CLI with specific branch
|
|
214
218
|
|
|
@@ -255,26 +259,26 @@ ph use dev
|
|
|
255
259
|
ph use prod
|
|
256
260
|
```
|
|
257
261
|
|
|
258
|
-
|
|
262
|
+
### Expected outcome
|
|
259
263
|
|
|
260
264
|
- Access to the specified version of Powerhouse components
|
|
261
265
|
- Ability to test experimental features or bugfixes
|
|
262
266
|
- Project configured with the chosen branch's dependencies
|
|
263
267
|
|
|
264
|
-
|
|
268
|
+
### Common issues and solutions
|
|
265
269
|
|
|
266
270
|
- Issue: Experimental features not working as expected
|
|
267
271
|
- Solution: This is normal as these versions may contain untested features. Consider switching back to stable versions if issues persist.
|
|
268
272
|
- Issue: Version conflicts between components
|
|
269
273
|
- Solution: Ensure all components are using the same branch version. Use `ph use` commands to synchronize versions.
|
|
270
274
|
|
|
271
|
-
|
|
275
|
+
### Related recipes
|
|
272
276
|
|
|
273
277
|
- [Installing 'ph-cmd'](#installing-ph-cmd)
|
|
274
278
|
- Updating Your Powerhouse Project Dependencies
|
|
275
279
|
- [Setting up or Resetting the Global Powerhouse Configuration](#setting-up-or-resetting-the-global-powerhouse-configuration)
|
|
276
280
|
|
|
277
|
-
|
|
281
|
+
### Further reading
|
|
278
282
|
|
|
279
283
|
- [Powerhouse Builder Tools](/academy/MasteryTrack/BuilderEnvironment/BuilderTools)
|
|
280
284
|
</details>
|
|
@@ -282,21 +286,21 @@ ph use prod
|
|
|
282
286
|
<details id="using-different-package-managers-with-powerhouse">
|
|
283
287
|
<summary>Using Different Package Managers with Powerhouse</summary>
|
|
284
288
|
|
|
285
|
-
|
|
289
|
+
### How to use different package managers with Powerhouse
|
|
286
290
|
|
|
287
291
|
---
|
|
288
292
|
|
|
289
|
-
|
|
293
|
+
### Problem statement
|
|
290
294
|
|
|
291
295
|
You want to use a different package manager (npm, yarn, or bun) instead of pnpm for managing Powerhouse projects and dependencies.
|
|
292
296
|
|
|
293
|
-
|
|
297
|
+
### Prerequisites
|
|
294
298
|
|
|
295
299
|
- Node.js 22 installed
|
|
296
300
|
- Your preferred package manager installed (npm, yarn, or bun)
|
|
297
301
|
- Terminal or command prompt access
|
|
298
302
|
|
|
299
|
-
|
|
303
|
+
### Solution
|
|
300
304
|
|
|
301
305
|
### Step 1: Install the CLI with Your Preferred Package Manager
|
|
302
306
|
|
|
@@ -366,13 +370,13 @@ ph init --package-manager bun
|
|
|
366
370
|
ph init --package-manager pnpm
|
|
367
371
|
```
|
|
368
372
|
|
|
369
|
-
|
|
373
|
+
### Expected outcome
|
|
370
374
|
|
|
371
375
|
- Powerhouse CLI installed and accessible through your preferred package manager
|
|
372
376
|
- Ability to manage Powerhouse projects using your chosen package manager
|
|
373
377
|
- Proper PATH configuration for global binaries
|
|
374
378
|
|
|
375
|
-
|
|
379
|
+
### Common issues and solutions
|
|
376
380
|
|
|
377
381
|
- Issue: Command not found after installation
|
|
378
382
|
- Solution: Ensure the global binary directory is in your PATH (especially for yarn and bun)
|
|
@@ -382,19 +386,468 @@ ph init --package-manager pnpm
|
|
|
382
386
|
- Issue: Package manager conflicts
|
|
383
387
|
- Solution: Stick to one package manager per project to avoid lockfile conflicts
|
|
384
388
|
|
|
385
|
-
|
|
389
|
+
### Related recipes
|
|
386
390
|
|
|
387
391
|
- [Installing 'ph-cmd'](#installing-ph-cmd)
|
|
388
392
|
- [Uninstalling 'ph-cmd'](#uninstalling-ph-cmd)
|
|
389
393
|
- [Setting up or Resetting the Global Powerhouse Configuration](#setting-up-or-resetting-the-global-powerhouse-configuration)
|
|
390
394
|
|
|
391
|
-
|
|
395
|
+
### Further reading
|
|
392
396
|
|
|
393
397
|
- [Powerhouse Builder Tools](/academy/MasteryTrack/BuilderEnvironment/BuilderTools)
|
|
394
398
|
- [Yarn Global Installation Guide](https://classic.yarnpkg.com/lang/en/docs/cli/global/)
|
|
395
399
|
- [Bun Installation Guide](https://bun.sh/docs/installation#how-to-add-your-path)
|
|
396
400
|
</details>
|
|
397
401
|
|
|
402
|
+
## Vetra Studio recipes
|
|
403
|
+
|
|
404
|
+
This section covers recipes for using Vetra Studio, the AI-powered development environment for building Powerhouse packages with specification-driven workflows.
|
|
405
|
+
|
|
406
|
+
<details id="launching-vetra-studio">
|
|
407
|
+
<summary>Launching Vetra Studio</summary>
|
|
408
|
+
|
|
409
|
+
### How to Launch Vetra Studio
|
|
410
|
+
|
|
411
|
+
---
|
|
412
|
+
|
|
413
|
+
### Problem statement
|
|
414
|
+
|
|
415
|
+
You want to start Vetra Studio to develop document models, editors, and other package components using the specification-driven workflow.
|
|
416
|
+
|
|
417
|
+
### Prerequisites
|
|
418
|
+
|
|
419
|
+
- Powerhouse CLI (`ph-cmd`) installed
|
|
420
|
+
- A Powerhouse project initialized (`ph init`)
|
|
421
|
+
- Terminal or command prompt access
|
|
422
|
+
|
|
423
|
+
### Solution
|
|
424
|
+
|
|
425
|
+
### Step 1: Navigate to Your Project Directory
|
|
426
|
+
|
|
427
|
+
```bash
|
|
428
|
+
cd <yourprojectname>
|
|
429
|
+
```
|
|
430
|
+
|
|
431
|
+
### Step 2: Choose Your Launch Mode
|
|
432
|
+
|
|
433
|
+
Vetra Studio offers three modes depending on your workflow:
|
|
434
|
+
|
|
435
|
+
#### Interactive Mode (Recommended for Development)
|
|
436
|
+
|
|
437
|
+
```bash
|
|
438
|
+
ph vetra --interactive
|
|
439
|
+
```
|
|
440
|
+
|
|
441
|
+
In interactive mode:
|
|
442
|
+
- You receive confirmation prompts before any code generation
|
|
443
|
+
- Changes require explicit confirmation before being processed
|
|
444
|
+
- Provides better control and visibility over document changes
|
|
445
|
+
|
|
446
|
+
#### Watch Mode with Interactive
|
|
447
|
+
|
|
448
|
+
```bash
|
|
449
|
+
ph vetra --interactive --watch
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
In watch mode:
|
|
453
|
+
- Enables dynamic loading for document-models and editors
|
|
454
|
+
- The system watches for changes and reloads them dynamically
|
|
455
|
+
- Best for active development with frequent changes
|
|
456
|
+
|
|
457
|
+
#### Standard Mode
|
|
458
|
+
|
|
459
|
+
```bash
|
|
460
|
+
ph vetra
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
In standard mode:
|
|
464
|
+
- Changes are processed automatically with 1-second debounce
|
|
465
|
+
- Multiple changes are batched and processed together
|
|
466
|
+
- Uses the latest document state for processing
|
|
467
|
+
|
|
468
|
+
### Expected outcome
|
|
469
|
+
|
|
470
|
+
- Vetra Studio launches in your browser
|
|
471
|
+
- You can access the Vetra Studio Drive to manage specifications
|
|
472
|
+
- Document models and editors are available for development
|
|
473
|
+
|
|
474
|
+
### Common issues and solutions
|
|
475
|
+
|
|
476
|
+
- **Issue**: Vetra Studio environment breaks during document model development
|
|
477
|
+
- **Solution**: This can happen when code changes break the environment. Restart Vetra Studio and check your document model for errors.
|
|
478
|
+
- **Issue**: Changes not reflecting in the studio
|
|
479
|
+
- **Solution**: If not using `--watch` mode, restart Vetra Studio to pick up changes.
|
|
480
|
+
|
|
481
|
+
### Related recipes
|
|
482
|
+
|
|
483
|
+
- [Connecting to a Remote Vetra Drive](#connecting-to-a-remote-vetra-drive)
|
|
484
|
+
- [Connecting Claude with Reactor MCP](#connecting-claude-with-reactor-mcp)
|
|
485
|
+
|
|
486
|
+
### Further reading
|
|
487
|
+
|
|
488
|
+
- [Vetra Studio Documentation](/academy/MasteryTrack/BuilderEnvironment/VetraStudio)
|
|
489
|
+
- [Powerhouse CLI Reference](/academy/APIReferences/PowerhouseCLI#vetra)
|
|
490
|
+
</details>
|
|
491
|
+
|
|
492
|
+
<details id="connecting-to-a-remote-vetra-drive">
|
|
493
|
+
<summary>Connecting to a Remote Vetra Drive</summary>
|
|
494
|
+
|
|
495
|
+
### How to Connect to a Remote Vetra Drive
|
|
496
|
+
|
|
497
|
+
---
|
|
498
|
+
|
|
499
|
+
### Problem statement
|
|
500
|
+
|
|
501
|
+
You want to collaborate with team members by connecting to a shared remote Vetra drive instead of using a local one, enabling synchronized specifications across your team.
|
|
502
|
+
|
|
503
|
+
### Prerequisites
|
|
504
|
+
|
|
505
|
+
- Powerhouse CLI (`ph-cmd`) installed
|
|
506
|
+
- A Powerhouse project initialized or ready to create
|
|
507
|
+
- The URL of the remote Vetra drive you want to connect to
|
|
508
|
+
- Terminal or command prompt access
|
|
509
|
+
|
|
510
|
+
### Solution
|
|
511
|
+
|
|
512
|
+
#### Option A: Create a New Project with Remote Drive
|
|
513
|
+
|
|
514
|
+
### Step 1: Initialize with Remote Drive
|
|
515
|
+
|
|
516
|
+
```bash
|
|
517
|
+
ph init --remote-drive <url>
|
|
518
|
+
```
|
|
519
|
+
|
|
520
|
+
Example:
|
|
521
|
+
```bash
|
|
522
|
+
ph init --remote-drive https://switchboard.staging.vetra.io/d/my-team-drive
|
|
523
|
+
```
|
|
524
|
+
|
|
525
|
+
### Step 2: Start Vetra with Watch Mode
|
|
526
|
+
|
|
527
|
+
```bash
|
|
528
|
+
ph vetra --watch
|
|
529
|
+
```
|
|
530
|
+
|
|
531
|
+
#### Option B: Clone an Existing Project from Remote Drive
|
|
532
|
+
|
|
533
|
+
### Step 1: Checkout the Remote Drive
|
|
534
|
+
|
|
535
|
+
```bash
|
|
536
|
+
ph checkout --remote-drive <url>
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
### Step 2: Start Vetra
|
|
540
|
+
|
|
541
|
+
```bash
|
|
542
|
+
ph vetra --watch
|
|
543
|
+
```
|
|
544
|
+
|
|
545
|
+
#### Option C: Configure Remote Drive in Existing Project
|
|
546
|
+
|
|
547
|
+
### Step 1: Edit powerhouse.config.json
|
|
548
|
+
|
|
549
|
+
Add the Vetra configuration to your `powerhouse.config.json` file:
|
|
550
|
+
|
|
551
|
+
```json
|
|
552
|
+
{
|
|
553
|
+
"vetra": {
|
|
554
|
+
"driveId": "your-drive-id",
|
|
555
|
+
"driveUrl": "https://switchboard.staging.vetra.io/d/your-drive-id"
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
```
|
|
559
|
+
|
|
560
|
+
### Step 2: Start Vetra
|
|
561
|
+
|
|
562
|
+
```bash
|
|
563
|
+
ph vetra --watch
|
|
564
|
+
```
|
|
565
|
+
|
|
566
|
+
### Expected outcome
|
|
567
|
+
|
|
568
|
+
- Your project is connected to the remote Vetra drive
|
|
569
|
+
- Specifications sync across team members
|
|
570
|
+
- A "Vetra Preview" drive is created locally for testing changes before syncing
|
|
571
|
+
- The main "Vetra" drive syncs with the remote and contains stable package configuration
|
|
572
|
+
|
|
573
|
+
### Common issues and solutions
|
|
574
|
+
|
|
575
|
+
- **Issue**: Cannot connect to remote drive
|
|
576
|
+
- **Solution**: Verify the drive URL is correct and accessible. Check your network connection and any firewall settings.
|
|
577
|
+
- **Issue**: Local changes not syncing
|
|
578
|
+
- **Solution**: The "Vetra Preview" drive is for local testing. Changes need to be explicitly synced to the main drive.
|
|
579
|
+
- **Issue**: Conflicts with team member changes
|
|
580
|
+
- **Solution**: Always use `ph vetra --watch` when restarting to ensure local documents and editors are loaded properly.
|
|
581
|
+
|
|
582
|
+
### Related recipes
|
|
583
|
+
|
|
584
|
+
- [Launching Vetra Studio](#launching-vetra-studio)
|
|
585
|
+
- [Connecting Claude with Reactor MCP](#connecting-claude-with-reactor-mcp)
|
|
586
|
+
|
|
587
|
+
### Further reading
|
|
588
|
+
|
|
589
|
+
- [Vetra Remote Drive Reference](/academy/APIReferences/VetraRemoteDrive)
|
|
590
|
+
- [Vetra Studio Documentation](/academy/MasteryTrack/BuilderEnvironment/VetraStudio)
|
|
591
|
+
</details>
|
|
592
|
+
|
|
593
|
+
<details id="connecting-claude-with-reactor-mcp">
|
|
594
|
+
<summary>Connecting Claude with Reactor MCP</summary>
|
|
595
|
+
|
|
596
|
+
### How to Connect Claude with Reactor MCP
|
|
597
|
+
|
|
598
|
+
---
|
|
599
|
+
|
|
600
|
+
### Problem statement
|
|
601
|
+
|
|
602
|
+
You want to use AI-assisted development in Vetra Studio by connecting Claude to the Reactor MCP (Model Context Protocol), enabling natural language document model creation and editing.
|
|
603
|
+
|
|
604
|
+
### Prerequisites
|
|
605
|
+
|
|
606
|
+
- Powerhouse CLI (`ph-cmd`) installed
|
|
607
|
+
- A Powerhouse project initialized (`ph init`)
|
|
608
|
+
- Vetra Studio running (`ph vetra`)
|
|
609
|
+
- Claude CLI installed and configured
|
|
610
|
+
- Terminal or command prompt access
|
|
611
|
+
|
|
612
|
+
### Solution
|
|
613
|
+
|
|
614
|
+
### Step 1: Start Vetra Studio
|
|
615
|
+
|
|
616
|
+
First, ensure Vetra Studio is running in your project directory:
|
|
617
|
+
|
|
618
|
+
```bash
|
|
619
|
+
ph vetra --interactive --watch
|
|
620
|
+
```
|
|
621
|
+
|
|
622
|
+
### Step 2: Open a New Terminal and Navigate to Your Project
|
|
623
|
+
|
|
624
|
+
```bash
|
|
625
|
+
cd <yourprojectname>
|
|
626
|
+
```
|
|
627
|
+
|
|
628
|
+
### Step 3: Start Claude CLI
|
|
629
|
+
|
|
630
|
+
```bash
|
|
631
|
+
claude
|
|
632
|
+
```
|
|
633
|
+
|
|
634
|
+
### Step 4: Connect to Reactor MCP
|
|
635
|
+
|
|
636
|
+
In the Claude CLI, request connection to the reactor:
|
|
637
|
+
|
|
638
|
+
```
|
|
639
|
+
connect to the reactor mcp
|
|
640
|
+
```
|
|
641
|
+
|
|
642
|
+
### Step 5: Verify the Connection
|
|
643
|
+
|
|
644
|
+
You should see a confirmation message like:
|
|
645
|
+
|
|
646
|
+
```
|
|
647
|
+
Connected to MCP successfully! I can see there's a
|
|
648
|
+
"vetra-4de7fa45" drive available. The reactor-mcp server is
|
|
649
|
+
running and ready for document model operations.
|
|
650
|
+
```
|
|
651
|
+
|
|
652
|
+
### Expected outcome
|
|
653
|
+
|
|
654
|
+
- Claude is connected to Reactor MCP
|
|
655
|
+
- Vetra Studio shows "Connected to Reactor MCP"
|
|
656
|
+
- You can now use natural language to create and modify document models
|
|
657
|
+
- Claude has access to document operations, drive operations, and document model operations
|
|
658
|
+
|
|
659
|
+
### Common issues and solutions
|
|
660
|
+
|
|
661
|
+
- **Issue**: MCP connection fails
|
|
662
|
+
- **Solution**: Ensure Vetra Studio is running before attempting to connect Claude. Restart both Vetra and Claude if needed.
|
|
663
|
+
- **Issue**: Claude doesn't recognize reactor commands
|
|
664
|
+
- **Solution**: Make sure you're in the correct project directory when starting Claude.
|
|
665
|
+
- **Issue**: Drive not visible in Claude
|
|
666
|
+
- **Solution**: Verify Vetra Studio is running with the `--watch` flag and the drive is properly initialized.
|
|
667
|
+
|
|
668
|
+
### Related recipes
|
|
669
|
+
|
|
670
|
+
- [Launching Vetra Studio](#launching-vetra-studio)
|
|
671
|
+
- [Creating a Document Model with AI Assistance](#creating-a-document-model-with-ai-assistance)
|
|
672
|
+
- [Creating an Editor with AI Assistance](#creating-an-editor-with-ai-assistance)
|
|
673
|
+
|
|
674
|
+
### Further reading
|
|
675
|
+
|
|
676
|
+
- [Vetra Studio Documentation](/academy/MasteryTrack/BuilderEnvironment/VetraStudio)
|
|
677
|
+
</details>
|
|
678
|
+
|
|
679
|
+
<details id="creating-a-document-model-with-ai-assistance">
|
|
680
|
+
<summary>Creating a Document Model with AI Assistance</summary>
|
|
681
|
+
|
|
682
|
+
### How to Create a Document Model with AI Assistance
|
|
683
|
+
|
|
684
|
+
---
|
|
685
|
+
|
|
686
|
+
### Problem statement
|
|
687
|
+
|
|
688
|
+
You want to create a new document model using natural language descriptions through Claude and the Reactor MCP, rather than manually defining schemas and operations.
|
|
689
|
+
|
|
690
|
+
### Prerequisites
|
|
691
|
+
|
|
692
|
+
- Vetra Studio running (`ph vetra --interactive --watch`)
|
|
693
|
+
- Claude connected to Reactor MCP (see [Connecting Claude with Reactor MCP](#connecting-claude-with-reactor-mcp))
|
|
694
|
+
|
|
695
|
+
### Solution
|
|
696
|
+
|
|
697
|
+
### Step 1: Describe Your Document Model to Claude
|
|
698
|
+
|
|
699
|
+
Provide a detailed description of your document needs. Be specific about:
|
|
700
|
+
- The purpose of the document
|
|
701
|
+
- The data fields and their types
|
|
702
|
+
- The operations users should be able to perform
|
|
703
|
+
- Any relationships or constraints
|
|
704
|
+
|
|
705
|
+
Example prompt:
|
|
706
|
+
|
|
707
|
+
```
|
|
708
|
+
Create a document model for a task tracker with the following requirements:
|
|
709
|
+
- Each task has a title (string), description (string), status (enum: todo, in-progress, done),
|
|
710
|
+
priority (enum: low, medium, high), and due date (optional date)
|
|
711
|
+
- Users should be able to create tasks, update task details, change status, and delete tasks
|
|
712
|
+
- Tasks should track when they were created and last modified
|
|
713
|
+
```
|
|
714
|
+
|
|
715
|
+
### Step 2: Review the Generated Schema
|
|
716
|
+
|
|
717
|
+
Claude will generate:
|
|
718
|
+
- An appropriate GraphQL schema
|
|
719
|
+
- The necessary operations
|
|
720
|
+
- Implementation for the required reducers
|
|
721
|
+
|
|
722
|
+
Review the proposed schema before confirming.
|
|
723
|
+
|
|
724
|
+
### Step 3: Confirm Generation in Interactive Mode
|
|
725
|
+
|
|
726
|
+
If running in interactive mode, you'll be prompted to confirm:
|
|
727
|
+
- Schema changes
|
|
728
|
+
- Operation definitions
|
|
729
|
+
- Code generation
|
|
730
|
+
|
|
731
|
+
### Step 4: Verify in Vetra Studio
|
|
732
|
+
|
|
733
|
+
Check Vetra Studio to see your new document model in the drive. The document should appear with the defined schema and operations.
|
|
734
|
+
|
|
735
|
+
### Expected outcome
|
|
736
|
+
|
|
737
|
+
- A new document model is created based on your natural language description
|
|
738
|
+
- The schema, operations, and reducers are generated automatically
|
|
739
|
+
- The document model is placed in the Vetra drive
|
|
740
|
+
- Code scaffolding is generated in your project
|
|
741
|
+
|
|
742
|
+
### Common issues and solutions
|
|
743
|
+
|
|
744
|
+
- **Issue**: Generated schema doesn't match expectations
|
|
745
|
+
- **Solution**: Provide more specific requirements. Ask Claude clarifying questions before generation.
|
|
746
|
+
- **Issue**: Operations missing functionality
|
|
747
|
+
- **Solution**: Be explicit about all the actions users should be able to perform on the document.
|
|
748
|
+
- **Issue**: Code generation fails
|
|
749
|
+
- **Solution**: Check if the document model is in a valid state. Review any error messages in Vetra Studio.
|
|
750
|
+
|
|
751
|
+
### Related recipes
|
|
752
|
+
|
|
753
|
+
- [Connecting Claude with Reactor MCP](#connecting-claude-with-reactor-mcp)
|
|
754
|
+
- [Creating an Editor with AI Assistance](#creating-an-editor-with-ai-assistance)
|
|
755
|
+
- [Initializing a New Project & Document Model](#initializing-a-new-project-and-document-model)
|
|
756
|
+
|
|
757
|
+
### Further reading
|
|
758
|
+
|
|
759
|
+
- [Vetra Studio Documentation](/academy/MasteryTrack/BuilderEnvironment/VetraStudio)
|
|
760
|
+
- [Document Model Creation](/academy/MasteryTrack/DocumentModelCreation/SpecifyTheStateSchema)
|
|
761
|
+
</details>
|
|
762
|
+
|
|
763
|
+
<details id="creating-an-editor-with-ai-assistance">
|
|
764
|
+
<summary>Creating an Editor with AI Assistance</summary>
|
|
765
|
+
|
|
766
|
+
### How to Create an Editor with AI Assistance
|
|
767
|
+
|
|
768
|
+
---
|
|
769
|
+
|
|
770
|
+
### Problem statement
|
|
771
|
+
|
|
772
|
+
You have a document model and want to create a user interface (editor) for it using AI assistance through Claude and the Reactor MCP.
|
|
773
|
+
|
|
774
|
+
### Prerequisites
|
|
775
|
+
|
|
776
|
+
- Vetra Studio running (`ph vetra --interactive --watch`)
|
|
777
|
+
- Claude connected to Reactor MCP
|
|
778
|
+
- An existing document model in your Vetra drive
|
|
779
|
+
|
|
780
|
+
### Solution
|
|
781
|
+
|
|
782
|
+
### Step 1: Describe Your Editor Requirements to Claude
|
|
783
|
+
|
|
784
|
+
Provide a detailed description including:
|
|
785
|
+
- The document model the editor is for
|
|
786
|
+
- UI layout and components needed
|
|
787
|
+
- User interactions and workflows
|
|
788
|
+
- Any specific styling or design requirements
|
|
789
|
+
- Reference to operations from the document model
|
|
790
|
+
|
|
791
|
+
Example prompt:
|
|
792
|
+
|
|
793
|
+
```
|
|
794
|
+
Create an editor for my task tracker document model with:
|
|
795
|
+
- A form to create new tasks with fields for title, description, priority, and due date
|
|
796
|
+
- A list view showing all tasks grouped by status (todo, in-progress, done)
|
|
797
|
+
- Each task card should show title, priority badge, and due date
|
|
798
|
+
- Clicking a task opens a detail panel for editing
|
|
799
|
+
- Status can be changed via drag-and-drop between columns or a dropdown
|
|
800
|
+
- Use the createTask, updateTask, changeStatus, and deleteTask operations
|
|
801
|
+
```
|
|
802
|
+
|
|
803
|
+
### Step 2: Review Generated Components
|
|
804
|
+
|
|
805
|
+
Claude will generate:
|
|
806
|
+
- Editor components
|
|
807
|
+
- Necessary hooks for document operations
|
|
808
|
+
- Required UI elements
|
|
809
|
+
- Integration with the document model operations
|
|
810
|
+
|
|
811
|
+
### Step 3: Confirm Generation
|
|
812
|
+
|
|
813
|
+
In interactive mode, confirm the proposed changes before they are applied.
|
|
814
|
+
|
|
815
|
+
### Step 4: Verify in Your Project
|
|
816
|
+
|
|
817
|
+
Check the `editors/` directory in your project for the generated editor files. The editor should be registered in your `powerhouse.manifest.json`.
|
|
818
|
+
|
|
819
|
+
### Step 5: Test the Editor
|
|
820
|
+
|
|
821
|
+
Run Vetra Studio and open your document to test the new editor interface.
|
|
822
|
+
|
|
823
|
+
### Expected outcome
|
|
824
|
+
|
|
825
|
+
- Editor components are generated in the `editors/` directory
|
|
826
|
+
- The editor is registered in `powerhouse.manifest.json`
|
|
827
|
+
- The editor integrates with your document model operations
|
|
828
|
+
- You can interact with documents through the new UI
|
|
829
|
+
|
|
830
|
+
### Common issues and solutions
|
|
831
|
+
|
|
832
|
+
- **Issue**: Editor doesn't appear in Vetra Studio
|
|
833
|
+
- **Solution**: Verify the editor is registered in `powerhouse.manifest.json`. Restart Vetra Studio with `--watch`.
|
|
834
|
+
- **Issue**: Operations not working in the editor
|
|
835
|
+
- **Solution**: Ensure the editor references the correct operation names from your document model.
|
|
836
|
+
- **Issue**: Styling doesn't match expectations
|
|
837
|
+
- **Solution**: Provide more detailed design requirements or manually adjust the generated CSS/styles.
|
|
838
|
+
|
|
839
|
+
### Related recipes
|
|
840
|
+
|
|
841
|
+
- [Creating a Document Model with AI Assistance](#creating-a-document-model-with-ai-assistance)
|
|
842
|
+
- [Generating a Document Editor](#generating-a-document-editor)
|
|
843
|
+
- [Connecting Claude with Reactor MCP](#connecting-claude-with-reactor-mcp)
|
|
844
|
+
|
|
845
|
+
### Further reading
|
|
846
|
+
|
|
847
|
+
- [Vetra Studio Documentation](/academy/MasteryTrack/BuilderEnvironment/VetraStudio)
|
|
848
|
+
- [Build a Todo-list Editor](/academy/GetStarted/BuildToDoListEditor)
|
|
849
|
+
</details>
|
|
850
|
+
|
|
398
851
|
## Powerhouse Environment recipes
|
|
399
852
|
|
|
400
853
|
This section covers recipes for setting up and managing Powerhouse environments, from local development to production servers.
|
|
@@ -402,21 +855,21 @@ This section covers recipes for setting up and managing Powerhouse environments,
|
|
|
402
855
|
<details id="setting-up-a-production-environment">
|
|
403
856
|
<summary>Setting up a Production Environment</summary>
|
|
404
857
|
|
|
405
|
-
|
|
858
|
+
### How to set up a Production Powerhouse Environment
|
|
406
859
|
|
|
407
860
|
---
|
|
408
861
|
|
|
409
|
-
|
|
862
|
+
### Problem statement
|
|
410
863
|
|
|
411
864
|
You need to set up a new production-ready server to host and run your Powerhouse services (Connect and Switchboard).
|
|
412
865
|
|
|
413
|
-
|
|
866
|
+
### Prerequisites
|
|
414
867
|
|
|
415
868
|
- A Linux-based server (Ubuntu or Debian recommended) with `sudo` privileges.
|
|
416
869
|
- A registered domain name.
|
|
417
870
|
- DNS `A` records for your `connect` and `switchboard` subdomains pointing to your server's public IP address.
|
|
418
871
|
|
|
419
|
-
|
|
872
|
+
### Solution
|
|
420
873
|
|
|
421
874
|
### Step 1: Install Powerhouse Services
|
|
422
875
|
|
|
@@ -457,14 +910,14 @@ During the setup, you will be prompted for:
|
|
|
457
910
|
- **Database:** Choose between a local PostgreSQL setup or connecting to a remote database.
|
|
458
911
|
- **SSL Certificate:** Select Let's Encrypt for a production setup. You will need to provide your domain and subdomains.
|
|
459
912
|
|
|
460
|
-
|
|
913
|
+
### Expected outcome
|
|
461
914
|
|
|
462
915
|
- Powerhouse Connect and Switchboard services are installed, configured, and running on your server.
|
|
463
916
|
- Nginx is set up as a reverse proxy with SSL certificates from Let's Encrypt.
|
|
464
917
|
- Services are managed by PM2 and will restart automatically on boot or if they crash.
|
|
465
918
|
- You can access your services securely at `https://connect.yourdomain.com` and `https://switchboard.yourdomain.com`.
|
|
466
919
|
|
|
467
|
-
|
|
920
|
+
### Common issues and solutions
|
|
468
921
|
|
|
469
922
|
- **Issue:** `ph: command not found`
|
|
470
923
|
- **Solution:** Ensure you have reloaded your shell with `source ~/.bashrc` or have restarted your terminal session.
|
|
@@ -473,11 +926,11 @@ During the setup, you will be prompted for:
|
|
|
473
926
|
- **Issue:** Services fail to start.
|
|
474
927
|
- **Solution:** Check the service logs for errors using `ph service logs` or `pm2 logs`.
|
|
475
928
|
|
|
476
|
-
|
|
929
|
+
### Related recipes
|
|
477
930
|
|
|
478
931
|
- [Installing a Custom Powerhouse Package](#installing-a-custom-powerhouse-package)
|
|
479
932
|
|
|
480
|
-
|
|
933
|
+
### Further reading
|
|
481
934
|
|
|
482
935
|
- [Full Setup Guide](/academy/MasteryTrack/Launch/SetupEnvironment)
|
|
483
936
|
</details>
|
|
@@ -489,22 +942,22 @@ This section focuses on creating, configuring, and managing Powerhouse projects,
|
|
|
489
942
|
<details id="initializing-a-new-project-and-document-model">
|
|
490
943
|
<summary>Initializing a New Project & Document Model</summary>
|
|
491
944
|
|
|
492
|
-
|
|
945
|
+
### How to initialize a new project and document model
|
|
493
946
|
|
|
494
947
|
---
|
|
495
948
|
|
|
496
|
-
|
|
949
|
+
### Problem statement
|
|
497
950
|
|
|
498
951
|
You need to create a new, empty document model within a Powerhouse project using the local Connect application (Studio mode) to represent a workflow of a business process.
|
|
499
952
|
|
|
500
|
-
|
|
953
|
+
### Prerequisites
|
|
501
954
|
|
|
502
955
|
- Powerhouse CLI (`ph-cmd`) installed
|
|
503
956
|
- A Powerhouse project initialized (see [Initializing a Powerhouse Project Recipe](#powerhouse-cli-recipes)) or follow Step 1 & 2 below.
|
|
504
957
|
- Access to a terminal or command prompt
|
|
505
958
|
- A web browser
|
|
506
959
|
|
|
507
|
-
|
|
960
|
+
### Solution
|
|
508
961
|
|
|
509
962
|
### Step 1: Initialize a Powerhouse Project (if needed)
|
|
510
963
|
|
|
@@ -545,12 +998,12 @@ Click on your local drive displayed on the Connect interface.
|
|
|
545
998
|
|
|
546
999
|
In the "New Document" section at the bottom of the page, click the `DocumentModel` button.
|
|
547
1000
|
|
|
548
|
-
|
|
1001
|
+
### Expected outcome
|
|
549
1002
|
|
|
550
1003
|
- An empty document model is created and opened in the Document Model Editor within the Connect application.
|
|
551
1004
|
- You are ready to start defining the schema and logic for your new model.
|
|
552
1005
|
|
|
553
|
-
|
|
1006
|
+
### Common issues and solutions
|
|
554
1007
|
|
|
555
1008
|
- Issue: `ph connect` command fails.
|
|
556
1009
|
- Solution: Ensure `ph-cmd` is installed correctly (`ph-cmd --version`). Check for port conflicts if `3000` is already in use. Make sure you are inside the project directory created by `ph init`.
|
|
@@ -559,13 +1012,13 @@ In the "New Document" section at the bottom of the page, click the `DocumentMode
|
|
|
559
1012
|
- Issue: Cannot find the `DocumentModel` button.
|
|
560
1013
|
- Solution: Ensure you have navigated into your local drive within the Connect application first.
|
|
561
1014
|
|
|
562
|
-
|
|
1015
|
+
### Related recipes
|
|
563
1016
|
|
|
564
1017
|
- [Initializing a Powerhouse Project](#powerhouse-cli-recipes)
|
|
565
1018
|
- Designing a Document Model Schema (WIP)
|
|
566
1019
|
- Implementing Document Model Reducers (Details to be added)
|
|
567
1020
|
|
|
568
|
-
|
|
1021
|
+
### Further reading
|
|
569
1022
|
|
|
570
1023
|
- [GraphQL Schema Best Practices](/academy/MasteryTrack/WorkWithData/GraphQLAtPowerhouse)
|
|
571
1024
|
</details>
|
|
@@ -573,21 +1026,21 @@ In the "New Document" section at the bottom of the page, click the `DocumentMode
|
|
|
573
1026
|
<details id="generating-reducers-from-a-document-model-file">
|
|
574
1027
|
<summary>Generating Reducers from a Document Model File</summary>
|
|
575
1028
|
|
|
576
|
-
|
|
1029
|
+
### How to Generate Reducers from a Document Model File
|
|
577
1030
|
|
|
578
1031
|
---
|
|
579
1032
|
|
|
580
|
-
|
|
1033
|
+
### Problem statement
|
|
581
1034
|
|
|
582
1035
|
You have a Powerhouse Document Model defined in a `.phdm` or `.phdm.zip` file and need to generate the corresponding reducer functions for your project.
|
|
583
1036
|
|
|
584
|
-
|
|
1037
|
+
### Prerequisites
|
|
585
1038
|
|
|
586
1039
|
- Powerhouse CLI (`ph-cmd`) installed
|
|
587
1040
|
- A Powerhouse project initialized (`ph init`)
|
|
588
1041
|
- A `.phdm` or `.phdm.zip` file containing your document model definition, placed in your project (e.g., at the root).
|
|
589
1042
|
|
|
590
|
-
|
|
1043
|
+
### Solution
|
|
591
1044
|
|
|
592
1045
|
### Step 1: Navigate to Project Directory
|
|
593
1046
|
|
|
@@ -610,14 +1063,14 @@ ph generate todo.phdm.zip
|
|
|
610
1063
|
|
|
611
1064
|
The command will output the generated reducer scaffolding code in the designated folders.
|
|
612
1065
|
|
|
613
|
-
|
|
1066
|
+
### Expected outcome
|
|
614
1067
|
|
|
615
1068
|
- Reducer functions corresponding to the operations defined in your document model are generated.
|
|
616
1069
|
- The generated code is ready to be integrated into your project's state management logic.
|
|
617
1070
|
|
|
618
|
-
|
|
1071
|
+
### Common issues and solutions
|
|
619
1072
|
|
|
620
|
-
|
|
1073
|
+
### Related recipes
|
|
621
1074
|
|
|
622
1075
|
- [Initializing a New Project & Document Model](#initializing-a-new-project-and-document-model)
|
|
623
1076
|
- Generating a Document Editor
|
|
@@ -627,11 +1080,11 @@ The command will output the generated reducer scaffolding code in the designated
|
|
|
627
1080
|
<details id="updating-your-powerhouse-project-dependencies">
|
|
628
1081
|
<summary>Updating Your Powerhouse Project Dependencies</summary>
|
|
629
1082
|
|
|
630
|
-
|
|
1083
|
+
### How to Update Your Powerhouse Project Dependencies
|
|
631
1084
|
|
|
632
1085
|
---
|
|
633
1086
|
|
|
634
|
-
|
|
1087
|
+
### Problem statement
|
|
635
1088
|
|
|
636
1089
|
The update command allows you to update your Powerhouse dependencies to their latest versions based on the version ranges specified in your package.json.
|
|
637
1090
|
|
|
@@ -670,21 +1123,21 @@ ph update --package-manager pnpm
|
|
|
670
1123
|
<details id="running-connect-with-https-and-a-custom-port">
|
|
671
1124
|
<summary>Running Connect with HTTPS and a Custom Port</summary>
|
|
672
1125
|
|
|
673
|
-
|
|
1126
|
+
### How to Run Connect with HTTPS and a Custom Port
|
|
674
1127
|
|
|
675
1128
|
---
|
|
676
1129
|
|
|
677
|
-
|
|
1130
|
+
### Problem statement
|
|
678
1131
|
|
|
679
1132
|
You need to run the local Powerhouse Connect application using HTTPS, possibly on a different port than the default, for scenarios like testing on a remote server (e.g., EC2) or complying with specific network requirements.
|
|
680
1133
|
|
|
681
|
-
|
|
1134
|
+
### Prerequisites
|
|
682
1135
|
|
|
683
1136
|
- Powerhouse CLI (`ph-cmd`) installed
|
|
684
1137
|
- A Powerhouse project initialized (`ph init`)
|
|
685
1138
|
- Potentially, valid SSL/TLS certificates if running in a non-localhost environment that requires trusted HTTPS. (The `--https` flag may use self-signed certificates for local development).
|
|
686
1139
|
|
|
687
|
-
|
|
1140
|
+
### Solution
|
|
688
1141
|
|
|
689
1142
|
### Step 1: Navigate to Project Directory
|
|
690
1143
|
|
|
@@ -715,12 +1168,12 @@ https://<your-hostname-or-ip>:<port>
|
|
|
715
1168
|
|
|
716
1169
|
You might encounter a browser warning about the self-signed certificate; you may need to accept the risk to proceed for local/development testing.
|
|
717
1170
|
|
|
718
|
-
|
|
1171
|
+
### Expected outcome
|
|
719
1172
|
|
|
720
1173
|
- The Powerhouse Connect application starts and serves traffic over HTTPS on the specified port.
|
|
721
1174
|
- You can access the Connect interface securely using the `https` protocol.
|
|
722
1175
|
|
|
723
|
-
|
|
1176
|
+
### Common issues and solutions
|
|
724
1177
|
|
|
725
1178
|
- Issue: Browser shows security warnings (e.g., "Your connection is not private").
|
|
726
1179
|
- Solution: This is expected when using the default self-signed certificate generated by `--https`. For development or internal testing, you can usually proceed by accepting the risk. For production or public-facing scenarios, configure Connect with properly signed certificates (consult Powerhouse documentation for advanced configuration).
|
|
@@ -729,11 +1182,11 @@ You might encounter a browser warning about the self-signed certificate; you may
|
|
|
729
1182
|
- Issue: Cannot access Connect from a remote machine.
|
|
730
1183
|
- Solution: Ensure the port is open in any firewalls (on the server and potentially network firewalls). Verify you are using the correct public IP address or hostname of the machine running Connect.
|
|
731
1184
|
|
|
732
|
-
|
|
1185
|
+
### Related recipes
|
|
733
1186
|
|
|
734
1187
|
- [Initializing a New Project & Document Model](#initializing-a-new-project-and-document-model)
|
|
735
1188
|
|
|
736
|
-
|
|
1189
|
+
### Further reading
|
|
737
1190
|
|
|
738
1191
|
- [Powerhouse Builder Tools](/academy/MasteryTrack/BuilderEnvironment/BuilderTools)
|
|
739
1192
|
- [GraphQL Schema Best Practices](/academy/MasteryTrack/WorkWithData/GraphQLAtPowerhouse)
|
|
@@ -746,21 +1199,21 @@ This section provides guidance on generating and customizing editors for Documen
|
|
|
746
1199
|
<details id="generating-a-document-editor">
|
|
747
1200
|
<summary>Generating a Document Editor</summary>
|
|
748
1201
|
|
|
749
|
-
|
|
1202
|
+
### How to Generate a Document Editor
|
|
750
1203
|
|
|
751
1204
|
---
|
|
752
1205
|
|
|
753
|
-
|
|
1206
|
+
### Problem statement
|
|
754
1207
|
|
|
755
1208
|
You have a Powerhouse document model and need to create a user interface (editor) for it to be used within the Connect application.
|
|
756
1209
|
|
|
757
|
-
|
|
1210
|
+
### Prerequisites
|
|
758
1211
|
|
|
759
1212
|
- Powerhouse CLI (`ph-cmd`) installed
|
|
760
1213
|
- A Powerhouse project initialized (`ph init`)
|
|
761
1214
|
- A document model generated or defined within the project (e.g., in the `document-models` directory).
|
|
762
1215
|
|
|
763
|
-
|
|
1216
|
+
### Solution
|
|
764
1217
|
|
|
765
1218
|
### Step 1: Navigate to Project Directory
|
|
766
1219
|
|
|
@@ -780,18 +1233,18 @@ Run the `generate` command, specifying the editor name (usually matching the doc
|
|
|
780
1233
|
ph generate --editor <ModelName> --document-types <docType>
|
|
781
1234
|
```
|
|
782
1235
|
|
|
783
|
-
|
|
1236
|
+
### Expected outcome
|
|
784
1237
|
|
|
785
1238
|
- A new directory is created under `editors/` (e.g., `editors/<model-name>/`).
|
|
786
1239
|
- An `editor.tsx` file is generated within that directory, containing a basic template for your document editor.
|
|
787
1240
|
- You can now customize `editor.tsx` to build your desired UI using HTML, Tailwind CSS, or custom CSS.
|
|
788
1241
|
|
|
789
|
-
|
|
1242
|
+
### Related recipes
|
|
790
1243
|
|
|
791
1244
|
- [Initializing a New Project & Document Model](#initializing-a-new-project-and-document-model)
|
|
792
1245
|
- [Generating a Custom Drive Explorer](#generating-a-custom-drive-explorer)
|
|
793
1246
|
|
|
794
|
-
|
|
1247
|
+
### Further reading
|
|
795
1248
|
|
|
796
1249
|
- [Build a Todo-list Editor](/academy/GetStarted/BuildToDoListEditor)
|
|
797
1250
|
</details>
|
|
@@ -799,20 +1252,20 @@ ph generate --editor <ModelName> --document-types <docType>
|
|
|
799
1252
|
<details id="generating-a-custom-drive-explorer">
|
|
800
1253
|
<summary>Generating a Custom Drive Explorer</summary>
|
|
801
1254
|
|
|
802
|
-
|
|
1255
|
+
### How to Generate a Custom Drive Explorer
|
|
803
1256
|
|
|
804
1257
|
---
|
|
805
1258
|
|
|
806
|
-
|
|
1259
|
+
### Problem statement
|
|
807
1260
|
|
|
808
1261
|
You need a custom, application-like interface to browse, organize, or interact with specific types of documents stored within a Powerhouse drive, going beyond the standard file listing.
|
|
809
1262
|
|
|
810
|
-
|
|
1263
|
+
### Prerequisites
|
|
811
1264
|
|
|
812
1265
|
- Powerhouse CLI (`ph-cmd`) installed
|
|
813
1266
|
- A Powerhouse project initialized (`ph init`)
|
|
814
1267
|
|
|
815
|
-
|
|
1268
|
+
### Solution
|
|
816
1269
|
|
|
817
1270
|
### Step 1: Navigate to Project Directory
|
|
818
1271
|
|
|
@@ -831,18 +1284,18 @@ Run the `generate` command, specifying the `--drive-editor` flag and a name for
|
|
|
831
1284
|
ph generate --drive-editor <drive-app-name>
|
|
832
1285
|
```
|
|
833
1286
|
|
|
834
|
-
|
|
1287
|
+
### Expected outcome
|
|
835
1288
|
|
|
836
1289
|
- A new directory is created under `editors/` (e.g., `editors/<drive-app-name>/`).
|
|
837
1290
|
- Template files (`EditorContainer.tsx`, components, hooks, etc.) are generated within that directory, providing a basic structure for a drive explorer.
|
|
838
1291
|
- You can now customize these files to create your specific drive interface, potentially removing default components and adding custom views relevant to your document models.
|
|
839
1292
|
- Remember to update your `powerhouse.manifest.json` to register the new app.
|
|
840
1293
|
|
|
841
|
-
|
|
1294
|
+
### Related recipes
|
|
842
1295
|
|
|
843
1296
|
- [Generating a Document Editor](#generating-a-document-editor)
|
|
844
1297
|
|
|
845
|
-
|
|
1298
|
+
### Further reading
|
|
846
1299
|
|
|
847
1300
|
- [Build a Drive-Explorer](/academy/MasteryTrack/BuildingUserExperiences/BuildingADriveExplorer)
|
|
848
1301
|
</details>
|
|
@@ -850,21 +1303,21 @@ ph generate --drive-editor <drive-app-name>
|
|
|
850
1303
|
<details id="adding-a-new-drive-via-graphql-mutation">
|
|
851
1304
|
<summary>Adding a New Drive via GraphQL Mutation</summary>
|
|
852
1305
|
|
|
853
|
-
|
|
1306
|
+
### How to Add a New Remote Drive via GraphQL Mutation
|
|
854
1307
|
|
|
855
1308
|
---
|
|
856
1309
|
|
|
857
|
-
|
|
1310
|
+
### Problem statement
|
|
858
1311
|
|
|
859
1312
|
You want to programmatically add a new remote drive to your Powerhouse Connect environment using a GraphQL mutation. This is useful for automation, scripting, or integrating with external systems.
|
|
860
1313
|
|
|
861
|
-
|
|
1314
|
+
### Prerequisites
|
|
862
1315
|
|
|
863
1316
|
- Access to the Switchboard or remote reactor (server node) of your Connect instance.
|
|
864
1317
|
- The GraphQL endpoint for your instance (e.g., `https://staging.switchboard.phd/graphql/system`).
|
|
865
1318
|
- Appropriate permissions to perform mutations.
|
|
866
1319
|
|
|
867
|
-
|
|
1320
|
+
### Solution
|
|
868
1321
|
|
|
869
1322
|
### Step 1: Access the GraphQL Playground or Client
|
|
870
1323
|
|
|
@@ -931,17 +1384,17 @@ Once you have the `id` or `slug`, you can construct the drive URL for Connect:
|
|
|
931
1384
|
|
|
932
1385
|
Use the constructed URL to add or access the drive in your Connect environment.
|
|
933
1386
|
|
|
934
|
-
|
|
1387
|
+
### Expected outcome
|
|
935
1388
|
|
|
936
1389
|
- A new drive is created and accessible in your Connect environment.
|
|
937
1390
|
- The drive can be managed or accessed using the generated URL.
|
|
938
1391
|
|
|
939
|
-
|
|
1392
|
+
### Related recipes
|
|
940
1393
|
|
|
941
1394
|
- [Configuring Drives](/academy/MasteryTrack/BuildingUserExperiences/ConfiguringDrives)
|
|
942
1395
|
- [Initializing a New Project & Document Model](#initializing-a-new-project-and-document-model)
|
|
943
1396
|
|
|
944
|
-
|
|
1397
|
+
### Further reading
|
|
945
1398
|
|
|
946
1399
|
- [GraphQL Playground](https://www.apollographql.com/docs/apollo-server/testing/graphql-playground/)
|
|
947
1400
|
- [Powerhouse Builder Tools](/academy/MasteryTrack/BuilderEnvironment/BuilderTools)
|
|
@@ -955,21 +1408,21 @@ Learn how to manage the Powerhouse Reactor, the local service for processing doc
|
|
|
955
1408
|
<details id="starting-the-reactor">
|
|
956
1409
|
<summary>Starting the Reactor</summary>
|
|
957
1410
|
|
|
958
|
-
|
|
1411
|
+
### How to Start the Powerhouse Reactor
|
|
959
1412
|
|
|
960
1413
|
---
|
|
961
1414
|
|
|
962
|
-
|
|
1415
|
+
### Problem statement
|
|
963
1416
|
|
|
964
1417
|
You need to start the Powerhouse Reactor, the local service responsible for processing document model operations and managing state, typically for testing or development purposes.
|
|
965
1418
|
|
|
966
|
-
|
|
1419
|
+
### Prerequisites
|
|
967
1420
|
|
|
968
1421
|
- Powerhouse CLI (`ph-cmd`) installed
|
|
969
1422
|
- A Powerhouse project initialized (`ph init`)
|
|
970
1423
|
- You are in the root directory of your Powerhouse project.
|
|
971
1424
|
|
|
972
|
-
|
|
1425
|
+
### Solution
|
|
973
1426
|
|
|
974
1427
|
### Step 1: Navigate to Project Directory (if needed)
|
|
975
1428
|
|
|
@@ -987,20 +1440,20 @@ Execute the `ph reactor` command.
|
|
|
987
1440
|
ph reactor
|
|
988
1441
|
```
|
|
989
1442
|
|
|
990
|
-
|
|
1443
|
+
### Expected outcome
|
|
991
1444
|
|
|
992
1445
|
- The Reactor service starts, typically listening on `localhost:4001`.
|
|
993
1446
|
- You will see log output indicating the reactor is running and ready to process operations.
|
|
994
1447
|
- A GraphQL endpoint is usually available at `http://localhost:4001/graphql` for direct interaction and testing.
|
|
995
1448
|
|
|
996
|
-
|
|
1449
|
+
### Common issues and solutions
|
|
997
1450
|
|
|
998
1451
|
- Issue: Reactor fails to start, mentioning port conflicts.
|
|
999
1452
|
- Solution: Ensure port `4001` (or the configured reactor port) is not already in use by another application. Stop the conflicting application or configure the reactor to use a different port (if possible, check documentation).
|
|
1000
1453
|
- Issue: Errors related to storage or configuration.
|
|
1001
1454
|
- Solution: Check the `powerhouse.manifest.json` and any reactor-specific configuration files for errors. Ensure storage providers (like local disk) are accessible and configured correctly.
|
|
1002
1455
|
|
|
1003
|
-
|
|
1456
|
+
### Related recipes
|
|
1004
1457
|
|
|
1005
1458
|
- [Initializing a New Project & Document Model](#initializing-a-new-project-and-document-model)
|
|
1006
1459
|
- Testing with GraphQL (Details to be added)
|
|
@@ -1014,21 +1467,21 @@ These recipes guide you through creating, installing, and managing Powerhouse Pa
|
|
|
1014
1467
|
<details id="installing-a-custom-powerhouse-package">
|
|
1015
1468
|
<summary>Installing a Custom Powerhouse Package</summary>
|
|
1016
1469
|
|
|
1017
|
-
|
|
1470
|
+
### How to Install a Custom Powerhouse Package
|
|
1018
1471
|
|
|
1019
1472
|
---
|
|
1020
1473
|
|
|
1021
|
-
|
|
1474
|
+
### Problem statement
|
|
1022
1475
|
|
|
1023
1476
|
You have developed and published a Powerhouse package (containing document models, editors, etc.) to npm, or you have a local package, and you need to install it into another Powerhouse project.
|
|
1024
1477
|
|
|
1025
|
-
|
|
1478
|
+
### Prerequisites
|
|
1026
1479
|
|
|
1027
1480
|
- Powerhouse CLI (`ph-cmd`) installed
|
|
1028
1481
|
- A Powerhouse project initialized (`ph init`) where you want to install the package.
|
|
1029
1482
|
- The custom package is either published to npm or available locally.
|
|
1030
1483
|
|
|
1031
|
-
|
|
1484
|
+
### Solution
|
|
1032
1485
|
|
|
1033
1486
|
### Step 1: Navigate to the Target Project Directory
|
|
1034
1487
|
|
|
@@ -1063,13 +1516,13 @@ ph install /Users/you/dev/my-local-package
|
|
|
1063
1516
|
|
|
1064
1517
|
Check your project's `package.json` and `powerhouse.manifest.json` to ensure the package dependency has been added correctly. Run `ph connect` to see if the components from the installed package are available.
|
|
1065
1518
|
|
|
1066
|
-
|
|
1519
|
+
### Expected outcome
|
|
1067
1520
|
|
|
1068
1521
|
- The custom Powerhouse package is downloaded and installed into your project's dependencies.
|
|
1069
1522
|
- The `powerhouse.manifest.json` is updated (if necessary) to reflect the installed package.
|
|
1070
1523
|
- Document models, editors, drive explorers, or other components from the package become available within the target project.
|
|
1071
1524
|
|
|
1072
|
-
|
|
1525
|
+
### Common issues and solutions
|
|
1073
1526
|
|
|
1074
1527
|
- Issue: Package not found (npm).
|
|
1075
1528
|
- Solution: Double-check the package name for typos. Ensure the package is published and accessible on npm.
|
|
@@ -1078,7 +1531,7 @@ Check your project's `package.json` and `powerhouse.manifest.json` to ensure the
|
|
|
1078
1531
|
- Issue: Conflicts with existing project components or dependencies.
|
|
1079
1532
|
- Solution: Resolve version conflicts or naming collisions as needed. Review the installed package's structure and dependencies.
|
|
1080
1533
|
|
|
1081
|
-
|
|
1534
|
+
### Related recipes
|
|
1082
1535
|
|
|
1083
1536
|
- [Publishing a Powerhouse Package](#publishing-a-powerhouse-package)
|
|
1084
1537
|
- [Initializing a Powerhouse Project](#initializing-a-new-project-and-document-model)
|
|
@@ -1088,13 +1541,13 @@ Check your project's `package.json` and `powerhouse.manifest.json` to ensure the
|
|
|
1088
1541
|
<details id="managing-powerhouse-dependencies-and-versions">
|
|
1089
1542
|
<summary>Managing Powerhouse Dependencies and Versions</summary>
|
|
1090
1543
|
|
|
1091
|
-
|
|
1544
|
+
### How to Manage Powerhouse Dependencies and Versions
|
|
1092
1545
|
|
|
1093
1546
|
---
|
|
1094
1547
|
|
|
1095
1548
|
> **Note:** This is a temporary solution until version control is fully implemented in Powerhouse. Future updates may change how dependencies are managed.
|
|
1096
1549
|
|
|
1097
|
-
|
|
1550
|
+
### Problem statement
|
|
1098
1551
|
|
|
1099
1552
|
You need to understand and manage different types of dependencies in your Powerhouse project, including:
|
|
1100
1553
|
|
|
@@ -1102,15 +1555,15 @@ You need to understand and manage different types of dependencies in your Powerh
|
|
|
1102
1555
|
- Project-specific dependencies (from published npm packages)
|
|
1103
1556
|
- Boilerplate dependencies
|
|
1104
1557
|
|
|
1105
|
-
|
|
1558
|
+
### Prerequisites
|
|
1106
1559
|
|
|
1107
1560
|
- Powerhouse CLI (`ph-cmd`) installed
|
|
1108
1561
|
- A Powerhouse project initialized (`ph init`)
|
|
1109
1562
|
- npm account (if you need to publish packages)
|
|
1110
1563
|
|
|
1111
|
-
|
|
1564
|
+
### Solution
|
|
1112
1565
|
|
|
1113
|
-
|
|
1566
|
+
#### Understanding Different Types of Dependencies
|
|
1114
1567
|
|
|
1115
1568
|
1. **Monorepo Dependencies**
|
|
1116
1569
|
- The Powerhouse monorepo has three main branches:
|
|
@@ -1148,7 +1601,7 @@ You need to understand and manage different types of dependencies in your Powerh
|
|
|
1148
1601
|
2. Publish the updated package to npm
|
|
1149
1602
|
3. Other projects will then get the new version when they run `ph install`
|
|
1150
1603
|
|
|
1151
|
-
|
|
1604
|
+
#### Important Notes
|
|
1152
1605
|
|
|
1153
1606
|
1. **Breaking Changes**
|
|
1154
1607
|
- Currently, updating Connect versions might break older packages
|
|
@@ -1160,13 +1613,13 @@ You need to understand and manage different types of dependencies in your Powerh
|
|
|
1160
1613
|
- Other projects will still download the latest published version from npm
|
|
1161
1614
|
- For testing, you can publish to your own npm account
|
|
1162
1615
|
|
|
1163
|
-
|
|
1616
|
+
### Expected outcome
|
|
1164
1617
|
|
|
1165
1618
|
- Clear understanding of different dependency types
|
|
1166
1619
|
- Ability to manage and update dependencies appropriately
|
|
1167
1620
|
- Knowledge of when to publish updated packages
|
|
1168
1621
|
|
|
1169
|
-
|
|
1622
|
+
### Common issues and solutions
|
|
1170
1623
|
|
|
1171
1624
|
- Issue: Dependencies not updating as expected
|
|
1172
1625
|
- Solution: Ensure you're using the correct `ph use` command for your needs
|
|
@@ -1175,13 +1628,13 @@ You need to understand and manage different types of dependencies in your Powerh
|
|
|
1175
1628
|
- Issue: Confusion about which version is being used
|
|
1176
1629
|
- Solution: Check your package.json and powerhouse.manifest.json for current versions
|
|
1177
1630
|
|
|
1178
|
-
|
|
1631
|
+
### Related recipes
|
|
1179
1632
|
|
|
1180
1633
|
- [Installing 'ph-cmd'](#installing-ph-cmd)
|
|
1181
1634
|
- [Using Different Branches in Powerhouse](#using-different-branches-in-powerhouse)
|
|
1182
1635
|
- [Setting up or Resetting the Global Powerhouse Configuration](#setting-up-or-resetting-the-global-powerhouse-configuration)
|
|
1183
1636
|
|
|
1184
|
-
|
|
1637
|
+
### Further reading
|
|
1185
1638
|
|
|
1186
1639
|
- [Powerhouse Builder Tools](/academy/MasteryTrack/BuilderEnvironment/BuilderTools)
|
|
1187
1640
|
- [GraphQL Schema Best Practices](/academy/MasteryTrack/WorkWithData/GraphQLAtPowerhouse)
|
|
@@ -1191,22 +1644,22 @@ You need to understand and manage different types of dependencies in your Powerh
|
|
|
1191
1644
|
<details id="packaging-and-publishing-a-powerhouse-project">
|
|
1192
1645
|
<summary>Packaging and Publishing a Powerhouse Project</summary>
|
|
1193
1646
|
|
|
1194
|
-
|
|
1647
|
+
### How to Package and Publish a Powerhouse Project
|
|
1195
1648
|
|
|
1196
1649
|
---
|
|
1197
1650
|
|
|
1198
|
-
|
|
1651
|
+
### Problem statement
|
|
1199
1652
|
|
|
1200
1653
|
You have created a collection of document models, editors, or other components and want to share it as a reusable package on a public or private npm registry. Publishing a package allows other projects to install and use your creations easily.
|
|
1201
1654
|
|
|
1202
|
-
|
|
1655
|
+
### Prerequisites
|
|
1203
1656
|
|
|
1204
1657
|
- A completed Powerhouse project that you are ready to share.
|
|
1205
1658
|
- An account on [npmjs.com](https://www.npmjs.com/) (or a private registry).
|
|
1206
1659
|
- Your project's `package.json` should have a unique name and correct version.
|
|
1207
1660
|
- You must be logged into your npm account via the command line.
|
|
1208
1661
|
|
|
1209
|
-
|
|
1662
|
+
### Solution
|
|
1210
1663
|
|
|
1211
1664
|
### Step 1: Build the Project
|
|
1212
1665
|
|
|
@@ -1255,18 +1708,18 @@ git push
|
|
|
1255
1708
|
git push --tags
|
|
1256
1709
|
```
|
|
1257
1710
|
|
|
1258
|
-
|
|
1711
|
+
### Expected outcome
|
|
1259
1712
|
|
|
1260
1713
|
- Your Powerhouse project is successfully published to the npm registry.
|
|
1261
1714
|
- Other developers can now install your package into their projects using `ph install @your-org/your-package-name`.
|
|
1262
1715
|
- Your Git repository is updated with the new version information.
|
|
1263
1716
|
|
|
1264
|
-
|
|
1717
|
+
### Common issues and solutions
|
|
1265
1718
|
|
|
1266
1719
|
- **Issue**: "403 Forbidden" or "You do not have permission" error on publish.
|
|
1267
1720
|
- **Solution**: Ensure your package name is unique and not already taken on npm. If it's a scoped package (`@scope/name`), make sure the organization exists and you have permission to publish to it. For public scoped packages, you must include `--access public`.
|
|
1268
1721
|
|
|
1269
|
-
|
|
1722
|
+
### Related recipes
|
|
1270
1723
|
|
|
1271
1724
|
- [Installing a Custom Powerhouse Package](#installing-a-custom-powerhouse-package)
|
|
1272
1725
|
- [Managing Powerhouse Dependencies and Versions](#managing-powerhouse-dependencies-and-versions)
|
|
@@ -1280,15 +1733,15 @@ This section helps troubleshoot and understand data synchronization within the P
|
|
|
1280
1733
|
<details id="troubleshooting-document-syncing">
|
|
1281
1734
|
<summary>Troubleshooting Document Syncing: Supergraph vs. Drive Endpoints</summary>
|
|
1282
1735
|
|
|
1283
|
-
|
|
1736
|
+
### Troubleshooting Document Syncing: Supergraph vs. Drive Endpoints
|
|
1284
1737
|
|
|
1285
1738
|
---
|
|
1286
1739
|
|
|
1287
|
-
|
|
1740
|
+
### Problem statement
|
|
1288
1741
|
|
|
1289
1742
|
You've created or modified documents within a specific drive using Powerhouse Connect, but when you query the main GraphQL endpoint (`http://localhost:4001/graphql`), you don't see the changes or the documents you expected. This can lead to confusion about whether data is being synced correctly.
|
|
1290
1743
|
|
|
1291
|
-
|
|
1744
|
+
### Prerequisites
|
|
1292
1745
|
|
|
1293
1746
|
- Powerhouse CLI (`ph-cmd`) installed.
|
|
1294
1747
|
- A Powerhouse project initialized (`ph init`).
|
|
@@ -1296,7 +1749,7 @@ You've created or modified documents within a specific drive using Powerhouse Co
|
|
|
1296
1749
|
- Powerhouse Connect is running (`ph connect`).
|
|
1297
1750
|
- You have attempted to create or modify documents in a drive (e.g., a "finances" drive).
|
|
1298
1751
|
|
|
1299
|
-
|
|
1752
|
+
### Solution
|
|
1300
1753
|
|
|
1301
1754
|
Understanding the different GraphQL endpoints in Powerhouse is crucial for effective troubleshooting:
|
|
1302
1755
|
|
|
@@ -1329,14 +1782,14 @@ Understanding the different GraphQL endpoints in Powerhouse is crucial for effec
|
|
|
1329
1782
|
- Try deleting the `.ph` folder in your user's home directory (`~/.ph`). This folder stores global Powerhouse configurations and cached dependencies.
|
|
1330
1783
|
- Clear browser storage (localStorage, IndexedDB) for the Connect application.
|
|
1331
1784
|
|
|
1332
|
-
|
|
1785
|
+
### Expected outcome
|
|
1333
1786
|
|
|
1334
1787
|
- You can correctly identify which GraphQL endpoint to use for different types of queries and operations.
|
|
1335
1788
|
- You understand that document-specific operations (like creating or updating documents in a drive) are typically handled by drive-specific endpoints.
|
|
1336
1789
|
- You can use browser developer tools to inspect network requests and confirm which endpoints Powerhouse Connect is using.
|
|
1337
1790
|
- Documents sync as expected, and you can retrieve their state by querying the appropriate endpoint.
|
|
1338
1791
|
|
|
1339
|
-
|
|
1792
|
+
### Common issues and solutions
|
|
1340
1793
|
|
|
1341
1794
|
- **Issue:** Documents created in Connect don't appear when querying `http://localhost:4001/graphql`.
|
|
1342
1795
|
- **Solution:** You are likely querying the general supergraph. For document-specific data, ensure you are targeting the drive's endpoint (e.g., `http://localhost:4001/d/<driveId>`) or using queries designed to fetch data from specific drives. Inspect Connect's network activity to see the endpoint it uses for `pushUpdates`.
|
|
@@ -1348,20 +1801,20 @@ Understanding the different GraphQL endpoints in Powerhouse is crucial for effec
|
|
|
1348
1801
|
<details id="resetting-your-localhost-environment">
|
|
1349
1802
|
<summary>Resetting Your Localhost Environment</summary>
|
|
1350
1803
|
|
|
1351
|
-
|
|
1804
|
+
### How to Reset Your Localhost Environment
|
|
1352
1805
|
|
|
1353
1806
|
---
|
|
1354
1807
|
|
|
1355
|
-
|
|
1808
|
+
### Problem statement
|
|
1356
1809
|
|
|
1357
1810
|
You are running Powerhouse Connect locally (via `ph connect`), but you can't find your local drive in the interface. Alternatively, you can see the drive or have recreated it, but the `DocumentModel` button is missing, preventing you from creating new document model schemas.
|
|
1358
1811
|
|
|
1359
|
-
|
|
1812
|
+
### Prerequisites
|
|
1360
1813
|
|
|
1361
1814
|
- Powerhouse Connect is running locally.
|
|
1362
1815
|
- The Powerhouse Connect interface is open in your browser.
|
|
1363
1816
|
|
|
1364
|
-
|
|
1817
|
+
### Solution
|
|
1365
1818
|
|
|
1366
1819
|
This issue is often caused by corrupted or inconsistent data stored in your browser's local storage for the Connect application. Clearing this storage forces a re-initialization of your local environment.
|
|
1367
1820
|
|
|
@@ -1381,18 +1834,18 @@ Click the "Clear storage" button. A confirmation prompt may appear. Confirming t
|
|
|
1381
1834
|
|
|
1382
1835
|
The application should automatically refresh and re-initialize its state. If it doesn't, manually reload the page. Your local drive should now be present with the `DocumentModel` button restored.
|
|
1383
1836
|
|
|
1384
|
-
|
|
1837
|
+
### Expected outcome
|
|
1385
1838
|
|
|
1386
1839
|
- Your local drive is visible again in the Powerhouse Connect UI.
|
|
1387
1840
|
- The `DocumentModel` button is available inside the local drive.
|
|
1388
1841
|
- You can proceed to create and edit document models in your local environment.
|
|
1389
1842
|
|
|
1390
|
-
|
|
1843
|
+
### Common issues and solutions
|
|
1391
1844
|
|
|
1392
1845
|
- **Issue**: The problem persists after clearing storage.
|
|
1393
1846
|
- **Solution**: Try clearing your browser's cache and cookies for the localhost domain. As a last resort, follow the recipe for [Clearing Package Manager Caches](#clearing-package-manager-caches) and reinstalling dependencies.
|
|
1394
1847
|
|
|
1395
|
-
|
|
1848
|
+
### Related recipes
|
|
1396
1849
|
|
|
1397
1850
|
- [Troubleshooting Document Syncing](#troubleshooting-document-syncing)
|
|
1398
1851
|
- [Initializing a New Project & Document Model](#initializing-a-new-project-and-document-model)
|
|
@@ -1402,20 +1855,20 @@ The application should automatically refresh and re-initialize its state. If it
|
|
|
1402
1855
|
<details id="clearing-package-manager-caches">
|
|
1403
1856
|
<summary>Clearing Package Manager Caches</summary>
|
|
1404
1857
|
|
|
1405
|
-
|
|
1858
|
+
### How to Clear Package Manager Caches
|
|
1406
1859
|
|
|
1407
1860
|
---
|
|
1408
1861
|
|
|
1409
|
-
|
|
1862
|
+
### Problem statement
|
|
1410
1863
|
|
|
1411
1864
|
You are encountering unexpected issues with dependencies, `ph-cmd` installation, or package resolution. Corrupted or outdated caches for your package manager (pnpm, npm, yarn) can often be the cause. Clearing the cache forces the package manager to refetch packages, which can resolve these problems.
|
|
1412
1865
|
|
|
1413
|
-
|
|
1866
|
+
### Prerequisites
|
|
1414
1867
|
|
|
1415
1868
|
- Terminal or command prompt access
|
|
1416
1869
|
- A package manager (pnpm, npm, or yarn) installed
|
|
1417
1870
|
|
|
1418
|
-
|
|
1871
|
+
### Solution
|
|
1419
1872
|
|
|
1420
1873
|
Choose the commands corresponding to the package manager you are using.
|
|
1421
1874
|
|
|
@@ -1455,18 +1908,18 @@ yarn cache list
|
|
|
1455
1908
|
yarn cache clean --force
|
|
1456
1909
|
```
|
|
1457
1910
|
|
|
1458
|
-
|
|
1911
|
+
### Expected outcome
|
|
1459
1912
|
|
|
1460
1913
|
- The package manager's cache is cleared or verified.
|
|
1461
1914
|
- Subsequent installations will fetch fresh versions of packages, potentially resolving dependency-related errors.
|
|
1462
1915
|
- Your system is in a cleaner state for managing Powerhouse project dependencies.
|
|
1463
1916
|
|
|
1464
|
-
|
|
1917
|
+
### Common issues and solutions
|
|
1465
1918
|
|
|
1466
1919
|
- **Issue**: Problems persist after clearing the cache.
|
|
1467
1920
|
- **Solution**: The issue might not be cache-related. Consider completely removing `node_modules` and lockfiles (`pnpm-lock.yaml`, `package-lock.json`, `yarn.lock`) and running `pnpm install` (or equivalent) again.
|
|
1468
1921
|
|
|
1469
|
-
|
|
1922
|
+
### Related recipes
|
|
1470
1923
|
|
|
1471
1924
|
- [Installing 'ph-cmd'](#installing-ph-cmd)
|
|
1472
1925
|
- [Uninstalling 'ph-cmd'](#uninstalling-ph-cmd)
|