@powerhousedao/academy 0.1.0-dev.0
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/.vscode/settings.json +3 -0
- package/CHANGELOG.md +9 -0
- package/Dockerfile +31 -0
- package/ProcFile +1 -0
- package/README.md +43 -0
- package/babel.config.js +3 -0
- package/blog/BeyondCommunication-ABlueprintForDevelopment.md +88 -0
- package/blog/TheChallengeOfChange.md +86 -0
- package/blog/images/Iteration.png +0 -0
- package/blog/images/RAD.png +0 -0
- package/docs/academy/01-GetStarted/00-GetStarted.mdx +181 -0
- package/docs/academy/01-GetStarted/01_InstallDemoPackage.md +38 -0
- package/docs/academy/01-GetStarted/02-ToDoList/01-CreateNewPowerhouseProject.md +97 -0
- package/docs/academy/01-GetStarted/02-ToDoList/02-DefineToDoListDocumentModel.md +86 -0
- package/docs/academy/01-GetStarted/02-ToDoList/03-ImplementOperationReducers.md +201 -0
- package/docs/academy/01-GetStarted/02-ToDoList/04-BuildToDoListEditor.md +494 -0
- package/docs/academy/01-GetStarted/02-ToDoList/_category_.json +8 -0
- package/docs/academy/01-GetStarted/02-ToDoList/images/DocumentModelHeader.png +0 -0
- package/docs/academy/01-GetStarted/02-ToDoList/images/DocumentModelOperations.png +0 -0
- package/docs/academy/01-GetStarted/02-ToDoList/images/OpenDocumentModelEditor.gif +0 -0
- package/docs/academy/01-GetStarted/02-ToDoList/images/completeEditor.png +0 -0
- package/docs/academy/01-GetStarted/02-ToDoList/images/connectApp.gif +0 -0
- package/docs/academy/01-GetStarted/02-ToDoList/images/form.png +0 -0
- package/docs/academy/01-GetStarted/02-ToDoList/images/mytodolist.gif +0 -0
- package/docs/academy/01-GetStarted/02-ToDoList/images/reducers.png +0 -0
- package/docs/academy/01-GetStarted/02-ToDoList/images/vscode.png +0 -0
- package/docs/academy/01-GetStarted/styles.module.css +99 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/00-BuilderTools.md +234 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/01-SetupBuilderEnvironment.md +247 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/04-UtilitiesAndTips.md +79 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/01-SetupBuilderEnvironment.md +216 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/02-CreateNewPowerhouseProject.md +78 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/03-DefineChatroomDocumentModel.md +139 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/04-ImplementOperationReducers.md +364 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/05-ImplementChatroomEditor.md +194 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/06-LaunchALocalReactor.md +15 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/_category_.json +8 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/image-1.png +0 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/image-2.png +0 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/image-3.png +0 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/image-4.png +0 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/image-5.png +0 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/image.png +0 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/images/ChatRoomConnectApp.gif +0 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/images/ChatRoomTest.gif +0 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/images/completeEditor.png +0 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/images/form.png +0 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/images/reducers.png +0 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/Chatroom/images/vscode.png +0 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-MoreTutorials/_category_.json +8 -0
- package/docs/academy/02-AdvancedTutorial/01-Create/02-StandardDocumentModelWorkflow.md +229 -0
- package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/01-BuildingBeautifulDocumentEditors.md +109 -0
- package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/02-ConfiguringDrives.md +51 -0
- package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/03-BuildingADriveExplorer.md +174 -0
- package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/07-DocumentTools/01-OperationHistory.md +67 -0
- package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/07-DocumentTools/02-RevisionHistoryTimeline.md +132 -0
- package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/07-DocumentTools/_category_.json +7 -0
- package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/07-DocumentTools/images/committer-address-popup.png +0 -0
- package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/07-DocumentTools/images/revision-hash-popup.png +0 -0
- package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/07-DocumentTools/images/revision-history-list.png +0 -0
- package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/07-DocumentTools/images/signature-details-popup.png +0 -0
- package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/_category_.json +8 -0
- package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/images/CreateDrive.png +0 -0
- package/docs/academy/02-AdvancedTutorial/03-BuildingUserExperiences/images/mytodolist.gif +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/01-ReadingAndWritingThroughTheAPI.mdx +121 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/02-GraphQLAtPowerhouse.md +156 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/03-WorkingWithSubgraphs/02-GraphQLAndSubgraphs.mdx +119 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/03-WorkingWithSubgraphs/03-WorkingWithSubgraphs.md +312 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/03-WorkingWithSubgraphs/_category_.json +8 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/04-analytics-processor.md +342 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/05-AnalyticsProcessorTutorial/01-SetupBuilderEnvironment.md +215 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/05-AnalyticsProcessorTutorial/02-CreateNewPowerhouseProject.md +55 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/05-AnalyticsProcessorTutorial/03-GenerateAnAnalyticsProcessor.md +173 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/05-AnalyticsProcessorTutorial/04-UpdateAnalyticsProcessor.md +223 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/05-AnalyticsProcessorTutorial/_category_.json +8 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/05-AnalyticsProcessorTutorial/images/Create-SPV.gif +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/05-AnalyticsProcessorTutorial/images/Create-a-new-asset.png +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/05-AnalyticsProcessorTutorial/images/Create-a-transaction.gif +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/05-AnalyticsProcessorTutorial/images/Transaction-table.png +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/05-AnalyticsProcessorTutorial/images/create-a-new-RWA-document.gif +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/05-AnalyticsProcessorTutorial/images/granularity.png +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/GraphQL References/QueryingADocumentWithGraphQL.md +244 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/GraphQL References/rwa-reports/listener-raw.png +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/GraphQL References/rwa-reports/raw-reports1.png +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/GraphQL References/rwa-reports/raw-reports2.png +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/GraphQL References/rwa-reports/rwaRegister.png +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/apse.png +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/best-practices.md +60 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/filter.png +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/filteroptions.png +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/graphql/index.md +166 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/graphql/integration.md +75 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/dbs.png +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/high-level.jpg +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/indexeddb.png +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/libs-core.jpg +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/libs.jpg +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/lod.jpg +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/logo.png +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/navbar.png +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/overview-1.jpg +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/overview-2.jpg +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/overview-3.jpg +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/overview-4.jpg +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/overview-5.jpg +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/overview-6.jpg +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/paths-1.jpg +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/images/paths-2.jpg +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/intro.md +149 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/typescript/benchmarks.md +27 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/typescript/browser.md +77 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/typescript/compatibility.md +14 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/typescript/index.md +230 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/typescript/memory.md +72 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/typescript/pg.md +63 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/typescript/schema.md +14 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/typescript/utilities.md +102 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/use-cases/index.md +7 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/use-cases/maker.md +652 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/06-Analytics Engine/use-cases/processors.md +3 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/_category_.json +8 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/images/OperationHistory.png +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/images/OperationsQuery.png +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/images/QueryDocumentID.png +0 -0
- package/docs/academy/02-AdvancedTutorial/04-WorkWithData/images/SwitchboardButton.png +0 -0
- package/docs/academy/02-AdvancedTutorial/05-Launch/00-IntegrateInAFront-End +3 -0
- package/docs/academy/02-AdvancedTutorial/05-Launch/01-IntroducingFusion +18 -0
- package/docs/academy/02-AdvancedTutorial/05-Launch/02-IntroductionToPackages.md +79 -0
- package/docs/academy/02-AdvancedTutorial/05-Launch/02-PublishYourProject.md +230 -0
- package/docs/academy/02-AdvancedTutorial/05-Launch/03-RunOnACloudServer.md +279 -0
- package/docs/academy/02-AdvancedTutorial/05-Launch/03-SetupEnvironment.md +436 -0
- package/docs/academy/02-AdvancedTutorial/05-Launch/04-GraphQLNamespacing +44 -0
- package/docs/academy/02-AdvancedTutorial/05-Launch/05-LaunchYourBackend.md +3 -0
- package/docs/academy/02-AdvancedTutorial/05-Launch/06-LaunchYourFrontend.md +3 -0
- package/docs/academy/02-AdvancedTutorial/05-Launch/_category_.json +8 -0
- package/docs/academy/02-AdvancedTutorial/05-Launch/images/SSHConnection.png +0 -0
- package/docs/academy/02-AdvancedTutorial/05-Launch/images/homedesign.png +0 -0
- package/docs/academy/02-AdvancedTutorial/05-Launch/images/keyconcepts.png +0 -0
- package/docs/academy/02-AdvancedTutorial/05-Launch/images/tutorialschema.png +0 -0
- package/docs/academy/02-AdvancedTutorial/06-Authorization/Authorization.md +100 -0
- package/docs/academy/02-AdvancedTutorial/_category_.json +7 -0
- package/docs/academy/03-APIReferences/00-PowerhouseCLI.md +1 -0
- package/docs/academy/03-APIReferences/_category_.json +7 -0
- package/docs/academy/04-ComponentLibrary/01-PowerhouseDesignSystem.md +94 -0
- package/docs/academy/04-ComponentLibrary/02-BuildingWithScalars.md +54 -0
- package/docs/academy/04-ComponentLibrary/03-Scalar-Components/01-phid-field.mdx +72 -0
- package/docs/academy/04-ComponentLibrary/03-Scalar-Components/02-input-field.mdx +0 -0
- package/docs/academy/04-ComponentLibrary/04-Complex-Components/01-sidebar.mdx +36 -0
- package/docs/academy/04-ComponentLibrary/05-Layout-Components/01-test-toupdate.mdx +61 -0
- package/docs/academy/04-ComponentLibrary/06-Fragments/01-test-toupdate.mdx +61 -0
- package/docs/academy/04-ComponentLibrary/_category_.json +8 -0
- package/docs/academy/05-Architecture/00-PowerhouseArchitecture.md +50 -0
- package/docs/academy/05-Architecture/01-WorkingWithTheReactor.md +48 -0
- package/docs/academy/05-Architecture/02-ReferencingMonorepoPackages +65 -0
- package/docs/academy/05-Architecture/04-MovingBeyondCRUD +61 -0
- package/docs/academy/05-Architecture/05-DocumentModelTheory/01-WhatIsADocumentModel.md +188 -0
- package/docs/academy/05-Architecture/05-DocumentModelTheory/02-DAOandDocumentsModelsQ+A.md +177 -0
- package/docs/academy/05-Architecture/05-DocumentModelTheory/02-domain-modeling.md +103 -0
- package/docs/academy/05-Architecture/05-DocumentModelTheory/03-BenefitsOfDocumentModels.md +95 -0
- package/docs/academy/05-Architecture/05-DocumentModelTheory/05-best-practices.md +257 -0
- package/docs/academy/05-Architecture/05-DocumentModelTheory/_category_.json +8 -0
- package/docs/academy/05-Architecture/05-DocumentModelTheory/three-data-layers.png +0 -0
- package/docs/academy/05-Architecture/_category_.json +7 -0
- package/docs/academy/05-Architecture/images/image.png +0 -0
- package/docs/academy/06-Cookbook.md +905 -0
- package/docs/academy/07-Glossary.md +50 -0
- package/docs/bookofpowerhouse/01-Overview.md +29 -0
- package/docs/bookofpowerhouse/02-GeneralFrameworkAndPhilosophy.md +15 -0
- package/docs/bookofpowerhouse/03-PowerhouseSoftwareArchitecture.md +33 -0
- package/docs/bookofpowerhouse/04-DevelopmentApproaches.md +36 -0
- package/docs/bookofpowerhouse/05-SNOsandANewModelForOSSandPublicGoods.md +73 -0
- package/docs/bookofpowerhouse/06-SNOsInActionAndPlatformEconomies.md +17 -0
- package/docs/renown/01-intro.md +18 -0
- package/docs/renown/02-renown-login-flow.md +60 -0
- package/docusaurus +0 -0
- package/docusaurus.config.ts +170 -0
- package/package.json +50 -0
- package/powerhouse-docs@0.0.0 +0 -0
- package/sidebars.ts +33 -0
- package/src/components/HomepageFeatures/index.tsx +250 -0
- package/src/components/HomepageFeatures/styles.module.css +267 -0
- package/src/css/custom.css +450 -0
- package/src/pages/index.module.css +37 -0
- package/src/pages/index.tsx +42 -0
- package/src/pages/markdown-page.md +7 -0
- package/static/.nojekyll +0 -0
- package/static/fonts/FranieBold.otf +0 -0
- package/static/fonts/FranieRegular.otf +0 -0
- package/static/img/Powerhouse Website Drive.png +0 -0
- package/static/img/Powerhouse Website Storage Layer (1).png +0 -0
- package/static/img/Powerhouse Website Storage Layer.png +0 -0
- package/static/img/Powerhouse-main-light.svg +13 -0
- package/static/img/Powerhouse-main.svg +13 -0
- package/static/img/Renown Intro Diagram.png +0 -0
- package/static/img/Union.svg +3 -0
- package/static/img/academy/icons/Advanced.svg +4 -0
- package/static/img/academy/icons/Book.svg +5 -0
- package/static/img/academy/icons/Cookbook.svg +3 -0
- package/static/img/academy/icons/Create.svg +3 -0
- package/static/img/academy/icons/Data.svg +3 -0
- package/static/img/academy/icons/Editor.svg +3 -0
- package/static/img/academy/icons/Flash.svg +3 -0
- package/static/img/academy/icons/Launch.svg +3 -0
- package/static/img/academy-icon.png +0 -0
- package/static/img/connect-icon.png +0 -0
- package/static/img/connect.png +0 -0
- package/static/img/docusaurus-social-card.jpg +0 -0
- package/static/img/docusaurus.png +0 -0
- package/static/img/empty-background.png +0 -0
- package/static/img/favicon.ico +0 -0
- package/static/img/fusion-icon.png +0 -0
- package/static/img/fusion.png +0 -0
- package/static/img/ph-icon-light.svg +3 -0
- package/static/img/powerhouse-layer.png +0 -0
- package/static/img/powerhouse-storage-layer.png +0 -0
- package/static/img/reactor.png +0 -0
- package/static/img/renown-icon.png +0 -0
- package/static/img/renown.png +0 -0
- package/static/img/switchboard-icon.png +0 -0
- package/static/img/switchboard.png +0 -0
- package/static/img/undraw_docusaurus_mountain.svg +171 -0
- package/static/img/undraw_docusaurus_react.svg +170 -0
- package/static/img/undraw_docusaurus_tree.svg +40 -0
- package/static/img/video-placeholder.svg +16 -0
- package/static.json +7 -0
- package/tsconfig.json +7 -0
|
@@ -0,0 +1,436 @@
|
|
|
1
|
+
# Powerhouse Setup Guide
|
|
2
|
+
|
|
3
|
+
## Introduction
|
|
4
|
+
Powerhouse is a powerful platform that helps you manage and deploy your applications efficiently. This guide will walk you through the process of setting up both the Powerhouse CLI and configuring your server machine to run Powerhouse services. Whether you're setting up a development environment or preparing for production deployment, this guide provides all the necessary steps and considerations.
|
|
5
|
+
|
|
6
|
+
## Prerequisites
|
|
7
|
+
Before you begin, ensure you have a Linux-based system (Ubuntu or Debian recommended), sudo privileges, and a stable internet connection. These are essential for the installation and configuration process. The system should have at least 1GB of RAM and 10GB of free disk space for optimal performance. While these are minimum requirements, more resources will provide better performance, especially when running multiple services.
|
|
8
|
+
|
|
9
|
+
## 1. Installing Powerhouse CLI
|
|
10
|
+
|
|
11
|
+
The `install-tools.sh` script provides a streamlined way to install the Powerhouse CLI tool and all its necessary dependencies. This script handles the installation of node.js 22, pnpm, and the Powerhouse CLI itself. It's designed to work across different Linux distributions, though it's optimized for Ubuntu and Debian-based systems.
|
|
12
|
+
|
|
13
|
+
### Installation Steps:
|
|
14
|
+
1. Download the setup script:
|
|
15
|
+
```bash
|
|
16
|
+
curl -O https://raw.githubusercontent.com/powerhouse-inc/powerhouse/refs/heads/main/scripts/install-tools.sh
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
2. Make the script executable:
|
|
20
|
+
```bash
|
|
21
|
+
chmod +x install-tools.sh
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
3. Run the script:
|
|
25
|
+
```bash
|
|
26
|
+
./install-tools.sh
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
4. Choose a version when prompted:
|
|
30
|
+
- `dev`: Development version - Use this for testing new features or development work
|
|
31
|
+
- `staging`: Staging version - Use this for pre-production testing
|
|
32
|
+
- RECOMMENDED: `latest`: Latest stable version - Recommended for production environments
|
|
33
|
+
- Press Enter to go ahead with the latest version
|
|
34
|
+
|
|
35
|
+
5. After installation, source your shell configuration:
|
|
36
|
+
```bash
|
|
37
|
+
source ~/.bashrc # or source ~/.zshrc if using zsh
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
6. Verify the installation:
|
|
41
|
+
```bash
|
|
42
|
+
ph --version
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## 2. Configuring Your Machine
|
|
46
|
+
|
|
47
|
+
Download the setup script:
|
|
48
|
+
```bash
|
|
49
|
+
curl -O https://raw.githubusercontent.com/powerhouse-inc/powerhouse/refs/heads/main/scripts/setup-environment.sh
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
The `setup-environment.sh` script is a comprehensive tool that prepares your machine for running Powerhouse services. It handles everything from package installation to service configuration, making the setup process straightforward and automated. This script is particularly useful for setting up new servers or reconfiguring existing ones.
|
|
53
|
+
|
|
54
|
+
### Configuration Steps:
|
|
55
|
+
|
|
56
|
+
1. Make the script executable:
|
|
57
|
+
```bash
|
|
58
|
+
chmod +x setup-environment.sh
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
2. Run the script:
|
|
62
|
+
```bash
|
|
63
|
+
./setup-environment.sh
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
3. Follow the interactive prompts:
|
|
67
|
+
|
|
68
|
+
### Step 1: Package Installation
|
|
69
|
+
During the package installation phase, you'll be prompted to enter package names that you want to install. For example, you might want to install `@sky-ph/atlas` or other Powerhouse packages. This step is crucial for adding the specific functionality you need to your Powerhouse installation. You can press Enter to skip this step if you don't need to install any packages immediately, but you can always install packages later using the `ph install` command.
|
|
70
|
+
|
|
71
|
+
### Step 2: Database Configuration
|
|
72
|
+
The script offers two options for database configuration.
|
|
73
|
+
|
|
74
|
+
**Option 1:** Sets up a local PostgreSQL database, which is ideal for development or small deployments. It automatically creates a database user with a secure random password and configures the database to accept local connections. This option is perfect for getting started quickly or for development environments.
|
|
75
|
+
|
|
76
|
+
**Option 2:** Allows you to connect to a remote PostgreSQL database by providing a connection URL in the format `postgres://user:password@host:port/db`. This is recommended for production environments where you might want to use a managed database service or a dedicated database server.
|
|
77
|
+
|
|
78
|
+
### Step 3: SSL Configuration
|
|
79
|
+
For SSL configuration, you have two choices.
|
|
80
|
+
|
|
81
|
+
**Option 1:** The **Let's Encrypt** option is recommended for production environments. It requires you to provide a base domain (like `powerhouse.xyz`) and optional subdomains for your services. The script will automatically obtain and configure SSL certificates for your domains, ensuring secure communication between your services and clients.
|
|
82
|
+
|
|
83
|
+
**Option 2:** The self-signed certificate option is suitable for development or testing environments. It uses your machine's hostname and generates a self-signed certificate, configuring the services with appropriate base paths. While this option is convenient for development, browsers will show security warnings, which is why it's not recommended for production use.
|
|
84
|
+
|
|
85
|
+
<details>
|
|
86
|
+
<summary>Setting up a domain in DigitalOcean</summary>
|
|
87
|
+
|
|
88
|
+
This tutorial will guide you through the process of creating a new virtual private server (called a "Droplet") on DigitalOcean and then pointing your custom domain name to it. This will allow users to access your server using a memorable URL like `www.yourdomain.com`.
|
|
89
|
+
|
|
90
|
+
**Current Date:** May 15, 2025
|
|
91
|
+
|
|
92
|
+
## Part 1: Setting Up Your DigitalOcean Droplet
|
|
93
|
+
|
|
94
|
+
A Droplet is a scalable virtual machine that you can configure to host your websites, applications, or other services.
|
|
95
|
+
|
|
96
|
+
### Step 1: Sign Up or Log In to DigitalOcean
|
|
97
|
+
|
|
98
|
+
- If you don't have an account, go to [digitalocean.com](https://digitalocean.com) and sign up. You'll likely need to provide payment information.
|
|
99
|
+
- If you already have an account, log in.
|
|
100
|
+
|
|
101
|
+
### Step 2: Create a New Droplet
|
|
102
|
+
|
|
103
|
+
1. From your DigitalOcean dashboard, click the green "Create" button in the top right corner and select "Droplets".
|
|
104
|
+
|
|
105
|
+
2. **Choose an Image:**
|
|
106
|
+
- **Distributions:** Select a base Linux distribution like Ubuntu (a popular choice, e.g., Ubuntu 22.04 LTS), Fedora, Debian, etc.
|
|
107
|
+
- **Marketplace:** You can also choose from pre-configured 1-Click Apps (e.g., WordPress, Docker, LAMP stack). This can save you setup time. For this general tutorial, we'll assume a base distribution.
|
|
108
|
+
|
|
109
|
+
3. **Choose a Plan (Size):**
|
|
110
|
+
- **Shared CPU:** Good for smaller projects, development, or low-traffic sites. Options like "Basic" Droplets fall here.
|
|
111
|
+
- **Dedicated CPU:** For production applications needing consistent performance (General Purpose, CPU-Optimized, Memory-Optimized, Storage-Optimized Droplets).
|
|
112
|
+
- Start with a basic plan that fits your budget and expected needs; you can resize your Droplet later if necessary.
|
|
113
|
+
|
|
114
|
+
4. **Choose a Datacenter Region:**
|
|
115
|
+
- Select a server location closest to your target audience to minimize latency.
|
|
116
|
+
- For example, if your users are primarily in Europe, choose a European datacenter like Amsterdam, Frankfurt, or London.
|
|
117
|
+
|
|
118
|
+
5. **Authentication:**
|
|
119
|
+
- **SSH Keys (Recommended for security):** If you have an SSH key pair, you can add your public key. This is more secure than using passwords. Click "New SSH Key" and paste your public key if it's not already added.
|
|
120
|
+
- **Password:** If you choose this, create a strong root password. You'll use this to log in via SSH initially.
|
|
121
|
+
|
|
122
|
+
6. **Additional Options (Customize as needed):**
|
|
123
|
+
- **VPC Network:** By default, your Droplet will be in your default VPC for the chosen region. You can change this if you have custom networking setups.
|
|
124
|
+
- **Monitoring:** A free metrics monitoring service. It's a good idea to enable this.
|
|
125
|
+
- **User Data:** Allows you to run initial configuration scripts when the Droplet is first created.
|
|
126
|
+
- **Backups (Recommended for production):** Enable automated weekly backups for a small additional fee.
|
|
127
|
+
- **Volume (Additional Storage):** Attach block storage if you need more disk space than the Droplet plan offers.
|
|
128
|
+
|
|
129
|
+
7. **Finalize and Create:**
|
|
130
|
+
- Choose a Hostname: Give your Droplet a name (e.g., `my-web-server`). This is for your reference within DigitalOcean.
|
|
131
|
+
- Add Tags (Optional): Organize your resources with tags.
|
|
132
|
+
- Select Project: Assign the Droplet to a project.
|
|
133
|
+
- Review your selections and click the "Create Droplet" button at the bottom.
|
|
134
|
+
|
|
135
|
+
### Step 3: Access Your Droplet
|
|
136
|
+
|
|
137
|
+
It will take a minute or two for your Droplet to be provisioned. Once it's ready, its IP address will be displayed in your Droplets list.
|
|
138
|
+
|
|
139
|
+
To log in via SSH:
|
|
140
|
+
|
|
141
|
+
1. Open a terminal (on macOS/Linux) or an SSH client like PuTTY (on Windows).
|
|
142
|
+
2. Use one of these commands:
|
|
143
|
+
```bash
|
|
144
|
+
# If using password authentication
|
|
145
|
+
ssh root@YOUR_DROPLET_IP
|
|
146
|
+
|
|
147
|
+
# If using SSH key for a specific user
|
|
148
|
+
ssh your_user@YOUR_DROPLET_IP
|
|
149
|
+
|
|
150
|
+
# If using a specific SSH key
|
|
151
|
+
ssh -i /path/to/your/private_key root@YOUR_DROPLET_IP
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
3. If you used a password, you'll be prompted to enter it.
|
|
155
|
+
4. If it's your first time logging in, you might be asked to change the root password.
|
|
156
|
+
|
|
157
|
+
Now your Droplet is running! You'll likely want to install and configure a web server (like Nginx or Apache) and your application or website files. This part is beyond the scope of just creating the Droplet but is crucial for it to do anything useful.
|
|
158
|
+
|
|
159
|
+
### DNS Configuration
|
|
160
|
+
|
|
161
|
+
#### Option A: Using DigitalOcean's Nameservers (Recommended)
|
|
162
|
+
|
|
163
|
+
1. **Add Your Domain to DigitalOcean:**
|
|
164
|
+
- Go to "Networking" → "Domains"
|
|
165
|
+
- Enter your domain name (e.g., `yourdomain.com`)
|
|
166
|
+
- Click "Add Domain"
|
|
167
|
+
|
|
168
|
+
2. **Update Nameservers at Your Domain Registrar:**
|
|
169
|
+
- Log in to your domain registrar
|
|
170
|
+
- Update nameservers to:
|
|
171
|
+
```
|
|
172
|
+
ns1.digitalocean.com
|
|
173
|
+
ns2.digitalocean.com
|
|
174
|
+
ns3.digitalocean.com
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
3. **Create DNS Records:**
|
|
178
|
+
- **Root Domain (A Record):**
|
|
179
|
+
- **TYPE:** A
|
|
180
|
+
- **HOSTNAME:** @
|
|
181
|
+
- **WILL DIRECT TO:** Your Droplet's IP
|
|
182
|
+
- **TTL:** 3600
|
|
183
|
+
|
|
184
|
+
- **WWW Subdomain (A Record):**
|
|
185
|
+
- **TYPE:** A
|
|
186
|
+
- **HOSTNAME:** www
|
|
187
|
+
- **WILL DIRECT TO:** Your Droplet's IP
|
|
188
|
+
- **TTL:** 3600
|
|
189
|
+
|
|
190
|
+
#### Option B: Using Your Existing Nameservers
|
|
191
|
+
|
|
192
|
+
1. **Create DNS Records at Your Registrar:**
|
|
193
|
+
- **Root Domain (A Record):**
|
|
194
|
+
- **TYPE:** A
|
|
195
|
+
- **HOSTNAME:** @
|
|
196
|
+
- **VALUE:** Your Droplet's IP
|
|
197
|
+
- **TTL:** 3600
|
|
198
|
+
|
|
199
|
+
- **WWW Subdomain (A Record):**
|
|
200
|
+
- **TYPE:** A
|
|
201
|
+
- **HOSTNAME:** www
|
|
202
|
+
- **VALUE:** Your Droplet's IP
|
|
203
|
+
- **TTL:** 3600
|
|
204
|
+
|
|
205
|
+
**Note:** DNS changes may take up to 48 hours to propagate globally.
|
|
206
|
+
|
|
207
|
+
### Verify Configuration
|
|
208
|
+
|
|
209
|
+
1. Use DNS lookup tools to verify your records:
|
|
210
|
+
```bash
|
|
211
|
+
dig +short yourdomain.com
|
|
212
|
+
dig +short www.yourdomain.com
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
2. Both should return your Droplet's IP address
|
|
216
|
+
|
|
217
|
+
**Congratulations!** You have successfully set up your DigitalOcean Droplet and configured your domain. Your server is now ready to host your Powerhouse services.
|
|
218
|
+
|
|
219
|
+
</details>
|
|
220
|
+
|
|
221
|
+
<details>
|
|
222
|
+
<summary>Setting up a domain with AWS EC2</summary>
|
|
223
|
+
|
|
224
|
+
This tutorial will guide you through the process of assigning a static IP (Elastic IP) to your EC2 instance and configuring your domain to point to it.
|
|
225
|
+
|
|
226
|
+
**Current Date:** May 15, 2025
|
|
227
|
+
|
|
228
|
+
## Part 1: Assigning a Static IP to EC2 Instance
|
|
229
|
+
|
|
230
|
+
### Step 1: Allocate Elastic IP
|
|
231
|
+
|
|
232
|
+
1. Navigate to the EC2 service in the AWS console
|
|
233
|
+
2. Choose "Elastic IPs" from the navigation pane
|
|
234
|
+
3. Select "Allocate new address"
|
|
235
|
+
4. Select the VPC where your EC2 instance is located
|
|
236
|
+
5. Click "Allocate"
|
|
237
|
+
|
|
238
|
+
### Step 2: Associate Elastic IP
|
|
239
|
+
|
|
240
|
+
1. Go back to the EC2 console and select your instance
|
|
241
|
+
2. From the "Networking" tab, expand "Network interfaces"
|
|
242
|
+
3. Note the "Interface ID" of the network interface
|
|
243
|
+
4. Select the "Interface ID" to manage its IP addresses
|
|
244
|
+
5. Choose "Actions", then "Manage IP Addresses"
|
|
245
|
+
6. Find the Elastic IP you allocated and click "Associate"
|
|
246
|
+
|
|
247
|
+
## Part 2: DNS Configuration
|
|
248
|
+
|
|
249
|
+
### Option A: Using AWS Route 53 (Recommended)
|
|
250
|
+
|
|
251
|
+
1. **Add Your Domain to Route 53:**
|
|
252
|
+
- Go to Route 53 → "Hosted zones"
|
|
253
|
+
- Click "Create hosted zone"
|
|
254
|
+
- Enter your domain name (e.g., `yourdomain.com`)
|
|
255
|
+
- Click "Create"
|
|
256
|
+
|
|
257
|
+
2. **Update Nameservers at Your Domain Registrar:**
|
|
258
|
+
- Log in to your domain registrar
|
|
259
|
+
- Update nameservers to the ones provided by Route 53
|
|
260
|
+
- They will look like:
|
|
261
|
+
```
|
|
262
|
+
ns-1234.awsdns-12.org
|
|
263
|
+
ns-567.awsdns-34.com
|
|
264
|
+
ns-890.awsdns-56.net
|
|
265
|
+
ns-1234.awsdns-78.co.uk
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
3. **Create DNS Records:**
|
|
269
|
+
- **Root Domain (A Record):**
|
|
270
|
+
- **TYPE:** A
|
|
271
|
+
- **HOSTNAME:** @
|
|
272
|
+
- **VALUE:** Your Elastic IP
|
|
273
|
+
- **TTL:** 3600
|
|
274
|
+
|
|
275
|
+
- **WWW Subdomain (A Record):**
|
|
276
|
+
- **TYPE:** A
|
|
277
|
+
- **HOSTNAME:** www
|
|
278
|
+
- **VALUE:** Your Elastic IP
|
|
279
|
+
- **TTL:** 3600
|
|
280
|
+
|
|
281
|
+
### Option B: Using Your Existing Nameservers
|
|
282
|
+
|
|
283
|
+
1. **Create DNS Records at Your Registrar:**
|
|
284
|
+
- **Root Domain (A Record):**
|
|
285
|
+
- **TYPE:** A
|
|
286
|
+
- **HOSTNAME:** @
|
|
287
|
+
- **VALUE:** Your Elastic IP
|
|
288
|
+
- **TTL:** 3600
|
|
289
|
+
|
|
290
|
+
- **WWW Subdomain (A Record):**
|
|
291
|
+
- **TYPE:** A
|
|
292
|
+
- **HOSTNAME:** www
|
|
293
|
+
- **VALUE:** Your Elastic IP
|
|
294
|
+
- **TTL:** 3600
|
|
295
|
+
|
|
296
|
+
1. **Set Up DNS First:**
|
|
297
|
+
- Create A records for all subdomains before running the setup script
|
|
298
|
+
- Point them to your EC2 instance's public IP address
|
|
299
|
+
- Wait for DNS propagation before requesting SSL certificates
|
|
300
|
+
|
|
301
|
+
### Verify Configuration
|
|
302
|
+
|
|
303
|
+
1. Use DNS lookup tools to verify your records:
|
|
304
|
+
```bash
|
|
305
|
+
dig +short yourdomain.com
|
|
306
|
+
dig +short www.yourdomain.com
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
2. Both should return your Elastic IP address
|
|
310
|
+
|
|
311
|
+
**Congratulations!** You have successfully set up your EC2 instance with a static IP and configured your domain. Your server is now ready to host your Powerhouse services.
|
|
312
|
+
|
|
313
|
+
</details>
|
|
314
|
+
|
|
315
|
+
### Step 4: Service Configuration
|
|
316
|
+
|
|
317
|
+
The script takes care of all the necessary service configuration automatically. It installs and configures **Nginx** as a reverse proxy, sets up SSL certificates, and configures the proxy settings for optimal performance. It also installs **PM2** for process management and starts your services with the appropriate configuration based on your SSL choice. The Nginx configuration includes optimizations for **WebSocket connections**, static file serving, and security headers. PM2 is configured to automatically restart services if they crash and to start them on system boot.
|
|
318
|
+
|
|
319
|
+
### Step 5: Security Features
|
|
320
|
+
Security is a top priority in the setup process. The script implements automatic SSL certificate management, generates secure database passwords, and configures security headers in Nginx. It also sets up proper proxy settings to support WebSocket connections securely. The security headers include protection against common web vulnerabilities, and the SSL configuration uses modern cipher suites and protocols. The script also ensures that sensitive files and directories have appropriate permissions.
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
## 3. Verifying the Setup
|
|
324
|
+
|
|
325
|
+
After the installation is complete, it's important to verify that everything is working correctly. You can check the status of your services using PM2, verify the Nginx configuration, and ensure your SSL certificates are properly installed. This step is crucial for identifying any potential issues before they affect your users.
|
|
326
|
+
|
|
327
|
+
1. Check service status:
|
|
328
|
+
```bash
|
|
329
|
+
pm2 status
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
2. View Nginx configuration:
|
|
333
|
+
```bash
|
|
334
|
+
sudo nginx -t
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
3. Check SSL certificates:
|
|
338
|
+
```bash
|
|
339
|
+
sudo certbot certificates # if using Let's Encrypt
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
## 4. Accessing Services
|
|
343
|
+
|
|
344
|
+
Once everything is set up, you can access your services through the configured domains. If you chose Let's Encrypt, your services will be available at their respective subdomains. With a self-signed certificate, you'll access the services through your machine's hostname with the appropriate base paths. The services are configured to use HTTPS by default, ensuring secure communication.
|
|
345
|
+
|
|
346
|
+
### With Let's Encrypt:
|
|
347
|
+
- Connect: `https://connect.yourdomain.com`
|
|
348
|
+
- Switchboard: `https://switchboard.yourdomain.com`
|
|
349
|
+
|
|
350
|
+
### With Self-signed Certificate:
|
|
351
|
+
- Connect: `https://your-hostname/connect`
|
|
352
|
+
- Switchboard: `https://your-hostname/switchboard`
|
|
353
|
+
|
|
354
|
+
## 5. Troubleshooting
|
|
355
|
+
|
|
356
|
+
When issues arise, there are several common problems you might encounter.
|
|
357
|
+
- The "ph: command not found" error usually means you need to source your shell configuration file.
|
|
358
|
+
- Nginx configuration errors can be investigated through the error logs, and service issues can be diagnosed using PM2 logs.
|
|
359
|
+
- SSL certificate problems often relate to DNS settings or certificate paths. Understanding these common issues and their solutions will help you maintain a stable Powerhouse installation.
|
|
360
|
+
|
|
361
|
+
### Common Issues:
|
|
362
|
+
1. **"ph: command not found"**
|
|
363
|
+
- Run `source ~/.bashrc` or restart your terminal
|
|
364
|
+
- Verify that the PNPM_HOME environment variable is set correctly
|
|
365
|
+
- Check if the ph binary exists in the PNPM_HOME directory
|
|
366
|
+
|
|
367
|
+
2. **Nginx configuration errors**
|
|
368
|
+
- Check logs: `sudo tail -f /var/log/nginx/error.log`
|
|
369
|
+
- Verify that all required modules are installed
|
|
370
|
+
- Ensure that the SSL certificate paths are correct
|
|
371
|
+
|
|
372
|
+
3. **Service not starting**
|
|
373
|
+
- Check PM2 logs: `pm2 logs`
|
|
374
|
+
- Verify that the service ports are not in use
|
|
375
|
+
- Check if the service has the required permissions
|
|
376
|
+
|
|
377
|
+
4. **SSL certificate issues**
|
|
378
|
+
- Verify domain DNS settings
|
|
379
|
+
- Check certificate paths in Nginx config
|
|
380
|
+
- Ensure that the certificate files are readable by Nginx
|
|
381
|
+
|
|
382
|
+
## 6. Maintenance
|
|
383
|
+
|
|
384
|
+
Regular maintenance is crucial for keeping your Powerhouse installation running smoothly. You can update services using the Powerhouse CLI, restart services through PM2, and monitor logs to ensure everything is functioning correctly. Regular maintenance helps prevent issues and ensures that your services are running with the latest security patches and features.
|
|
385
|
+
|
|
386
|
+
### Updating Services:
|
|
387
|
+
```bash
|
|
388
|
+
ph update <package-name>
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
### Restarting Services:
|
|
392
|
+
```bash
|
|
393
|
+
pm2 restart all
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
### Viewing Logs:
|
|
397
|
+
```bash
|
|
398
|
+
pm2 logs
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
## 7. Security Notes
|
|
402
|
+
|
|
403
|
+
Maintaining security is an ongoing process. It's essential to keep your database credentials secure and regularly update your SSL certificates. Regular monitoring of system logs helps identify potential security issues, and keeping your system and packages updated ensures you have the latest security patches. Consider implementing additional security measures such as firewall rules, intrusion detection systems, and regular security audits.
|
|
404
|
+
|
|
405
|
+
## 8. Backup
|
|
406
|
+
|
|
407
|
+
Regular backups are crucial for data safety. The database can be backed up using pg_dump, and your configuration files can be archived using tar. These backups should be stored securely and tested regularly to ensure they can be restored if needed. Consider implementing an automated backup schedule and storing backups in multiple locations for redundancy.
|
|
408
|
+
|
|
409
|
+
### Database Backup:
|
|
410
|
+
```bash
|
|
411
|
+
pg_dump -U powerhouse -d powerhouse > backup.sql
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
### Configuration Backup:
|
|
415
|
+
```bash
|
|
416
|
+
sudo tar -czf powerhouse-config.tar.gz /etc/powerhouse/
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
## 9. Best Practices
|
|
420
|
+
|
|
421
|
+
To get the most out of your Powerhouse installation, follow these best practices:
|
|
422
|
+
|
|
423
|
+
1. **Regular Updates**: Keep your system, packages, and services updated to the latest stable versions.
|
|
424
|
+
2. **Monitoring**: Set up monitoring for your services to detect issues early.
|
|
425
|
+
3. **Documentation**: Keep documentation of your configuration and any customizations.
|
|
426
|
+
4. **Testing**: Test your backup and restore procedures regularly.
|
|
427
|
+
5. **Security**: Regularly review and update your security measures.
|
|
428
|
+
|
|
429
|
+
## 10. Getting Help
|
|
430
|
+
|
|
431
|
+
If you encounter issues or need assistance, there are several resources available:
|
|
432
|
+
|
|
433
|
+
1. **Documentation**: Check the official Powerhouse documentation for detailed information.
|
|
434
|
+
2. **Community**: Join the Powerhouse community forums or chat channels.
|
|
435
|
+
3. **Support**: Contact Powerhouse support for professional assistance.
|
|
436
|
+
4. **GitHub**: Report issues or contribute to the project on GitHub.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# GraphQL Namespacing: Packages and Subgraphs
|
|
2
|
+
|
|
3
|
+
## Problem: GraphQL naming conflicts in shared schemas.
|
|
4
|
+
## Solution: Use package-scoped subgraphs to isolate document types and queries.
|
|
5
|
+
|
|
6
|
+
### How it Works:
|
|
7
|
+
Each package has its own GraphQL subgraph and schema.
|
|
8
|
+
This ensures that teams can manage their document types independently and avoid naming clashes.
|
|
9
|
+
|
|
10
|
+
## Best Practices for Package Authors
|
|
11
|
+
|
|
12
|
+
### GraphQL Naming Conventions in Packages
|
|
13
|
+
|
|
14
|
+
#### Prefixes:
|
|
15
|
+
|
|
16
|
+
Consider prefixing your types, queries, and mutations with the document name or package name.
|
|
17
|
+
Example:
|
|
18
|
+
Prefixed: getInvoiceDocument, InvoiceStatusEnum
|
|
19
|
+
Unprefixed (if unambiguous): getUser, StatusEnum
|
|
20
|
+
|
|
21
|
+
#### Handling Enums and Scalars:
|
|
22
|
+
|
|
23
|
+
Use unique names for shared types (e.g., FinanceStatusEnum, HRStatusEnum) to avoid clashes.
|
|
24
|
+
Flexibility:
|
|
25
|
+
|
|
26
|
+
Package authors can choose between:
|
|
27
|
+
- Short names (for small, isolated packages).
|
|
28
|
+
- Prefixed names (for larger or more complex packages).
|
|
29
|
+
|
|
30
|
+
### Schema Generation & Debugging
|
|
31
|
+
|
|
32
|
+
#### Dynamic Schema Generation:
|
|
33
|
+
|
|
34
|
+
Automatic Schema Generation:
|
|
35
|
+
|
|
36
|
+
The system dynamically generates GraphQL schemas for read models.
|
|
37
|
+
These schemas are now exported (not just kept in memory) to make debugging easier.
|
|
38
|
+
|
|
39
|
+
#### Debugging Tip:
|
|
40
|
+
|
|
41
|
+
When creating or modifying document types, use the exported schema to verify that:
|
|
42
|
+
- Queries and mutations are correctly named.
|
|
43
|
+
- There are no naming conflicts.
|
|
44
|
+
- All scalars, enums, and input types are properly namespaced.
|
|
Binary file
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Switchboard Authorization
|
|
2
|
+
|
|
3
|
+
This tutorial explains how to configure authorization for the Powerhouse Switchboard using the new role-based authentication system.
|
|
4
|
+
|
|
5
|
+
## Basic Configuration
|
|
6
|
+
|
|
7
|
+
The Switchboard supports two main ways to configure authorization:
|
|
8
|
+
|
|
9
|
+
1. Using environment variables
|
|
10
|
+
2. Using the powerhouse configuration file
|
|
11
|
+
|
|
12
|
+
### Environment Variables
|
|
13
|
+
|
|
14
|
+
The following environment variables can be used to configure authorization:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
# Required: Enable/disable authentication
|
|
18
|
+
AUTH_ENABLED=true
|
|
19
|
+
|
|
20
|
+
# Optional: Comma-separated list of guest wallet addresses
|
|
21
|
+
GUESTS="0x789,0xabc"
|
|
22
|
+
|
|
23
|
+
# Optional: Comma-separated list of regular user wallet addresses
|
|
24
|
+
USERS="0xdef,0xghi"
|
|
25
|
+
|
|
26
|
+
# Optional: Comma-separated list of admin wallet addresses
|
|
27
|
+
ADMINS="0x123,0x456"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Powerhouse Configuration
|
|
31
|
+
|
|
32
|
+
Alternatively, you can configure authorization in your `powerhouse.config.json`:
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"switchboard": {
|
|
37
|
+
"auth": {
|
|
38
|
+
"enabled": true,
|
|
39
|
+
"guests": ["0x789", "0xabc"],
|
|
40
|
+
"users": ["0xdef", "0xghi"],
|
|
41
|
+
"admins": ["0x123", "0x456"]
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Role-Based Access Control
|
|
48
|
+
|
|
49
|
+
The new authorization system implements role-based access control with three distinct roles:
|
|
50
|
+
|
|
51
|
+
1. **Guests (GUESTS)**
|
|
52
|
+
- Limited access to specific endpoints
|
|
53
|
+
- Can view public data
|
|
54
|
+
- Cannot perform write operations
|
|
55
|
+
|
|
56
|
+
2. **Users (USERS)**
|
|
57
|
+
- Standard access to most endpoints
|
|
58
|
+
- Can perform regular operations
|
|
59
|
+
- Cannot access administrative functions
|
|
60
|
+
|
|
61
|
+
3. **Admins (ADMINS)**
|
|
62
|
+
- Full access to all endpoints
|
|
63
|
+
- Can manage drives
|
|
64
|
+
- Can perform administrative tasks
|
|
65
|
+
|
|
66
|
+
## Docker Configuration
|
|
67
|
+
|
|
68
|
+
When running the Switchboard in Docker, you can pass these configurations as environment variables:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
docker run -e AUTH_ENABLED=true \
|
|
72
|
+
-e GUESTS="0x789,0xabc" \
|
|
73
|
+
-e USERS="0xdef,0xghi" \
|
|
74
|
+
-e ADMINS="0x123,0x456" \
|
|
75
|
+
your-switchboard-image
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Authorization Flow
|
|
79
|
+
|
|
80
|
+
1. Authentication can be enabled/disabled using AUTH_ENABLED
|
|
81
|
+
2. Users are assigned roles based on their wallet addresses
|
|
82
|
+
3. Each role has specific permissions and access levels
|
|
83
|
+
|
|
84
|
+
## Security Best Practices
|
|
85
|
+
|
|
86
|
+
1. Keep your admin wallet addresses secure
|
|
87
|
+
2. Use HTTPS in production environments
|
|
88
|
+
3. Review and update role assignments regularly
|
|
89
|
+
4. Consider using AUTH_ENABLED=false only in development
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
## Troubleshooting
|
|
93
|
+
|
|
94
|
+
If you encounter authorization issues:
|
|
95
|
+
|
|
96
|
+
1. Check that AUTH_ENABLED is set appropriately
|
|
97
|
+
2. Verify wallet addresses are correctly formatted in their respective roles
|
|
98
|
+
3. Check the Switchboard logs for detailed error messages
|
|
99
|
+
4. Verify that your database and Redis connections are working
|
|
100
|
+
5. Confirm that users are assigned to the correct roles
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Placeholder
|