@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
|
@@ -16,7 +16,7 @@ This tutorial step has a corresponding implementation in the repository. After c
|
|
|
16
16
|
|
|
17
17
|
### Compare your generated code
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
As Vetra generates code automatically, compare with the reference:
|
|
20
20
|
|
|
21
21
|
```bash
|
|
22
22
|
# Compare all generated files with the reference
|
|
@@ -37,14 +37,14 @@ See step 1 for detailed GitHub Desktop instructions.
|
|
|
37
37
|
|
|
38
38
|
</details>
|
|
39
39
|
|
|
40
|
-
In this tutorial, you will learn how to define the specifications for a **ChatRoom** document model within
|
|
40
|
+
In this tutorial, you will learn how to define the specifications for a **ChatRoom** document model within Vetra Studio using its GraphQL schema, and then export the resulting document model specification document for your Powerhouse project.
|
|
41
41
|
|
|
42
42
|
If you don't have a document specification file created yet, have a look at the previous step of this tutorial to create a new document specification.
|
|
43
43
|
|
|
44
|
-
Before you start, make sure you have
|
|
44
|
+
Before you start, make sure you have Vetra Studio running locally with the command:
|
|
45
45
|
|
|
46
46
|
```bash
|
|
47
|
-
ph
|
|
47
|
+
ph vetra
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
## ChatRoom document specification
|
|
@@ -156,11 +156,11 @@ input EditChatDescriptionInput {
|
|
|
156
156
|
|
|
157
157
|
## Define the document model specification
|
|
158
158
|
|
|
159
|
-
To define the document model, you need to open the document model editor in
|
|
159
|
+
To define the document model, you need to open the document model editor in Vetra Studio.
|
|
160
160
|
|
|
161
161
|
### Steps to define your document model:
|
|
162
162
|
|
|
163
|
-
1. In
|
|
163
|
+
1. In Vetra Studio, click on **'ChatRoom' Document** to open the document model specification editor.
|
|
164
164
|
|
|
165
165
|
2. You'll be presented with a form to fill in metadata about the document model. Fill in the details in the respective fields.
|
|
166
166
|
|
|
@@ -174,6 +174,7 @@ To define the document model, you need to open the document model editor in Conn
|
|
|
174
174
|
|
|
175
175
|
```json
|
|
176
176
|
{
|
|
177
|
+
"ID": "",
|
|
177
178
|
"name": "",
|
|
178
179
|
"description": null,
|
|
179
180
|
"createdAt": null,
|
|
@@ -205,21 +206,17 @@ To define the document model, you need to open the document model editor in Conn
|
|
|
205
206
|
|
|
206
207
|
8. Add the remaining message operations to the `messages` module: `ADD_EMOJI_REACTION` and `REMOVE_EMOJI_REACTION`. Note that you only need to add the operation name (e.g., `ADD_EMOJI_REACTION`) without the `Input` suffix—it will be generated automatically.
|
|
207
208
|
|
|
208
|
-
9. Add reducer exceptions to the `ADD_MESSAGE` operation for validation: `
|
|
209
|
+
9. Add **reducer exceptions** to the `ADD_MESSAGE` operation for validation: `MessageContentCannotBeEmptyError` and `MessageNotFoundError`. These will be used later to validate messages.
|
|
209
210
|
|
|
210
211
|
10. Create a second module called `settings` for the chat room configuration operations.
|
|
211
212
|
|
|
212
213
|
11. Add the settings operations to the `settings` module: `EDIT_CHAT_NAME` and `EDIT_CHAT_DESCRIPTION`.
|
|
213
214
|
|
|
214
|
-
12.
|
|
215
|
-
|
|
216
|
-
Check the screenshot below to verify the complete implementation:
|
|
217
|
-
|
|
218
|
-

|
|
215
|
+
12. In the meantime, Vetra has been keeping an eye on your inputs and started code generation in your directory. In your terminal you will also find any validation errors that help you to identify missing specifications.
|
|
219
216
|
|
|
220
217
|
## Verify your document model generation
|
|
221
218
|
|
|
222
|
-
|
|
219
|
+
If you have been watching the terminal in your IDE you will see that Vetra has been tracking your changes and scaffolding your directory. Your project should have the following structure in `document-models/chat-room/`:
|
|
223
220
|
|
|
224
221
|
```
|
|
225
222
|
document-models/chat-room/
|
|
@@ -264,4 +261,4 @@ git ls-tree -r --name-only tutorial/main document-models/chat-room/
|
|
|
264
261
|
|
|
265
262
|
## Up next: Reducers
|
|
266
263
|
|
|
267
|
-
In the next step, you'll learn how to implement the runtime logic that will use the `ChatRoom` document model specification you've just created
|
|
264
|
+
In the next step, you'll learn how to implement the runtime logic that will use the `ChatRoom` document model specification you've just created.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Implement the document model
|
|
1
|
+
# Implement the document model reducers
|
|
2
2
|
|
|
3
3
|
:::tip Tutorial Repository
|
|
4
4
|
📦 **Reference Code**: [chatroom-demo](https://github.com/powerhouse-inc/chatroom-demo)
|
|
@@ -62,9 +62,9 @@ git reset --hard tutorial/main
|
|
|
62
62
|
|
|
63
63
|
</details>
|
|
64
64
|
|
|
65
|
-
In this section, we will implement and test the operation reducers for the **ChatRoom** document model.
|
|
65
|
+
In this section, we will implement and test the operation reducers for the **ChatRoom** document model. Vetra Studio has been automatically generating your document model code as you defined the specification.
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
If you need to review the document model specification steps, see [Define ChatRoom Document Model](/academy/ExampleUsecases/Chatroom/DefineChatroomDocumentModel).
|
|
68
68
|
|
|
69
69
|
## Understanding reducers in document models
|
|
70
70
|
|
|
@@ -135,14 +135,14 @@ Copy and paste the code below into the `messages.ts` file in the `reducers` fold
|
|
|
135
135
|
```typescript
|
|
136
136
|
import {
|
|
137
137
|
MessageNotFoundError,
|
|
138
|
-
|
|
138
|
+
MessageContentCannotBeEmpty,
|
|
139
139
|
} from "../../gen/messages/error.js";
|
|
140
|
-
import type { ChatRoomMessagesOperations } from "
|
|
140
|
+
import type { ChatRoomMessagesOperations } from "chatroom/document-models/chat-room";
|
|
141
141
|
|
|
142
142
|
export const chatRoomMessagesOperations: ChatRoomMessagesOperations = {
|
|
143
143
|
addMessageOperation(state, action) {
|
|
144
144
|
if (action.input.content === "") {
|
|
145
|
-
throw new
|
|
145
|
+
throw new MessageContentCannotBeEmpty();
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
const newMessage = {
|
|
@@ -216,30 +216,10 @@ export const chatRoomMessagesOperations: ChatRoomMessagesOperations = {
|
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
218
|
},
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
## Implement the settings reducers
|
|
225
|
-
|
|
226
|
-
Navigate to `/document-models/chat-room/src/reducers/settings.ts` and implement the settings operation reducers.
|
|
227
|
-
|
|
228
|
-
Copy and paste the code below into the `settings.ts` file in the `reducers` folder:
|
|
229
|
-
|
|
230
|
-
<details>
|
|
231
|
-
<summary>Settings Operation Reducers</summary>
|
|
232
|
-
|
|
233
|
-
```typescript
|
|
234
|
-
import type { ChatRoomSettingsOperations } from "@powerhousedao/chatroom-package/document-models/chat-room";
|
|
235
|
-
|
|
236
|
-
export const chatRoomSettingsOperations: ChatRoomSettingsOperations = {
|
|
237
|
-
editChatNameOperation(state, action) {
|
|
238
|
-
state.name = action.input.name || "";
|
|
239
|
-
},
|
|
240
|
-
editChatDescriptionOperation(state, action) {
|
|
241
|
-
state.description = action.input.description || "";
|
|
242
|
-
},
|
|
219
|
+
senderOperation(state, action) {
|
|
220
|
+
// TODO: Implement "senderOperation" reducer
|
|
221
|
+
throw new Error('Reducer "senderOperation" not yet implemented');
|
|
222
|
+
}
|
|
243
223
|
};
|
|
244
224
|
```
|
|
245
225
|
|
|
@@ -276,7 +256,7 @@ import {
|
|
|
276
256
|
AddEmojiReactionInputSchema,
|
|
277
257
|
removeEmojiReaction,
|
|
278
258
|
RemoveEmojiReactionInputSchema,
|
|
279
|
-
} from "
|
|
259
|
+
} from "chatroom/document-models/chat-room";
|
|
280
260
|
|
|
281
261
|
describe("Messages Operations", () => {
|
|
282
262
|
it("should handle addMessage operation", () => {
|
|
@@ -332,69 +312,6 @@ describe("Messages Operations", () => {
|
|
|
332
312
|
|
|
333
313
|
</details>
|
|
334
314
|
|
|
335
|
-
### Settings operation tests
|
|
336
|
-
|
|
337
|
-
Replace the content of `settings.test.ts` with:
|
|
338
|
-
|
|
339
|
-
<details>
|
|
340
|
-
<summary>Settings Operation Tests</summary>
|
|
341
|
-
|
|
342
|
-
```typescript
|
|
343
|
-
/**
|
|
344
|
-
* This is a scaffold file meant for customization:
|
|
345
|
-
* - change it by adding new tests or modifying the existing ones
|
|
346
|
-
*/
|
|
347
|
-
|
|
348
|
-
import { describe, it, expect } from "vitest";
|
|
349
|
-
import { generateMock } from "@powerhousedao/codegen";
|
|
350
|
-
import {
|
|
351
|
-
reducer,
|
|
352
|
-
utils,
|
|
353
|
-
isChatRoomDocument,
|
|
354
|
-
editChatName,
|
|
355
|
-
EditChatNameInputSchema,
|
|
356
|
-
editChatDescription,
|
|
357
|
-
EditChatDescriptionInputSchema,
|
|
358
|
-
} from "@powerhousedao/chatroom-package/document-models/chat-room";
|
|
359
|
-
|
|
360
|
-
describe("Settings Operations", () => {
|
|
361
|
-
it("should handle editChatName operation", () => {
|
|
362
|
-
const document = utils.createDocument();
|
|
363
|
-
const input = generateMock(EditChatNameInputSchema());
|
|
364
|
-
|
|
365
|
-
const updatedDocument = reducer(document, editChatName(input));
|
|
366
|
-
|
|
367
|
-
expect(isChatRoomDocument(updatedDocument)).toBe(true);
|
|
368
|
-
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
369
|
-
expect(updatedDocument.operations.global[0].action.type).toBe(
|
|
370
|
-
"EDIT_CHAT_NAME",
|
|
371
|
-
);
|
|
372
|
-
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(
|
|
373
|
-
input,
|
|
374
|
-
);
|
|
375
|
-
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
376
|
-
});
|
|
377
|
-
it("should handle editChatDescription operation", () => {
|
|
378
|
-
const document = utils.createDocument();
|
|
379
|
-
const input = generateMock(EditChatDescriptionInputSchema());
|
|
380
|
-
|
|
381
|
-
const updatedDocument = reducer(document, editChatDescription(input));
|
|
382
|
-
|
|
383
|
-
expect(isChatRoomDocument(updatedDocument)).toBe(true);
|
|
384
|
-
expect(updatedDocument.operations.global).toHaveLength(1);
|
|
385
|
-
expect(updatedDocument.operations.global[0].action.type).toBe(
|
|
386
|
-
"EDIT_CHAT_DESCRIPTION",
|
|
387
|
-
);
|
|
388
|
-
expect(updatedDocument.operations.global[0].action.input).toStrictEqual(
|
|
389
|
-
input,
|
|
390
|
-
);
|
|
391
|
-
expect(updatedDocument.operations.global[0].index).toEqual(0);
|
|
392
|
-
});
|
|
393
|
-
});
|
|
394
|
-
```
|
|
395
|
-
|
|
396
|
-
</details>
|
|
397
|
-
|
|
398
315
|
### Document model tests
|
|
399
316
|
|
|
400
317
|
The `document-model.test.ts` file contains tests to verify the document model structure. Replace its content with:
|
|
@@ -418,7 +335,7 @@ import {
|
|
|
418
335
|
assertIsChatRoomDocument,
|
|
419
336
|
isChatRoomState,
|
|
420
337
|
assertIsChatRoomState,
|
|
421
|
-
} from "
|
|
338
|
+
} from "chatroom/document-models/chat-room";
|
|
422
339
|
import { ZodError } from "zod";
|
|
423
340
|
|
|
424
341
|
describe("ChatRoom Document Model", () => {
|
|
@@ -17,8 +17,6 @@ This tutorial shows building from **generated scaffolding** to a **complete chat
|
|
|
17
17
|
|
|
18
18
|
### Compare your generated editor
|
|
19
19
|
|
|
20
|
-
After running `pnpm generate --editor`:
|
|
21
|
-
|
|
22
20
|
```bash
|
|
23
21
|
# Compare generated scaffolding with the reference
|
|
24
22
|
git diff tutorial/main -- editors/chat-room-editor/
|
|
@@ -50,18 +48,24 @@ See step 1 for detailed GitHub Desktop instructions.
|
|
|
50
48
|
|
|
51
49
|
</details>
|
|
52
50
|
|
|
53
|
-
In this chapter we will continue with the interface or editor implementation of the **ChatRoom** document model. This means you will create a user interface for the **ChatRoom** document model which will be used
|
|
51
|
+
In this chapter we will continue with the interface or editor implementation of the **ChatRoom** document model. This means you will create a user interface for the **ChatRoom** document model which will be used to visualize your chatroom, send messages, and react with emojis.
|
|
54
52
|
|
|
55
|
-
##
|
|
53
|
+
## Add a document editor specification in Vetra Studio
|
|
56
54
|
|
|
57
|
-
|
|
58
|
-
This command reads the **ChatRoom** document model definition from the `document-models` folder and generates the editor template in the `editors/chat-room-editor` folder.
|
|
55
|
+
Go back to Vetra Studio, if you need to relaunch Vetra, launch it with `Vetra --watch` so it loads all existing local documents. Click the **'Add new specification'** button in the User Experiences column under **'Editors'**. This will create an editor template for your document model.
|
|
59
56
|
|
|
60
|
-
|
|
61
|
-
pnpm generate --editor chat-room-editor --document-types powerhouse/chat-room
|
|
62
|
-
```
|
|
57
|
+
Give the editor the name `chat-room-editor` and select the correct document model. In our case that's the `powerhouse/chat-room`.
|
|
63
58
|
|
|
64
|
-
|
|
59
|
+
You'll see that the terminal in which you are running Vetra mentions
|
|
60
|
+
```
|
|
61
|
+
ℹ [Vetra] 🔄 Starting editor generation for: chat-room-editor 15:18:16
|
|
62
|
+
15:18:16
|
|
63
|
+
Loaded templates: node_modules/.pnpm/@powerhousedao+codegen@5.0.12_kx2q3zvshbbgwl7sikydpz6mre/node_modules/@powerhousedao/codegen/dist/src/codegen/.hygen/templates
|
|
64
|
+
added: editors/chat-room-editor/components/EditName.tsx 15:18:16
|
|
65
|
+
added: editors/chat-room-editor/editor.tsx 15:18:16
|
|
66
|
+
FORCED: editors/chat-room-editor/module.ts 15:18:16
|
|
67
|
+
ℹ [Vetra] ✅ Editor generation completed successfully for: chat-room-editor
|
|
68
|
+
````
|
|
65
69
|
|
|
66
70
|
Once complete, you'll have a new directory structure:
|
|
67
71
|
|
|
@@ -80,10 +84,10 @@ Navigate to the `editors/chat-room-editor/editor.tsx` file and open it in your e
|
|
|
80
84
|
When building your editor component within the Powerhouse ecosystem, you have several options for styling:
|
|
81
85
|
|
|
82
86
|
1. **Default HTML Styling:** Standard HTML tags will render with default styles offered through the boilerplate.
|
|
83
|
-
2. **Tailwind CSS:**
|
|
87
|
+
2. **Tailwind CSS:** Vetra Studio comes with Tailwind CSS integrated. You can directly use Tailwind utility classes.
|
|
84
88
|
3. **Custom CSS Files:** You can import traditional CSS files to apply custom styles.
|
|
85
89
|
|
|
86
|
-
|
|
90
|
+
Vetra Studio Preview provides a dynamic local environment. By running `ph vetra --watch`, you can visualize your components instantly as you build them.
|
|
87
91
|
|
|
88
92
|
## Build the editor with components
|
|
89
93
|
|
|
@@ -149,6 +153,9 @@ Here's what each component does:
|
|
|
149
153
|
|
|
150
154
|
The `utils.ts` file contains helper functions for mapping between document model types and component props:
|
|
151
155
|
|
|
156
|
+
<details>
|
|
157
|
+
<summary>View utils.ts code</summary>
|
|
158
|
+
|
|
152
159
|
```typescript
|
|
153
160
|
import type {
|
|
154
161
|
MessageProps,
|
|
@@ -249,9 +256,14 @@ export const mapReactions = (
|
|
|
249
256
|
};
|
|
250
257
|
```
|
|
251
258
|
|
|
259
|
+
</details>
|
|
260
|
+
|
|
252
261
|
### The main editor.tsx file
|
|
253
262
|
|
|
254
|
-
The main `editor.tsx` file connects your document model to the UI components. Replace the generated scaffolding with:
|
|
263
|
+
The main `editor.tsx` file connects your document model to the UI components. Replace the generated scaffolding with the code underneath:
|
|
264
|
+
|
|
265
|
+
<details>
|
|
266
|
+
<summary>View editor.tsx code</summary>
|
|
255
267
|
|
|
256
268
|
```typescript
|
|
257
269
|
import { generateId } from "document-model/core";
|
|
@@ -400,6 +412,8 @@ export default function Editor() {
|
|
|
400
412
|
}
|
|
401
413
|
```
|
|
402
414
|
|
|
415
|
+
</details>
|
|
416
|
+
|
|
403
417
|
**What's happening here:**
|
|
404
418
|
|
|
405
419
|
- We use `useSelectedChatRoomDocument` hook to get the document state and dispatch function
|
|
@@ -503,13 +517,13 @@ export const EditableLabel: React.FC<EditableLabelProps> = ({
|
|
|
503
517
|
|
|
504
518
|
## Test your editor
|
|
505
519
|
|
|
506
|
-
Now you can run
|
|
520
|
+
Now you can run Vetra Studio Preview and see the **ChatRoom** editor in action:
|
|
507
521
|
|
|
508
522
|
```bash
|
|
509
|
-
ph
|
|
523
|
+
ph vetra --watch
|
|
510
524
|
```
|
|
511
525
|
|
|
512
|
-
In
|
|
526
|
+
In Vetra Studio, in the bottom right corner you'll find a new Document Model that you can create: **ChatRoom**. Click on it to create a new ChatRoom document.
|
|
513
527
|
|
|
514
528
|
:::warning Authentication Required
|
|
515
529
|
A warning will prompt you to login before you can send messages. Login with an Ethereum address via Renown to start sending messages.
|
|
@@ -555,7 +569,3 @@ In this tutorial you've learned:
|
|
|
555
569
|
✅ **Action dispatching** - How to dispatch operations from your UI
|
|
556
570
|
✅ **Type-safe development** - Leveraging TypeScript with generated types from your SDL
|
|
557
571
|
✅ **Real-time collaboration** - Building features that work across multiple users
|
|
558
|
-
|
|
559
|
-
## Up next: Local Reactor
|
|
560
|
-
|
|
561
|
-
In the next section, you'll learn how to run a local Reactor to test real-time synchronization between multiple users.
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Launch a local Reactor
|
|
2
2
|
|
|
3
|
+
## Up next: Local Reactor
|
|
4
|
+
|
|
5
|
+
In the next section, you'll learn how to run a local Reactor to test real-time synchronization between multiple users.
|
|
6
|
+
|
|
7
|
+
|
|
3
8
|
:::tip Tutorial Repository
|
|
4
9
|
📦 **Reference Code**: [chatroom-demo](https://github.com/powerhouse-inc/chatroom-demo)
|
|
5
10
|
|
|
@@ -19,7 +24,7 @@ In production, Reactors are typically hosted as remote servers. For development
|
|
|
19
24
|
|
|
20
25
|
## Start the local Reactor
|
|
21
26
|
|
|
22
|
-
First, stop
|
|
27
|
+
First, stop Vetra Studio if it's running. Then start the Reactor:
|
|
23
28
|
|
|
24
29
|
```bash
|
|
25
30
|
ph reactor
|
|
@@ -27,14 +32,14 @@ ph reactor
|
|
|
27
32
|
|
|
28
33
|
This spins up a Reactor that:
|
|
29
34
|
- Runs locally on your machine
|
|
30
|
-
- Creates a public drive accessible from your
|
|
35
|
+
- Creates a public drive accessible from your sidebar
|
|
31
36
|
- Enables synchronization between multiple browser sessions
|
|
32
37
|
|
|
33
38
|
## Test real-time collaboration
|
|
34
39
|
|
|
35
40
|
To validate the real-time functionality of your ChatRoom:
|
|
36
41
|
|
|
37
|
-
1. **Open two browser windows** with the
|
|
42
|
+
1. **Open two browser windows** with the application
|
|
38
43
|
2. **Navigate to the Reactor drive** in the left sidebar (it will appear as a public drive)
|
|
39
44
|
3. **Login with different Ethereum addresses** in each window
|
|
40
45
|
4. **Create a ChatRoom document** in one window
|
|
@@ -59,20 +64,20 @@ While testing your ChatRoom, try these features:
|
|
|
59
64
|
|
|
60
65
|
3. **Reaction Toggling**: Click on an existing reaction to toggle it on/off for your user
|
|
61
66
|
|
|
62
|
-
## Running
|
|
67
|
+
## Running Vetra Studio alongside Reactor
|
|
63
68
|
|
|
64
|
-
You can also run
|
|
69
|
+
You can also run Vetra Studio and Reactor together. In separate terminal windows:
|
|
65
70
|
|
|
66
71
|
```bash
|
|
67
72
|
# Terminal 1: Start the Reactor
|
|
68
73
|
ph reactor
|
|
69
74
|
|
|
70
|
-
# Terminal 2: Start
|
|
71
|
-
ph
|
|
75
|
+
# Terminal 2: Start Vetra Studio (in a separate terminal)
|
|
76
|
+
ph vetra --watch
|
|
72
77
|
```
|
|
73
78
|
|
|
74
79
|
This allows you to:
|
|
75
|
-
- Use
|
|
80
|
+
- Use Vetra Studio's local drive for development
|
|
76
81
|
- Access the Reactor's public drive for collaboration testing
|
|
77
82
|
- Switch between local and synchronized documents
|
|
78
83
|
|
|
@@ -2,6 +2,19 @@
|
|
|
2
2
|
title: Vetra Package Library
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
+
Packages of documents are a core structuring mechanism in the Vetra framework, allowing developers to group and manage related document efficiently. These packages serve as modular collections of document specifications and modules, ensuring consistency, scalability, and reusability across different applications.
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Example packages
|
|
9
|
+
|
|
10
|
+
- **Finance Package** – A set of documents or apps handling invoices, payments, budgets, and financial reporting.
|
|
11
|
+
- **Contributor Billing Package** – Defines documents for tracking work, invoicing, and facilitating payments (in both fiat and crypto) for contributors in decentralized organizations.
|
|
12
|
+
- **Governance Package** – Models for proposals, voting, contributor agreements, and decision-making processes.
|
|
13
|
+
- **People Ops Package** – Documents managing contributor profiles, roles, task assignments, and reputation tracking.
|
|
14
|
+
- **Project Management Package** – Models for task tracking, milestones, resource allocation, and deliverables.
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
5
18
|
The Vetra package library is your best source to explore packages built by different builder teams on the Powerhouse Vetra platform. Through the packages you'll find the GitHub repository with the source code of each package.
|
|
6
19
|
|
|
7
20
|
You can get access to the [package library here.](https://vetra.io/packages)
|