### Install Visual Studio Code on Linux (Ubuntu/Debian) Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/03-ExampleUsecases/Chatroom/01-SetupBuilderEnvironment.md Step-by-step guide to install Visual Studio Code on Ubuntu/Debian systems, including updating packages, adding repositories, and installing the application. ```bash sudo apt update ``` ```bash sudo apt install software-properties-common apt-transport-https wget ``` ```bash wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add - ``` ```bash sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" ``` ```bash sudo apt install code ``` -------------------------------- ### Install @powerhousedao/design-system Source: https://github.com/powerhouse-inc/powerhouse/blob/main/packages/design-system/src/scalars/docs/getting-started.mdx Instructions for installing the `@powerhousedao/design-system` package using npm, yarn, or pnpm. ```bash npm install --save @powerhousedao/design-system ``` ```bash yarn add @powerhousedao/design-system ``` ```bash pnpm add @powerhousedao/design-system ``` -------------------------------- ### Verify Node.js, pnpm, and Git Installations Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/03-ExampleUsecases/Chatroom/01-SetupBuilderEnvironment.md Check the installed versions of Node.js, pnpm, and Git to confirm successful setup of the development environment. ```bash node --version pnpm --version git --version ``` -------------------------------- ### Example Output for Powerhouse Installation Verification Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/01-BuilderEnvironment/01-Prerequisites.md This snippet displays typical output from running the verification commands. It shows expected version numbers for Node.js, pnpm, Git, and the Powerhouse CLI, along with any additional setup messages from `ph --version`. ```bash % node --version v22.16.0 % pnpm --version 10.10.0 % git --version git version 2.39.3 % ph --version PH CMD version: 0.43.18 ------------------------------------- PH CLI is not available, please run `ph setup-globals` to generate the default global project ``` -------------------------------- ### Install and Verify Git on Linux (Ubuntu/Debian) Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/03-ExampleUsecases/Chatroom/01-SetupBuilderEnvironment.md Install Git on Ubuntu/Debian systems using apt package manager and verify the installation. ```bash sudo apt update ``` ```bash sudo apt install git ``` ```bash git --version ``` -------------------------------- ### Install and Verify Git on macOS Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/03-ExampleUsecases/Chatroom/01-SetupBuilderEnvironment.md Install Git on macOS using Homebrew and verify the installation by checking the version. ```bash brew install git ``` ```bash git --version ``` -------------------------------- ### Install PNPM and Project Dependencies Source: https://github.com/powerhouse-inc/powerhouse/blob/main/packages/document-drive/README.md Instructions to install PNPM version 10 globally via `npx` and then install all project dependencies using `pnpm install`. ```bash npx pnpm@10 install pnpm install ``` -------------------------------- ### Install Git on Linux (Ubuntu/Debian) Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/04-WorkWithData/05-AnalyticsProcessorTutorial/01-SetupBuilderEnvironment.md This snippet outlines the `bash` commands required to install Git on Ubuntu or Debian-based Linux distributions. It starts by updating the package list to ensure access to the latest software versions, followed by the command to install Git. Finally, it includes a command to verify the successful installation by displaying the Git version. ```bash sudo apt update sudo apt install git git --version ``` -------------------------------- ### Initialize Powerhouse Project and Start Local Connect Application Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/07-Cookbook.md This recipe guides users through initializing a new Powerhouse project and starting the local Connect development environment. It covers the essential CLI commands to set up a project and access the local studio for document model creation. ```bash ph init # Follow the prompts to name your project ``` ```bash cd ``` ```bash ph connect ``` -------------------------------- ### Verify Node.js, pnpm, and Git Installations Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/04-WorkWithData/05-AnalyticsProcessorTutorial/01-SetupBuilderEnvironment.md This snippet provides `bash` commands to quickly verify the successful installation of key development tools: Node.js, pnpm, and Git. Running these commands in your terminal will display the installed version numbers for each tool. This final verification step confirms that your development environment is correctly set up and ready for use with Powerhouse Connect tutorials. ```bash node --version pnpm --version git --version ``` -------------------------------- ### Quick Start for Powerhouse CLI Project Source: https://github.com/powerhouse-inc/powerhouse/blob/main/clis/ph-cli/README.md A sequence of commands to quickly initialize a new Powerhouse project, start the development environment, install core dependencies, and generate code from models. This provides a rapid setup for new Powerhouse applications, demonstrating the basic workflow. ```bash # Initialize a new Powerhouse project ph init # Start the development environment ph connect # Install required dependencies ph install @powerhousedao/core # Generate code from models ph generate --interactive ``` -------------------------------- ### Verify Git Installation on Windows Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/03-ExampleUsecases/Chatroom/01-SetupBuilderEnvironment.md After installing Git on Windows, use PowerShell to verify the installation by checking the Git version. ```powershell git --version ``` -------------------------------- ### Initialize a New Powerhouse Document Model Library Project Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/04-WorkWithData/05-AnalyticsProcessorTutorial/02-CreateNewPowerhouseProject.md The `ph init` command is used to create a new Powerhouse Document Model Library project in the current directory. This command initiates the project setup process, including dependency installation. ```bash `ph init` ``` -------------------------------- ### Install Powerhouse CLI Globally Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/03-ExampleUsecases/Chatroom/01-SetupBuilderEnvironment.md This command installs the Powerhouse CLI, which is essential for creating, building, and running Document Models and accessing Powerhouse ecosystem tools. A global installation is recommended for power users. ```npm npm install ph-cmd ``` -------------------------------- ### Verify Node.js and pnpm Installation on Windows Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/03-ExampleUsecases/Chatroom/01-SetupBuilderEnvironment.md These commands check the installed versions of Node.js and pnpm to confirm successful installation. Version numbers should be displayed if the installation was successful. ```powershell node --version pnpm --version ``` -------------------------------- ### Install Node.js and npm on Linux (Ubuntu/Debian) Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/03-ExampleUsecases/Chatroom/01-SetupBuilderEnvironment.md This command installs Node.js and npm (Node Package Manager) from the system's repositories, which are required for running JavaScript applications. ```bash sudo apt install nodejs npm ``` -------------------------------- ### Verify Node.js and pnpm Installation on Linux (Ubuntu/Debian) Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/03-ExampleUsecases/Chatroom/01-SetupBuilderEnvironment.md These commands check the installed versions of Node.js and pnpm to confirm successful installation. Version numbers should be displayed if the installation was successful. ```bash node --version pnpm --version ``` -------------------------------- ### Install Visual Studio Code on Linux (Ubuntu/Debian) Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/04-WorkWithData/05-AnalyticsProcessorTutorial/01-SetupBuilderEnvironment.md This snippet provides the necessary `bash` commands to install Visual Studio Code on Ubuntu or Debian-based Linux distributions. It includes steps for updating package lists, installing dependencies, importing Microsoft's GPG key, adding the VS Code repository, and finally installing the `code` package. This ensures VS Code is properly set up and ready for use. ```bash sudo apt update sudo apt install software-properties-common apt-transport-https wget wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add - sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" sudo apt install code ``` -------------------------------- ### Install and Use Specific Node.js Version Source: https://github.com/powerhouse-inc/powerhouse/blob/main/packages/document-drive/README.md Demonstrates how to install and activate a precise Node.js version (e.g., 22.14.0) using `npx` commands, ensuring environment consistency. ```bash npx install 22.14.0 npx use 22.14.0 ``` -------------------------------- ### Verify Node.js and pnpm Installation on macOS Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/03-ExampleUsecases/Chatroom/01-SetupBuilderEnvironment.md These commands check the installed versions of Node.js and pnpm to confirm successful installation. Version numbers should be displayed if the installation was successful. ```bash node --version pnpm --version ``` -------------------------------- ### Initialize Powerhouse Project Environment Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/01-BuilderEnvironment/02-StandardDocumentModelWorkflow.md Initializes the Powerhouse environment, preparing the local setup for Connect Studio Mode and optionally prompting for a new project name if starting a new package. ```bash ph init ``` -------------------------------- ### Verify Node.js and pnpm Installation on Windows Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/04-WorkWithData/05-AnalyticsProcessorTutorial/01-SetupBuilderEnvironment.md Checks the installed versions of Node.js and pnpm to confirm successful installation on Windows. The output should display the version number for each command. ```powershell node --version pnpm --version ``` -------------------------------- ### Initialize Powerhouse Project with setup-globals Command Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/04-APIReferences/00-PowerhouseCLI.md The `setup-globals` command initializes a new Powerhouse project, configuring global settings and dependencies. It can create a project with a specified name or in the current directory, and supports an interactive mode for guided setup. This command ensures proper configuration files and Powerhouse package dependencies are established. ```APIDOC Command Overview: The setup-globals command initializes a new Powerhouse project with the necessary global configuration. It helps you set up a project quickly with proper defaults and dependencies. This command: 1. Creates a new project with the specified name or in the current directory 2. Sets up all required Powerhouse dependencies 3. Configures the project with appropriate settings 4. Can run in interactive mode to guide you through the setup process Arguments: [project-name] Optional. Name of the project to create. If not provided, the command will use the current directory. Options: -p, --project Specify the name of the project to create. -i, --interactive Run the command in interactive mode, which will guide you through the setup process with questions and prompts. -v, --version Specify the development version to use. Defaults to "main". --dev Use the "development" version of the boilerplate. --staging Use the "staging" version of the boilerplate. --package-manager Override the auto-detected package manager with the specified one. Project Structure: The command will set up a project with the following structure: - Proper configuration files for TypeScript and ESLint - Dependencies for Powerhouse packages - Build and development scripts Examples: $ ph setup-globals my-project # Create a new project named "my-project" $ ph setup-globals # Set up a project in the current directory $ ph setup-globals -i # Run setup in interactive mode $ ph setup-globals --dev # Use development version $ ph setup-globals -v beta # Use specific version $ ph setup-globals --package-manager npm # Use npm as package manager ``` -------------------------------- ### Install Powerhouse CLI Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/04-WorkWithData/05-AnalyticsProcessorTutorial/01-SetupBuilderEnvironment.md Installs the Powerhouse CLI globally using npm. This command-line interface is crucial for creating, building, and running Powerhouse Document Models and accessing ecosystem tools. ```shell npm install ph-cmd ``` -------------------------------- ### Install Powerhouse CLI and Cloud Environment Dependencies Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/05-Launch/03-SetupEnvironment.md Provides the 'curl' command to run the Powerhouse installation script, which sets up Node.js 22, pnpm, and prepares the system for Powerhouse services. Includes steps to source shell configuration and verify the CLI installation. ```bash curl -fsSL https://apps.powerhouse.io/install | bash # for macOS, Linux, and WSL source ~/.bashrc # or source ~/.zshrc if using zsh ph --version ``` -------------------------------- ### Install Contributor Billing Demo Package Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/01-GetStarted/00-ExploreDemoPackage.md This command uses the Powerhouse CLI to install the pre-built 'Contributor Billing' demo package, making its document models and editors available in your local Powerhouse environment. ```bash # Install the package ph install @powerhousedao/contributor-billing ``` -------------------------------- ### Install Homebrew on macOS Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/03-ExampleUsecases/Chatroom/01-SetupBuilderEnvironment.md This command installs Homebrew, a package manager for macOS, which is used to easily install other software like Node.js. ```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` -------------------------------- ### Install Git on macOS using Homebrew Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/04-WorkWithData/05-AnalyticsProcessorTutorial/01-SetupBuilderEnvironment.md This snippet demonstrates how to install Git on macOS using Homebrew, a popular package manager. It includes the command to install Git and a subsequent command to verify the installation by checking the Git version. This method simplifies the installation process and ensures Git is correctly set up for development on macOS. ```bash brew install git git --version ``` -------------------------------- ### Install Homebrew on macOS Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/04-WorkWithData/05-AnalyticsProcessorTutorial/01-SetupBuilderEnvironment.md Installs Homebrew, a popular package manager for macOS, which simplifies the installation of development tools like Node.js. Users should follow any on-screen prompts during installation. ```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` -------------------------------- ### Verify Git Installation on Windows Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/04-WorkWithData/05-AnalyticsProcessorTutorial/01-SetupBuilderEnvironment.md This snippet provides the PowerShell command to verify that Git has been successfully installed on a Windows system. After downloading and running the Git installer, executing `git --version` in PowerShell confirms the installation by displaying the installed Git version. This step is crucial to ensure Git is ready for use in your development workflow. ```powershell git --version ``` -------------------------------- ### Start Test Databases with Docker Compose Source: https://github.com/powerhouse-inc/powerhouse/blob/main/packages/document-drive/README.md Launches required services like Postgres and Redis for testing using the `docker-compose.test.yml` file in detached mode, providing a clean test environment. ```bash docker compose -f docker-compose.test.yml up -d ``` -------------------------------- ### Powerhouse Service Command Usage Examples Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/04-APIReferences/00-PowerhouseCLI.md Practical examples demonstrating how to use the `ph service` command to control Powerhouse services, including starting, stopping, listing, and checking their status, as well as configuring startup behavior. These examples illustrate common operations for managing Powerhouse project services. ```Shell $ ph service # List all services (same as 'ph service list all') $ ph service start switchboard # Start the Switchboard service $ ph service stop connect # Stop the Connect service $ ph service start all # Start all services $ ph service status # Check status of all services $ ph service startup # Configure services to start on system boot $ ph service unstartup # Remove services from system startup ``` -------------------------------- ### Verify Node.js and pnpm Installation on macOS Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/04-WorkWithData/05-AnalyticsProcessorTutorial/01-SetupBuilderEnvironment.md Checks the installed versions of Node.js and pnpm to confirm successful installation on macOS. The output should display the version number for each command. ```bash node --version pnpm --version ``` -------------------------------- ### Control Powerhouse Services (Start, Stop, Restart) Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/05-Launch/03-SetupEnvironment.md These commands provide control over the Powerhouse 'switchboard' and 'connect' services, allowing you to start, stop, or restart them as needed for maintenance or troubleshooting. ```bash ph service start | stop | restart ``` -------------------------------- ### Verify Node.js and pnpm Installation on Linux (Ubuntu/Debian) Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/04-WorkWithData/05-AnalyticsProcessorTutorial/01-SetupBuilderEnvironment.md Checks the installed versions of Node.js and pnpm to confirm successful installation on Linux (Ubuntu/Debian). The output should display the version number for each command. ```bash node --version pnpm --version ``` -------------------------------- ### Run Powerhouse Connect to Start Application Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/03-BuildingADriveExplorer.md This command starts the local Powerhouse Connect server, allowing users to visualize and interact with the developed Todo Drive Explorer application. ```bash ph connect ``` -------------------------------- ### Install Node.js 22 and npm on Linux (Ubuntu/Debian) Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/04-WorkWithData/05-AnalyticsProcessorTutorial/01-SetupBuilderEnvironment.md Installs Node.js 22 and npm (Node Package Manager) on Ubuntu/Debian-based Linux distributions using the apt package manager. ```bash sudo apt install nodejs npm ``` -------------------------------- ### Install Node.js on macOS using Homebrew Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/03-ExampleUsecases/Chatroom/01-SetupBuilderEnvironment.md This command uses Homebrew to install Node.js, including npm and pnpm, on macOS. ```bash brew install node ``` -------------------------------- ### Install Powerhouse Package in Environment Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/01-BuilderEnvironment/02-StandardDocumentModelWorkflow.md This command installs a published Powerhouse package into a local Connect instance or deployed Reactor setup. It makes the package's document models and editors available for use within that Powerhouse environment. ```bash ph install @your-org-ph/your-package-name ``` -------------------------------- ### Install Powerhouse CLI Globally Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/01-GetStarted/01-CreateNewPowerhouseProject.md Installs the Powerhouse Command Line Interface globally using pnpm, providing essential commands for project management. Node.js 22 and pnpm are required prerequisites. ```bash pnpm install -g ph-cmd ``` -------------------------------- ### Run Design System Project Locally Source: https://github.com/powerhouse-inc/powerhouse/blob/main/packages/design-system/README.md Instructions to clone the repository, install dependencies, and start the Storybook development server for the Powerhouse design system. ```Shell git clone https://github.com/powerhouse-inc/design-system.git yarn install yarn storybook ``` -------------------------------- ### Verify Powerhouse CLI Installation Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/01-GetStarted/00-ExploreDemoPackage.md After installation, use this command to verify that the Powerhouse CLI has been successfully installed and to check its version. ```bash ph-cmd --version ``` -------------------------------- ### Starting the Powerhouse Reactor Service Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/07-Cookbook.md This recipe outlines the steps to start the Powerhouse Reactor, a local service crucial for processing document model operations and managing state during development or testing. It requires the Powerhouse CLI and an initialized project. ```bash cd ph reactor ``` -------------------------------- ### Start Powerhouse Connect Desktop or Web Application Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/connect/README.md Instructions to start the Powerhouse Connect application, either as a desktop app or a web app, after setting up the development environment. The web app will be accessible at `http://localhost:5173`. ```bash npm start # start desktop app # OR npm run dev:web # start web app ``` -------------------------------- ### Initialize Project Environment File Source: https://github.com/powerhouse-inc/powerhouse/blob/main/packages/document-drive/README.md Creates the necessary `.env` configuration file by copying from the provided `.env.example` template, essential for local development. ```bash cp .env.example .env ``` -------------------------------- ### Install Powerhouse CLI Globally or Locally Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/01-BuilderEnvironment/01-Prerequisites.md Provides commands to install the Powerhouse Command Line Interface (CLI) using pnpm. A global installation is recommended for power users to access commands from any directory. ```bash pnpm install ph-cmd pnpm install -g ph-cmd ``` -------------------------------- ### Install Website Dependencies Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/README.md Installs the necessary Node.js dependencies for the Docusaurus website using npm. ```bash $ npm install ``` -------------------------------- ### Verify Powerhouse Dependencies Installation Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/01-BuilderEnvironment/01-Prerequisites.md Run these commands in your terminal to check the installed versions of Node.js, pnpm, Git, and the Powerhouse CLI. This ensures all necessary development dependencies are correctly set up before proceeding. ```bash node --version pnpm --version git --version ph --version ``` -------------------------------- ### Initialize a New Powerhouse Project (Quick Start) Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/01-GetStarted/01-CreateNewPowerhouseProject.md Creates a new Powerhouse project boilerplate in the current directory, setting up the basic structure for a document model and editor. ```bash ph init ``` -------------------------------- ### Install and Verify Git on Linux (Ubuntu/Debian) Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/01-BuilderEnvironment/01-Prerequisites.md This snippet provides bash commands for installing Git on Ubuntu or Debian-based Linux distributions. It includes updating the package list, installing Git, and verifying the installation by checking the Git version. ```bash sudo apt update sudo apt install git git --version ``` -------------------------------- ### Initialize a new Powerhouse project Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/05-Launch/02-PublishYourProject.md This command initializes a new Powerhouse project, setting up the necessary structure for document models and editors. ```bash ph init ``` -------------------------------- ### Install Powerhouse CLI (`ph-cmd`) Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/07-Cookbook.md This recipe outlines how to install the Powerhouse CLI (`ph-cmd`) globally to create and manage Powerhouse projects. It requires Node.js 22 and pnpm. The solution covers global installation, version verification, and options for installing specific or staging versions. ```bash pnpm install -g ph-cmd ``` ```bash ph-cmd --version ``` ```bash # For the staging version pnpm install -g ph-cmd@staging # For a specific version pnpm install -g ph-cmd@ ``` -------------------------------- ### Example: Setting Up a New Powerhouse Project Source: https://github.com/powerhouse-inc/powerhouse/blob/main/clis/ph-cmd/README.md A common workflow demonstrating how to initialize a new project with npm, set up global configurations, and switch to the development environment. ```bash # Initialize a new project with npm ph init my-project --package-manager npm # Set up global configurations ph setup-globals # Switch to development environment ph use dev ``` -------------------------------- ### Install Powerhouse CLI Globally Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/01-GetStarted/00-ExploreDemoPackage.md This command installs the Powerhouse command-line interface (CLI) globally using pnpm, enabling interaction with the Powerhouse ecosystem from your terminal. ```bash pnpm install -g ph-cmd ``` -------------------------------- ### Install Development Dependencies for Builder Tools Source: https://github.com/powerhouse-inc/powerhouse/blob/main/packages/builder-tools/README.md Command to install all necessary project dependencies for local development and contribution to the `@powerhousedao/builder-tools` repository. ```bash npm install ``` -------------------------------- ### Install Powerhouse CLI with Specific Branches Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/01-BuilderEnvironment/03-BuilderTools.md Demonstrates how to install the Powerhouse CLI using different branches (dev, staging) for experimental features or bug fixes, alongside the stable version. ```bash pnpm install -g ph-cmd ``` ```bash pnpm install -g ph-cmd@dev ``` ```bash pnpm install -g ph-cmd@staging ``` -------------------------------- ### Installing Project Packages with ph connect Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/05-Launch/02-PublishYourProject.md This command installs a previously published project package into your local 'ph connect' instance. It requires replacing the placeholder with your specific organization and package name. This enables local deployment and testing of your packaged project within the Connect environment. ```bash ph install @ ``` -------------------------------- ### Interactive Powerhouse Project Initialization Flow Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/01-GetStarted/01-CreateNewPowerhouseProject.md Demonstrates the interactive terminal experience when running 'ph init', including the prompt for the project name and the subsequent success messages indicating Git repository initialization and completion of the installation. ```bash you@yourmachine:~/Powerhouse$ ph init ? What is the project name? ‣ Initialized empty Git repository in /Users/yourmachine//.git/ The installation is done! ``` -------------------------------- ### Start Powerhouse Connect and Reactor for Local Development Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/04-WorkWithData/01-ReadingAndWritingThroughTheAPI.mdx This command simultaneously starts both Powerhouse Connect and a Powerhouse Reactor instance locally within a Powerhouse project. It provides a unified environment for local development and testing, returning a URL to access the Reactor. ```bash ph dev ``` -------------------------------- ### Clone, Install, Build, and Run Powerhouse Monorepo Source: https://github.com/powerhouse-inc/powerhouse/blob/main/README.md Instructions to clone the repository, install dependencies, build all projects, and run a specific project or application within the Powerhouse monorepo using pnpm and Nx. ```bash git clone cd pnpm install pnpm build npx nx ``` -------------------------------- ### Start Local Development Server Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/README.md Starts a local development server for the Docusaurus website, opening a browser window. Most changes are reflected live without restarting the server. The server may break on broken links or major navigation/relinking changes. ```bash $ npm run dev ``` -------------------------------- ### Install Powerhouse CLI (ph-cmd) globally Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/05-Launch/02-PublishYourProject.md Installs the Powerhouse CLI tool globally using pnpm, providing essential commands for managing Powerhouse projects. ```bash pnpm install -g ph-cmd ``` -------------------------------- ### Install Powerhouse CLI Globally Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/01-BuilderEnvironment/01-Prerequisites.md This snippet provides the pnpm command to globally install the Powerhouse CLI (`ph-cmd`) package. The CLI provides essential commands for managing Powerhouse projects, such as `ph connect`, `ph init`, and `ph help`. ```bash pnpm install -g ph-cmd ``` -------------------------------- ### Install Node.js 22 via Homebrew on macOS Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/04-WorkWithData/05-AnalyticsProcessorTutorial/01-SetupBuilderEnvironment.md Installs Node.js 22 using Homebrew, the package manager for macOS. This command should be run after Homebrew has been successfully installed. ```bash brew install node ``` -------------------------------- ### Serve Powerhouse Project Build Output Locally Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/05-Launch/02-PublishYourProject.md This command is intended to start a local server to serve the built Powerhouse project. It allows developers to inspect the build output and verify the functionality of document models in a local environment. Note: The text indicates this command is currently not working. ```bash pnpm serve ``` -------------------------------- ### Powerhouse CLI `ph use` Command Examples Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/01-BuilderEnvironment/03-BuilderTools.md Provides examples of using the `ph use` command to switch project dependencies to latest stable, development, or local versions, and to specify a package manager. ```bash ph use latest ``` ```bash ph use dev ``` ```bash ph use local /path/to/local/packages ``` ```bash ph use latest --package-manager pnpm ``` -------------------------------- ### Start Powerhouse Development Environment (CLI) Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/04-WorkWithData/03-WorkingWithSubgraphs/03-WorkingWithSubgraphs.md This command starts the full Powerhouse development environment, including the Reactor, allowing connection in Studio or locally. It's a comprehensive startup command for local development. ```bash ph dev ``` -------------------------------- ### Example Variables for GraphQL Add Drive Mutation Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/03-BuildingUserExperiences/02-ConfiguringDrives.md This JSON object provides example input variables for the `addDrive` GraphQL mutation. It demonstrates how to specify the drive's `name` and `icon` URL, while showing `addDriveId` and `slug` as null for default assignment. These variables are passed alongside the mutation query. ```json { "name": "AcademyTest", "icon": "https://static.thenounproject.com/png/3009860-200.png", "addDriveId": null, "slug": null } ``` -------------------------------- ### Launch Powerhouse Connect in Studio Mode Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/01-BuilderEnvironment/02-StandardDocumentModelWorkflow.md Starts a local instance of Powerhouse Connect in Studio Mode, including a local Reactor, for defining, building, and testing document models. This typically opens Connect in your browser at http://localhost:3000/. ```bash ph connect ``` -------------------------------- ### Install Node.js 22 and pnpm on macOS with Homebrew Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/01-BuilderEnvironment/01-Prerequisites.md Uses Homebrew to install Node.js version 22 and the pnpm package manager on macOS systems, streamlining the setup process. ```bash brew install node@22 brew install pnpm ``` -------------------------------- ### Install and use specific Powerhouse CLI branches Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/05-Launch/02-PublishYourProject.md Commands for installing and using development or staging versions of the Powerhouse CLI and project boilerplate, which contain experimental features or bug fixes. Be aware that these versions may contain bugs and experimental features that aren't fully tested. ```bash pnpm install -g ph-cmd ``` ```bash pnpm install -g ph-cmd@dev ``` ```bash pnpm install -g ph-cmd@staging ``` ```bash ph init ``` ```bash ph init --dev ``` ```bash ph init --staging ``` ```bash ph use ``` ```bash ph use dev ``` ```bash ph use prod ``` -------------------------------- ### Initialize Git Repository for Powerhouse Project Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/05-Launch/02-PublishYourProject.md These commands initialize a new Git repository in the project directory, stage all current files for tracking, and create an initial commit. This sets up version control for the Powerhouse project, enabling change tracking and collaboration. ```bash git init git add . git commit -m "Initial commit" ``` -------------------------------- ### Powerhouse Reactor Command Usage Examples Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/04-APIReferences/00-PowerhouseCLI.md Practical examples demonstrating how to use the `ph reactor` command with various options to start the document processing engine, configure its port, enable auto-generation, or watch for file changes. These examples show common use cases for initializing and managing the Powerhouse reactor. ```Shell $ ph reactor # Start reactor with default settings $ ph reactor --port 5000 # Use custom port 5000 $ ph reactor --generate # Enable auto code generation $ ph reactor --watch # Watch for local file changes $ ph reactor --config-file custom.json # Use custom configuration file $ ph reactor --packages pkg1 pkg2 # Load specific packages ``` -------------------------------- ### Start Local Powerhouse Connect Application Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/01-GetStarted/01-CreateNewPowerhouseProject.md Launches a local instance of the Powerhouse Connect application, which serves as a Studio mode environment for defining document models. Upon successful startup, the application provides local and network URLs (e.g., http://localhost:3000/) for access in a web browser. ```bash ph connect ``` -------------------------------- ### Configure DNS Records with Existing Nameservers Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/05-Launch/03-SetupEnvironment.md Instructions for creating A records for root and subdomains (www, connect, switchboard) directly at your domain registrar when using existing nameservers. It is crucial to set up these DNS records and wait for propagation before running any setup scripts. ```APIDOC DNS Records: Root Domain (A Record): TYPE: A HOSTNAME: @ VALUE: Your Elastic IP TTL: 3600 WWW Subdomain (A Record): TYPE: A HOSTNAME: www VALUE: Your Elastic IP TTL: 3600 Connect Subdomain (A Record): TYPE: A HOSTNAME: connect VALUE: Your Elastic IP TTL: 3600 Switchboard Subdomain (A Record): TYPE: A HOSTNAME: switchboard VALUE: Your Elastic IP TTL: 3600 ``` -------------------------------- ### Run Powerhouse Connect App in Studio Mode Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/01-GetStarted/00-ExploreDemoPackage.md Execute this command to launch the Powerhouse Connect application locally in Studio mode, allowing you to explore and interact with the installed packages. ```bash ph connect ``` -------------------------------- ### Resolve 'Cannot find module' Error Source: https://github.com/powerhouse-inc/powerhouse/blob/main/packages/document-drive/README.md Provides a solution for `Cannot find module` errors by removing `node_modules` from both the current and parent directories, followed by a fresh `pnpm install`. ```bash rm -rf node_modules ../node_modules pnpm install ``` -------------------------------- ### Initialize Powerhouse Project Directory Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/01-BuilderEnvironment/03-BuilderTools.md The `ph init` command initializes a new Powerhouse project, setting up the directory structure and essential scripts based on the Document Model Boilerplate. It ensures compatibility with host applications like Connect and Switchboard for seamless integration. ```bash ph init ``` -------------------------------- ### Update APT Package List on Linux (Ubuntu/Debian) Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/04-WorkWithData/05-AnalyticsProcessorTutorial/01-SetupBuilderEnvironment.md Updates the local package index on Ubuntu/Debian-based systems. This ensures that the system has the latest information about available packages before installing new software. ```bash sudo apt update ``` -------------------------------- ### Clear Local Postgres Test Database Source: https://github.com/powerhouse-inc/powerhouse/blob/main/packages/document-drive/README.md Deletes the local Postgres test database by removing its mounted volume directory (`.db`), useful for starting with a clean slate. ```bash rm -rf .db ``` -------------------------------- ### Backing Up Powerhouse Database Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/05-Launch/03-SetupEnvironment.md This command uses pg_dump to create a backup of the Powerhouse PostgreSQL database. The backup is saved to backup.sql in the current directory. Ensure you have the correct user permissions. ```bash pg_dump -U powerhouse -d powerhouse > backup.sql ``` -------------------------------- ### Manage Powerhouse CLI Versions and Project Branches Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/01-GetStarted/01-CreateNewPowerhouseProject.md Provides commands to install specific development or staging versions of the Powerhouse CLI, initialize projects with different boilerplate versions, and switch project dependencies between production, development, and staging branches. These versions may contain experimental features or bug fixes. ```bash pnpm install -g ph-cmd ``` ```bash pnpm install -g ph-cmd@dev ``` ```bash pnpm install -g ph-cmd@staging ``` ```bash ph init ``` ```bash ph init --dev ``` ```bash ph init --staging ``` ```bash ph use ``` ```bash ph use dev ``` ```bash ph use prod ``` -------------------------------- ### Configure PowerShell Execution Policy for Node.js on Windows Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/04-WorkWithData/05-AnalyticsProcessorTutorial/01-SetupBuilderEnvironment.md Sets the PowerShell execution policy to 'RemoteSigned' for the current user. This allows locally created scripts to run while requiring scripts downloaded from the internet to be signed, a necessary step before installing Node.js on Windows. ```powershell Set-ExecutionPolicy RemoteSigned -Scope CurrentUser ``` -------------------------------- ### Powerhouse Project Initialization Prompt Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/03-ExampleUsecases/Chatroom/02-CreateNewPowerhouseProject.md After running `ph init`, the terminal will prompt you to enter a project name. It is crucial to enter 'ChatRoom' (with a capital 'R') to ensure compatibility with subsequent tutorial steps. ```bash you@yourmachine:~/Powerhouse$ ph init ? What is the project name? ‣ ChatRoom ``` -------------------------------- ### Analytics Hook Testing Setup with React Testing Library Source: https://github.com/powerhouse-inc/powerhouse/blob/main/packages/reactor-browser/src/analytics/README.md Example of setting up a test environment for analytics hooks using `AnalyticsProvider` as a wrapper. This snippet demonstrates how to render a hook and assert its success state using `renderHook` and `waitFor` from React Testing Library. ```tsx const wrapper = ({ children }: PropsWithChildren) => ( {children} ); describe('Analytics', () => { it('should query analytics data', async () => { const { result } = renderHook(() => useAnalyticsQuery({ start: DateTime.now().minus({ days: 1 }), end: DateTime.now(), granularity: AnalyticsGranularity.Daily, metrics: ['PageViews'], select: { page: [AnalyticsPath.fromString('pages/home')] } }), { wrapper }); await waitFor(() => expect(result.current.isSuccess).toBe(true)); }); }); ``` -------------------------------- ### Verify DNS Records using Dig Command Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/05-Launch/03-SetupEnvironment.md Command-line examples using `dig` to verify that DNS records for your domain and subdomains are correctly pointing to your Droplet's IP address. This helps confirm propagation. ```bash dig +short yourdomain.com dig +short www.yourdomain.com dig +short connect.yourdomain.com dig +short switchboard.yourdomain.com ``` -------------------------------- ### Uninstall Powerhouse CLI (`ph-cmd`) Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/07-Cookbook.md This recipe details how to perform a clean uninstallation of the Powerhouse CLI (`ph-cmd`). It involves uninstalling the package globally and removing the associated global setups folder to ensure a clean system, which is useful for resolving outdated versions or preparing for a fresh installation. ```bash pnpm uninstall -g ph-cmd ``` ```bash rm -rf ~/.ph ``` -------------------------------- ### Generate Powerhouse Project Directory Structure Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/05-Launch/02-PublishYourProject.md This command initializes the Powerhouse project by generating a standard directory and file structure. It creates essential folders like `document-models`, `editors`, `processors`, `scripts`, and `tests`, providing a foundation for building document models and related components. ```bash ph generate ``` -------------------------------- ### Example of a query to get a contributor Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/04-WorkWithData/02-GraphQLAtPowerhouse.md This GraphQL query demonstrates how to retrieve specific data for a `Contributor` with a given ID. It fetches the contributor's name, reputation score, and the titles and statuses of their associated projects, showcasing how to access related data within a single query. ```graphql query { getContributor(id: "123") { name reputationScore projects { title status } } } ``` -------------------------------- ### Powerhouse CLI Key Commands Overview Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/01-BuilderEnvironment/02-StandardDocumentModelWorkflow.md A comprehensive list of essential Powerhouse CLI commands for project management, development, testing, and publishing of Powerhouse packages. ```bash pnpm install -g ph-cmd ph init ph connect ph generate ph generate --editor YourModelName --document-types powerhouse/YourModelName pnpm build pnpm run test npm login npm publish ph install @your-org-ph/your-package-name ``` -------------------------------- ### Basic Checkbox Component Usage Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/06-ComponentLibrary/00-DocumentEngineering.md This snippet illustrates the basic integration of a `Checkbox` UI component, demonstrating how to set its initial state and label using `defaultValue` and `label` props. This example is typically found in the Storybook 'Usage Snippet' section, providing a starting point for component implementation. ```JSX ``` -------------------------------- ### Navigate to New Powerhouse Project Directory Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/03-ExampleUsecases/Chatroom/02-CreateNewPowerhouseProject.md After the project is created, use the `cd` command to move into the newly generated project directory, which in this tutorial is named 'ChatRoom'. This step is necessary to perform further actions within the project context. ```bash cd ChatRoom ``` -------------------------------- ### Execute Analytics Queries using useAnalyticsQuery Hook Source: https://github.com/powerhouse-inc/powerhouse/blob/main/packages/reactor-browser/src/analytics/README.md Example of using the `useAnalyticsQuery` hook to fetch aggregated analytics data. The query can specify a time range (`start`, `end`), `granularity`, `metrics` to retrieve, and `select` criteria for specific pages or users, along with `lod` (level of detail) for dimensions. ```tsx const { data, isLoading } = useAnalyticsQuery({ start: DateTime.now().minus({ days: 7 }), end: DateTime.now(), granularity: AnalyticsGranularity.Total, metrics: ['PageViews'], select: { page: [AnalyticsPath.fromString('pages/home')], user: [AnalyticsPath.fromString(`users/active`)] }, lod: { page: 1 } }); ``` -------------------------------- ### TypeScript: Add Data Series Value to Analytics Store Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/04-WorkWithData/06-Analytics Engine/typescript/index.md Illustrates how to add a single data point or series value to the analytics store using the `addSeriesValue` method. This example shows how to structure the data with Luxon `DateTime` for `start`, `AnalyticsPath` for `source` and dimensions, and include metric, unit, and value. ```typescript import { DateTime } from "luxon"; import { AnalyticsPath } from "@powerhousedao/analytics-engine-core"; const source = AnalyticsPath.fromString("example/insert"); await store.addSeriesValue([ { start: DateTime.utc(2021, 1, 1), source, value: 10000, unit: "DAI", metric: "budget", dimensions: { budget: AnalyticsPath.fromString("atlas/legacy/core-units/PE-001"), category: AnalyticsPath.fromString( "atlas/headcount/CompensationAndBenefits/FrontEndEngineering" ), project: source, }, }, ]); ``` -------------------------------- ### Verify Git Installation on Windows Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/01-BuilderEnvironment/01-Prerequisites.md After installing Git on Windows, this PowerShell command verifies the successful installation by displaying the installed Git version. It confirms that Git is correctly added to the system's PATH. ```powershell git --version ``` -------------------------------- ### Run Powerhouse Connect Application Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/03-ExampleUsecases/Chatroom/05-ImplementChatroomEditor.md This command is used to start the Powerhouse Connect application. Running this command allows users to access and interact with the implemented `Chatroom` editor and other document models. ```bash ph connect ``` -------------------------------- ### Install Powerhouse Dependencies (ph install) Source: https://github.com/powerhouse-inc/powerhouse/blob/main/clis/ph-cli/README.md Manages the installation of Powerhouse dependencies, supporting global, workspace-specific, and multiple package installations. It provides options for debugging and forcing a specific package manager, streamlining dependency management for projects and monorepos. ```APIDOC Command: ph install (or ph add, ph i) Description: Install Powerhouse dependencies with support for global and workspace-specific installations. Options: -g, --global: Install the dependency globally --debug: Show additional logs -w, --workspace: Install the dependency in the workspace (use this option for monorepos) --package-manager : Force package manager to use ``` ```bash # Install a package ph install @powerhousedao/package-name # Install globally ph install -g @powerhousedao/package-name # Install in workspace (for monorepos) ph install -w @powerhousedao/package-name # Install multiple packages ph install @powerhousedao/package1 @powerhousedao/package2 ``` -------------------------------- ### Initialize Git Repository for Powerhouse Project Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/01-BuilderEnvironment/02-StandardDocumentModelWorkflow.md These commands initialize a Git repository, stage all current files, and create an initial commit. Version control is vital for tracking changes, collaborating with teams, and managing different versions of the package. ```bash git init git add . git commit -m "Initial commit of document model package" # git remote add origin # git push -u origin main ``` -------------------------------- ### Install Homebrew Package Manager on macOS Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/01-BuilderEnvironment/01-Prerequisites.md Installs Homebrew, the missing package manager for macOS, which is required to easily install Node.js and other development tools. ```bash /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` -------------------------------- ### Inspect Let's Encrypt SSL Certificates Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/05-Launch/03-SetupEnvironment.md If you used Let's Encrypt for SSL configuration, this command displays details about your installed SSL certificates, including their domains, expiration dates, and paths. ```bash sudo certbot certificates ``` -------------------------------- ### Install Powerhouse CLI Source: https://github.com/powerhouse-inc/powerhouse/blob/main/clis/ph-cli/README.md Instructions for installing the Powerhouse CLI globally or as a development dependency using npm. Global installation makes the 'ph' command available system-wide, while dev dependency installation is suitable for project-specific usage within a project's development environment. ```bash # Install globally npm install -g ph-cli # Install as a dev dependency npm install --save-dev ph-cli ``` -------------------------------- ### Start Powerhouse Connect Application Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/03-ExampleUsecases/Chatroom/02-CreateNewPowerhouseProject.md Once inside the project directory, execute the `ph connect` command to launch the local Powerhouse Connect application. This application provides a graphical interface for building and managing your document models. ```bash ph connect ``` -------------------------------- ### Powerhouse CLI: Install Dependencies Source: https://github.com/powerhouse-inc/powerhouse/blob/main/clis/ph-cli/COMMANDS.md The `install` command adds Powerhouse dependencies to your project. It handles package installation, updates `powerhouse.config.json`, and supports various package managers like npm, yarn, pnpm, and bun. Options allow for global, workspace, or debug installations. ```APIDOC Command Overview: The install command adds Powerhouse dependencies to your project. It handles installation of packages, updates configuration files, and ensures proper setup of dependencies. This command: 1. Installs specified Powerhouse dependencies using your package manager 2. Updates powerhouse.config.json to include the new dependencies 3. Supports various installation options and configurations 4. Works with npm, yarn, pnpm, and bun package managers Arguments: [dependencies...] Names of the dependencies to install. You can provide multiple dependency names separated by spaces. Options: -g, --global Install the dependencies globally rather than in the current project. --debug Show additional logs during the installation process for troubleshooting. -w, --workspace Install the dependencies in the workspace (use this option for monorepos). This ensures packages are installed with proper workspace configuration. --package-manager Force a specific package manager to use. Supported values are: "npm", "yarn", "pnpm", "bun". If not specified, the command will detect the appropriate package manager from lockfiles. Aliases: $ ph add $ ph i ``` ```Shell $ ph install @powerhousedao/core $ ph install @powerhousedao/core @powerhousedao/utils $ ph install @powerhousedao/cli -g $ ph install @powerhousedao/document-model -w $ ph install @powerhousedao/core --package-manager yarn $ ph install @powerhousedao/editor --debug ``` -------------------------------- ### Initialize New Powerhouse Project Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/03-ExampleUsecases/Chatroom/02-CreateNewPowerhouseProject.md Run the `ph init` command in your terminal to begin the process of creating a new Powerhouse Document Model Library project. This command will set up the necessary project structure in your current directory. ```bash ph init ``` -------------------------------- ### Verify Node.js and pnpm Installation Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/01-BuilderEnvironment/01-Prerequisites.md Confirms the successful installation of Node.js and pnpm by checking their installed versions. This step is crucial to ensure the development environment is correctly set up. ```powershell node --version pnpm --version ``` ```bash node --version pnpm --version ``` -------------------------------- ### Run Powerhouse Connect Application Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/01-GetStarted/04-BuildToDoListEditor.md This command is used to start the Powerhouse Connect application. Running this command allows users to interact with and test their implemented document models and editors, such as the ToDoList editor, in a live environment. ```bash ph connect ``` -------------------------------- ### Install pnpm Globally via npm on Windows Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/01-BuilderEnvironment/01-Prerequisites.md Installs the pnpm package manager globally using npm, which is typically installed with Node.js. This step is specific to Windows environments. ```powershell npm install -g pnpm ``` -------------------------------- ### Configure DNS Records with DigitalOcean Nameservers Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/05-Launch/03-SetupEnvironment.md Details for setting up A records for root, www, connect, and switchboard subdomains using DigitalOcean's nameservers. This involves updating nameservers at the registrar and creating records in DigitalOcean. ```APIDOC Nameservers: - ns1.digitalocean.com - ns2.digitalocean.com - ns3.digitalocean.com DNS Records (A Record): Root Domain: TYPE: A HOSTNAME: @ WILL DIRECT TO: Your Droplet's IP TTL: 3600 WWW Subdomain: TYPE: A HOSTNAME: www WILL DIRECT TO: Your Droplet's IP TTL: 3600 Connect Subdomain: TYPE: A HOSTNAME: connect WILL DIRECT TO: Your Droplet's IP TTL: 3600 Switchboard Subdomain: TYPE: A HOSTNAME: switchboard WILL DIRECT TO: Your Droplet's IP TTL: 3600 ``` -------------------------------- ### Installing Custom Powerhouse Packages Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/07-Cookbook.md This recipe details how to install custom Powerhouse packages, either published to npm or available locally, into an existing Powerhouse project. It leverages the Powerhouse CLI's `ph install` command. ```bash cd # For npm packages: ph install # For local packages: ph install ../path/to/my-local-package ph install /Users/you/dev/my-local-package ``` -------------------------------- ### Run ToDoList Operation Reducers Tests Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/01-GetStarted/03-ImplementOperationReducers.md Command-line instruction to execute the `ToDoList` operation reducers tests using `pnpm`. ```bash pnpm run test ``` -------------------------------- ### Install and Verify Git on macOS Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/02-MasteryTrack/01-BuilderEnvironment/01-Prerequisites.md This snippet provides bash commands to install Git on macOS using Homebrew, a popular package manager. It also includes a command to verify the successful installation by checking the Git version. ```bash brew install git git --version ``` -------------------------------- ### Install Powerhouse CLI (ph-cmd) Source: https://github.com/powerhouse-inc/powerhouse/blob/main/clis/ph-cmd/README.md Instructions for installing the Powerhouse CLI globally using npm, yarn, or pnpm. After installation, a default project is created in your home directory under `.ph/` for fallback context. ```bash # Using npm npm install -g ph-cmd ``` ```bash # Using yarn yarn global add ph-cmd ``` ```bash # Using pnpm pnpm add -g ph-cmd ``` -------------------------------- ### PHID Component Formatting Rules and Examples Source: https://github.com/powerhouse-inc/powerhouse/blob/main/apps/academy/docs/academy/06-ComponentLibrary/04-LayoutComponent.mdx Details the various notation formats for the PHID component, including basic, full (with branch and scope), data object references, and URL formats, along with concrete examples. ```APIDOC Formatting Rules: Basic Notation: phd: Branch and Scope: Optional components appended using colons :. Full Notation: phd::: Branch: Defaults to main if omitted. Scope: Defaults to public if omitted. Data Object Reference: phd:/ URL Format: phd:/// Example: phd://switchboard.powerhouse.xyz/baefc2a4-f9a0-4950-8161-fd8d8cc7dea9 Examples: Basic PHID: phd:baefc2a4-f9a0-4950-8161-fd8d8cc7dea9 With Branch: phd:baefc2a4...:draft With Scope: phd:baefc2a4...::local With Branch and Scope: phd:baefc2a4...:draft:local With Data Object ID: phd:baefc2a4.../3cf05e40... ```