### Install Git on Ubuntu Source: https://github.com/boostercloud/booster/blob/main/website/docs/02_getting-started/installation.mdx Install the git-all package on Ubuntu using apt to get Git and related utilities. ```shell sudo apt install git-all ``` -------------------------------- ### Install Node.js on Ubuntu Source: https://github.com/boostercloud/booster/blob/main/website/docs/02_getting-started/installation.mdx Install Node.js on Ubuntu using curl to add the NodeSource repository and then apt to install Node.js. ```shell curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - sudo apt install nodejs ``` -------------------------------- ### Install Rush Source: https://github.com/boostercloud/booster/blob/main/CONTRIBUTING.md Install Rush globally using npm. This is a prerequisite for managing the monorepo. ```bash npm install -g @microsoft/rush ``` -------------------------------- ### Install Dependencies Source: https://github.com/boostercloud/booster/blob/main/website/README.md Installs project dependencies using npm. Run this command in the project root. ```bash npm i ``` -------------------------------- ### Start Local Development Server Source: https://github.com/boostercloud/booster/blob/main/website/README.md Starts a local development server for live previewing changes. The server opens automatically in a browser. ```bash npm run start ``` -------------------------------- ### Install Local Provider Dependencies Source: https://github.com/boostercloud/booster/blob/main/website/docs/10_going-deeper/rockets/rocket-file-uploads.md Installs the necessary packages for the local file upload provider. ```bash npm install --save @boostercloud/rocket-file-uploads-core @boostercloud/rocket-file-uploads-types npm install --save @boostercloud/rocket-file-uploads-local npm install --save-dev @boostercloud/rocket-file-uploads-local-infrastructure ``` -------------------------------- ### Verify Node.js and npm Installation Source: https://github.com/boostercloud/booster/blob/main/website/docs/02_getting-started/installation.mdx Check the installed versions of Node.js and npm to ensure they meet the minimum requirements for Booster. ```shell node -v npm -v ``` -------------------------------- ### Verify Booster CLI Installation Source: https://github.com/boostercloud/booster/blob/main/website/docs/02_getting-started/installation.mdx Check the installed version of the Booster CLI to confirm the installation was successful. ```shell boost version ``` -------------------------------- ### Install Azure Provider Dependencies Source: https://github.com/boostercloud/booster/blob/main/website/docs/10_going-deeper/rockets/rocket-file-uploads.md Install the necessary core, types, and Azure-specific packages for file uploads. Also, install the Azure infrastructure devDependency. ```bash npm install --save @boostercloud/rocket-file-uploads-core @boostercloud/rocket-file-uploads-types npm install --save @boostercloud/rocket-file-uploads-azure npm install --save-dev @boostercloud/rocket-file-uploads-azure-infrastructure ``` -------------------------------- ### Run Local Start Integration Tests Source: https://github.com/boostercloud/booster/blob/main/CONTRIBUTING.md Specifically tests the start functionality of the local development environment. This ensures the environment can be initialized properly. ```bash rushx integration/local-start -v ``` -------------------------------- ### Example: Sending a ChangeCart Command Source: https://github.com/boostercloud/booster/blob/main/website/docs/06_graphql.md This example demonstrates sending a 'ChangeCart' command with specific inputs for cart ID, SKU, and quantity. Ensure the URL is correctly set to your application's graphqlURL. ```text URL: "" ``` ```graphql mutation { ChangeCart(input: { cartId: "demo", sku: "ABC_01", quantity: 2 }) } ``` -------------------------------- ### Install Static Sites Rocket Source: https://github.com/boostercloud/booster/blob/main/website/docs/10_going-deeper/rockets/rocket-static-sites.md Install the rocket as a dev dependency using npm. This is necessary because the rocket is only used during deployment. ```bash npm install --save-dev @boostercloud/rocket-static-sites-aws-infrastructure ``` -------------------------------- ### Clone Repo and Install Dependencies Source: https://github.com/boostercloud/booster/blob/main/CONTRIBUTING.md Clone the Booster repository and install project dependencies using Rush. Ensure you replace the placeholder with the actual repository URL. ```bash git clone && cd booster rush update ``` -------------------------------- ### Install Backup Rocket Source: https://github.com/boostercloud/booster/blob/main/website/docs/10_going-deeper/rockets/rocket-backup-booster.md Install the Backup Rocket package as a dev dependency using npm. ```bash npm install --save-dev @boostercloud/rocket-backup-aws-infrastructure ``` -------------------------------- ### Skip Dependency Installation or Git Initialization Source: https://github.com/boostercloud/booster/blob/main/website/docs/02_getting-started/coding.mdx Use the `--skipInstall` flag to prevent automatic dependency installation after project creation. Use `--skipGit` to skip the initialization of a Git repository. ```shell boost new:project my-project --skipInstall --skipGit ``` -------------------------------- ### Install Git on macOS using Homebrew Source: https://github.com/boostercloud/booster/blob/main/website/docs/02_getting-started/installation.mdx Use Homebrew to install Git on macOS. This is the standard package manager for macOS. ```shell brew install git ``` -------------------------------- ### Install Node.js on Windows using Chocolatey Source: https://github.com/boostercloud/booster/blob/main/website/docs/02_getting-started/installation.mdx Use Chocolatey to install Node.js on Windows. Ensure you have PowerShell with administrator privileges. ```shell choco install nodejs ``` -------------------------------- ### Example GraphQL Query for CartReadModel Source: https://github.com/boostercloud/booster/blob/main/website/docs/06_graphql.md An example query to retrieve a 'CartReadModel' with ID 'demo', fetching its 'id' and 'items'. ```graphql query { CartReadModel(id: "demo") { id items } } ``` -------------------------------- ### Install Booster CLI Source: https://github.com/boostercloud/booster/blob/main/website/docs/02_getting-started/installation.mdx Install the Booster Command Line Interface globally using npm. This tool is essential for managing Booster projects. ```shell npm install --global @boostercloud/cli ``` -------------------------------- ### Start Application Locally on Custom Port Source: https://github.com/boostercloud/booster/blob/main/website/docs/02_getting-started/coding.mdx Runs your application locally and allows you to specify a custom port using the -p option. ```bash boost start -e local -p 8080 ``` -------------------------------- ### Install Git on Windows using Chocolatey Source: https://github.com/boostercloud/booster/blob/main/website/docs/02_getting-started/installation.mdx Use Chocolatey to install Git on Windows. This command requires administrative privileges in PowerShell. ```shell choco install git ``` -------------------------------- ### Start Application Locally with Booster Source: https://github.com/boostercloud/booster/blob/main/website/docs/02_getting-started/coding.mdx Runs your application locally using an Express.js server, exposing it on port 3000 by default. ```bash boost start -e local ``` -------------------------------- ### GraphQL Pagination Query Example Source: https://github.com/boostercloud/booster/blob/main/website/docs/06_graphql.md Example of a GraphQL query using pagination parameters 'limit' and 'afterCursor' for a read model. ```graphql query { ListProductReadModels ( limit: 1, afterCursor: { id: "last-page-item"} ) { id sku availability price } } ``` -------------------------------- ### Set up Azure Environment Variables Source: https://github.com/boostercloud/booster/blob/main/website/docs/10_going-deeper/infrastructure-providers.mdx A bash script to set up necessary environment variables for the Azure provider. Requires `jq` to be installed. Customize placeholders for service principal name, region, and throughput values. ```bash #!/usr/bin/env bash SP_DISPLAY_NAME="" #replace with the name of your own SP REGION="East US" #replace with a region of your choice, see full list here: https://azure.microsoft.com/en-us/global-infrastructure/locations/ AZURE_MAX_CONTAINER_THROUGHPUT=1000 #replace with a desired value for CosmosDB container throughput AZURE_MAX_DATABASE_THROUGHPUT=1000 #replace with a desired value for CosmosDB database throughput export AZURE_APP_ID=$(az ad sp list --display-name ${SP_DISPLAY_NAME} | jq -r '.[].appId') export AZURE_TENANT_ID=$(az ad sp list --display-name ${SP_DISPLAY_NAME} | jq -r '.[].appOwnerOrganizationId') export AZURE_SECRET=$(az ad sp credential reset --id ${AZURE_APP_ID} | jq -r '.password') export AZURE_SUBSCRIPTION_ID=$(az account show | jq -r '.id') export REGION=$REGION export AZURE_MAX_CONTAINER_THROUGHPUT=$AZURE_MAX_CONTAINER_THROUGHPUT export AZURE_MAX_DATABASE_THROUGHPUT=$AZURE_MAX_DATABASE_THROUGHPUT ``` -------------------------------- ### Local Provider Configuration Source: https://github.com/boostercloud/booster/blob/main/website/docs/10_going-deeper/rockets/rocket-file-uploads.md Instructions for setting up the local file upload provider, including package installation and Booster configuration. ```APIDOC ## Local Provider Setup ### Description Configures the local file upload provider for Booster Cloud. ### Installation Install needed dependency packages: ```bash npm install --save @boostercloud/rocket-file-uploads-core @boostercloud/rocket-file-uploads-types npm install --save @boostercloud/rocket-file-uploads-local ``` Also, you will need a devDependency in your project: ```bash npm install --save-dev @boostercloud/rocket-file-uploads-local-infrastructure ``` ### Booster Configuration In your Booster config file, configure your BoosterRocketFiles: ```typescript title="src/config/config.ts" import { Booster } from '@boostercloud/framework-core' import { BoosterConfig } from '@boostercloud/framework-types' import { BoosterRocketFiles } from '@boostercloud/rocket-file-uploads-core' import { RocketFilesUserConfiguration } from '@boostercloud/rocket-file-uploads-types' const rocketFilesConfigurationDefault: RocketFilesUserConfiguration = { storageName: 'STORAGE_NAME', containerName: 'CONTAINER_NAME', directories: ['DIRECTORY_1', 'DIRECTORY_2'], } const rocketFilesConfigurationCms: RocketFilesUserConfiguration = { storageName: 'cmsst', containerName: 'rocketfiles', directories: ['cms1', 'cms2'], } Booster.configure('local', (config: BoosterConfig): void => { config.appName = 'TEST_APP_NAME' config.providerPackage = '@boostercloud/framework-provider-local' config.rockets = [ new BoosterRocketFiles(config, [rocketFilesConfigurationDefault, rocketFilesConfigurationCms]).rocketForLocal(), ] }) ``` **Available parameters for `RocketFilesUserConfiguration`:** - **storageName**: Name of the storage repository. - **containerName**: Directories container. - **directories**: A list of folders where the files will be stored. --- The structure created will be: ```text ├── storageName │ ├── containerName │ │ ├── directory ``` **NOTE:** Local Provider will use `storageName` as the root folder name. ``` -------------------------------- ### Mocking Booster Configuration with Sinon Source: https://github.com/boostercloud/booster/blob/main/website/docs/10_going-deeper/testing.md This example demonstrates how to mock the `Booster.config` object using `sinon.replace` for testing purposes. It sets up empty read models and then asserts command handler behavior. ```typescript // Test import { replace } from 'sinon' const config = new BoosterConfig('test') config.appName = 'testing-time' config.providerPackage = '@boostercloud/framework-provider-aws' config.readModels['WoW'] = {} as ReadModelMetadata config.readModels['Amazing'] = {} as ReadModelMetadata replace(Booster, 'config', config) const spyMyCall = spy(MyCommand, 'myCall') const command = new MyCommand('1', true) const register = new Register('request-id-1') const registerSpy = spy(register, 'events') await MyCommand.handle(command, register) expect(spyMyCall).to.have.been.calledOnceWithExactly('WoW') expect(spyMyCall).to.have.been.calledOnceWithExactly('Amazing') expect(registerSpy).to.have.been.calledOnceWithExactly(new MyEvent('1', 'WoW')) expect(registerSpy).to.have.been.calledOnceWithExactly(new MyEvent('1', 'Amazing')) ``` ```typescript // Example code public static async handle(command: MyCommand, register: Register): Promise { const readModels = Booster.config.readModels for (const readModelName in readModels) { myCall(readModelName) register.events(new MyEvent(command.ID, readModelName)) } } ``` -------------------------------- ### Login to Azure CLI Source: https://github.com/boostercloud/booster/blob/main/website/docs/10_going-deeper/infrastructure-providers.mdx Logs you into your Azure account using the Azure CLI. Ensure you have the Azure CLI installed. ```bash az login ``` -------------------------------- ### Booster Configuration with Infrastructure Rocket Source: https://github.com/boostercloud/booster/blob/main/website/docs/10_going-deeper/rockets.mdx Example of how to configure an Infrastructure Rocket in the Booster application settings. This specifies the package name and any necessary parameters for the rocket. ```typescript Booster.configure('development', (config: BoosterConfig): void => { config.appName = 'my-store' config.providerPackage = '@boostercloud/framework-provider-aws' config.rockets = [ { packageName: 'rocket-your-rocket-name-aws-infrastructure', // Your infrastructure rocket package name parameters: { // A custom object with the parameters needed by your infrastructure rocket initializer hello: 'world', }, }, ] }) ``` -------------------------------- ### Comprehensive Global Error Handler Example Source: https://github.com/boostercloud/booster/blob/main/website/docs/03_features/05_error-handling.md This example demonstrates a comprehensive global error handler that addresses various error scenarios within a Booster application, including command, scheduled command, event dispatch, reducer, projection, and general errors. Each method can be customized to handle specific error types and contexts. ```typescript import { GlobalErrorHandler, CommandEnvelope, CommandMetadata, ScheduledCommandEnvelope, ScheduledCommandMetadata, EventEnvelope, EventInterface, NotificationInterface, ReducerMetadata, ProjectionMetadata, EntityInterface, EntitySnapshotEnvelope, ReadModelInterface } from "@boostercloud/framework-core" @GlobalErrorHandler() export class AppErrorHandler { public static async onCommandHandlerError( error: Error, commandEnvelope: CommandEnvelope, commandMetadata: CommandMetadata ): Promise { return error } public static async onScheduledCommandHandlerError( error: Error, scheduledCommandEnvelope: ScheduledCommandEnvelope, scheduledCommandMetadata: ScheduledCommandMetadata ): Promise { return error } public static async onDispatchEventHandlerError( error: Error, eventEnvelope: EventEnvelope | NotificationInterface, eventHandlerMetadata: unknown, eventInstance: EventInterface ): Promise { return error } public static async onReducerError( error: Error, eventEnvelope: EventEnvelope, reducerMetadata: ReducerMetadata, eventInstance: EventInterface, snapshotInstance: EntityInterface | null ): Promise { return error } public static async onProjectionError( error: Error, entityEnvelope: EntitySnapshotEnvelope, projectionMetadata: ProjectionMetadata, entity: EntityInterface, readModel: ReadModelInterface | undefined ): Promise { return error } public static async onEventError(error: Error, eventEnvelope: EventEnvelope): Promise { return error } public static async onError(error: Error | undefined): Promise { return error } } ``` -------------------------------- ### All Posts Response Source: https://github.com/boostercloud/booster/blob/main/website/docs/02_getting-started/coding.mdx Example response when querying all posts. It returns an array of post objects, each containing id, title, and author. ```json { "data": { "PostReadModels": [ { "id": "05670e55-fd31-490e-b585-3a0096db0412", "title": "Booster framework rocks", "author": "Another boosted developer" }, { "id": "95ddb544-4a60-439f-a0e4-c57e806f2f6e", "title": "Build a blog in 10 minutes with Booster", "author": "Boosted developer" } ] } } ``` -------------------------------- ### Install Infrastructure Rocket Dependencies (AWS) Source: https://github.com/boostercloud/booster/blob/main/website/docs/10_going-deeper/rockets.mdx Create a new package for your rocket and install the necessary dependencies for an AWS infrastructure rocket. This includes the provider-specific infrastructure package, framework types, TypeScript, and the AWS CDK. ```sh mkdir rocket-your-rocket-name-aws-infrastructure cd rocket-your-rocket-name-aws-infrastructure npm init ... npm install --save-dev @boostercloud/framework-provider-aws-infrastructure @boostercloud/framework-types typescript ``` ```sh npm install --save-dev @aws-cdk/core ``` -------------------------------- ### Install Reflect Metadata Source: https://github.com/boostercloud/booster/blob/main/packages/metadata-booster/README.md Add the official reflect-metadata module to your project's production dependencies. This is required for accessing metadata. ```shell npm install --save-prod "reflect-metadata" ``` -------------------------------- ### Custom TokenVerifier Implementation Source: https://github.com/boostercloud/booster/blob/main/website/docs/04_security/01_authentication.md Example of implementing a custom TokenVerifier. Replace placeholder logic with your specific verification and user envelope creation steps. ```typescript import { Booster, TokenVerifier } from '@boostercloud/framework-core' import { BoosterConfig, DecodedToken, TokenVerifier, UserEnvelope } from '@boostercloud/framework-types' class CustomTokenVerifier implements TokenVerifier { public async verify(token: string): Promise { // Your custom token verification logic here } public toUserEnvelope(decodedToken: DecodedToken): UserEnvelope { // Your custom logic to build a UserEnvelope from a decoded token here } } Booster.configure('production', (config: BoosterConfig): void => { config.appName = 'app-name' config.providerPackage = '@boostercloud/framework-provider-x' config.tokenVerifiers = [new CustomTokenVerifier()] }) ``` -------------------------------- ### Presigned Get Command Source: https://github.com/boostercloud/booster/blob/main/website/docs/10_going-deeper/rockets/rocket-file-uploads.md This command generates a presigned URL for downloading a file. Similar to presigned PUT, storageName is optional. Initialize FileHandler with Booster configuration and the storage name if needed. ```typescript import { Booster, Command } from '@boostercloud/framework-core' import { Register } from '@boostercloud/framework-types' import { FileHandler } from '@boostercloud/rocket-file-uploads-core' @Command({ authorize: 'all', }) export class FileUploadGet { public constructor(readonly directory: string, readonly fileName: string, readonly storageName?: string) {} public static async handle(command: FileUploadGet, register: Register): Promise { const boosterConfig = Booster.config const fileHandler = new FileHandler(boosterConfig, command.storageName) return await fileHandler.presignedGet(command.directory, command.fileName) } } ``` ```json mutation { FileUploadGet(input: { storageName: "clientst", directory: "client1", fileName: "myfile.txt" } ) } ``` ```json { "data": { "FileUploadGet": "http://localhost:3000/clientst/rocketfiles/client1/myfile.txt" } } ``` -------------------------------- ### Infrastructure Rocket Initializer Implementation Source: https://github.com/boostercloud/booster/blob/main/website/docs/10_going-deeper/rockets.mdx Example of an initializer function for an Infrastructure Rocket. It accepts custom parameters and returns an object conforming to the InfrastructureRocket interface. ```typescript import { InfrastructureRocket } from '@boostercloud/framework-provider-aws-infrastructure' import { YourMainClass } from './your-main-class'; export interface YourRocketParams { param1: string } const YourRocketInitializator = (params: YourRocketParams): InfrastructureRocket => ({ mountStack: SomePrivateObject.mountStack.bind(null, params), unmountStack: SomePrivateObject.unmountStack.bind(null, params), }) export default YourRocketInitializator ``` -------------------------------- ### Create Project with Default Parameters Source: https://github.com/boostercloud/booster/blob/main/website/docs/02_getting-started/coding.mdx To create a project with default settings, use the `--default` flag. This bypasses interactive prompts and uses predefined values for project name, provider, and metadata. ```shell boost new:project booster-blog --default ``` -------------------------------- ### Run Local Ongoing Integration Tests Source: https://github.com/boostercloud/booster/blob/main/CONTRIBUTING.md This script focuses on the start and stop functionalities of the local integration environment, ensuring these core processes work correctly. ```bash rushx integration/local-ongoing -v ``` -------------------------------- ### Recommended Command Directory Structure Source: https://github.com/boostercloud/booster/blob/main/website/docs/03_architecture/02_command.mdx Illustrates the recommended directory structure for placing Booster commands within a project. Placing commands in `/src/commands` helps in understanding the application's capabilities. ```text ├── src │ ├── commands <------ put them here │ ├── common │ ├── config │ ├── entities │ ├── events │ ├── index.ts │ └── read-models ``` -------------------------------- ### Create a New Booster Project Source: https://github.com/boostercloud/booster/blob/main/website/docs/02_getting-started/coding.mdx Use the `boost new:project` command to generate a new Booster project. Follow the prompts to select a cloud provider and configure your project. ```shell ? What's the package name of your provider infrastructure library? (Use arrow keys) @boostercloud/framework-provider-azure (Azure) ❯ @boostercloud/framework-provider-aws (AWS) - Deprecated Other ``` ```shell > boost new:project boosted-blog ... ℹ boost new 🚧 ✔ Creating project root ✔ Generating config files ✔ Installing dependencies ℹ Project generated! ``` -------------------------------- ### Configure package.json Scripts Source: https://github.com/boostercloud/booster/blob/main/packages/metadata-booster/README.md Add 'prepare' and 'build' scripts to your package.json. The 'prepare' script automatically patches TypeScript after dependency installation, and 'build' allows compiling your project with 'npm run build'. ```json ... "scripts": { "prepare": "ts-patch install -s", "build": "tsc -b tsconfig.json", "test": "..." } ... ``` -------------------------------- ### View Booster CLI Help Source: https://github.com/boostercloud/booster/blob/main/website/docs/05_booster-cli.mdx Run the `boost` command with the `--help` flag to display the help message and view available commands. ```bash boost --help ``` -------------------------------- ### Specify Project Parameters with Flags Source: https://github.com/boostercloud/booster/blob/main/website/docs/02_getting-started/coding.mdx Customize project creation by using flags like `--homepage`, `--author`, `--description`, `--license`, `--providerPackageName`, `--repository`, and `--version`. These flags allow direct input of parameter values. ```shell boost new:project boosted-blog --homepage="my-site.com" --author="Me" --description="My awesome blog" --license="MIT" --providerPackageName="@boostercloud/framework-provider-aws" --repository="git@github.com:me/repo.git" --version="1.0.0" ``` -------------------------------- ### Example GraphQL Response Source: https://github.com/boostercloud/booster/blob/main/website/docs/06_graphql.md This is an example of the JSON response received after a successful GraphQL query for a read model. ```json { "data": { "CartReadModel": { "id": "demo", "items": [ { "sku": "ABC_01", "quantity": 2 } ] } } } ``` -------------------------------- ### Conventional Commit Example Source: https://github.com/boostercloud/booster/blob/main/CONTRIBUTING.md An example of a commit message following the conventional commits standard, specifying a fix for the CLI. ```text fix(cli): Correct minor typos in code ``` -------------------------------- ### Install AWS File Uploads DevDependency Source: https://github.com/boostercloud/booster/blob/main/website/docs/10_going-deeper/rockets/rocket-file-uploads.md Install the AWS file uploads infrastructure devDependency, which is required for the AWS provider. ```bash npm install --save-dev @boostercloud/rocket-file-uploads-aws-infrastructure ``` -------------------------------- ### Build Project with Booster Source: https://github.com/boostercloud/booster/blob/main/website/docs/02_getting-started/coding.mdx Compiles your project code. This command is automatically run before deployment, so it's not strictly necessary to run it beforehand. ```bash boost build ``` -------------------------------- ### Install and Use Custom Rocket Decorator Source: https://github.com/boostercloud/booster/blob/main/website/docs/10_going-deeper/rockets.mdx Install your custom rocket package and use the decorator in your Booster application to mark classes. ```typescript // src/MySpecialClass.ts import { MyCustomDecorator, RocketSingleton } from 'my-booster-rocket'; @MyCustomDecorator() class MySpecialClass { // Application logic here } console.log(RocketSingleton.specialClasses) // [ [Function: MySpecialClass] ] ``` -------------------------------- ### Install Node.js on macOS using Homebrew Source: https://github.com/boostercloud/booster/blob/main/website/docs/02_getting-started/installation.mdx Use Homebrew to install Node.js on macOS. This is a common method for managing packages on macOS. ```shell brew install node ``` -------------------------------- ### Navigate to Project Directory Source: https://github.com/boostercloud/booster/blob/main/website/docs/02_getting-started/coding.mdx After the project is generated, change your current directory to the newly created project folder using the `cd` command. ```shell cd boosted-blog ``` -------------------------------- ### Run Integration Tests Source: https://github.com/boostercloud/booster/blob/main/CONTRIBUTING.md Prepare integration test dependencies and run the integration tests. This involves packing dependencies, changing directory, and executing the integration command. ```bash rush pack-integration-deps cd packages/framework-integration-tests rushx integration -v ``` -------------------------------- ### Health Status Response Example Source: https://github.com/boostercloud/booster/blob/main/website/docs/10_going-deeper/health/sensor-health.md This is an example of the JSON response structure for the health endpoint, showing the status, details, name, and ID of components and their children. ```json [ { "status": "UP", "details": { "urls": [ "dbs/my-store-app" ] }, "name": "Booster Database", "id": "booster/database", "components": [ { "status": "UP", "details": { "url": "dbs/my-store-app/colls/my-store-app-events-store", "count": 6 }, "name": "Booster Database Events", "id": "booster/database/events" }, { "status": "UP", "details": [ { "url": "dbs/my-store-app/colls/my-store-app-ProductReadModel", "count": 1 } ], "name": "Booster Database ReadModels", "id": "booster/database/readmodels" } ] } ] ``` -------------------------------- ### Publish Resource Templates Source: https://github.com/boostercloud/booster/blob/main/website/docs/10_going-deeper/custom-templates.mdx Run this command to publish the default resource templates to your project's `stubs` directory. This allows you to customize them. ```bash boost stub:publish ``` -------------------------------- ### Example Retry Log Messages Source: https://github.com/boostercloud/booster/blob/main/website/docs/10_going-deeper/retry-configuration.mdx Observe example log messages generated by the retry mechanism, indicating retry attempts, errors, and final outcomes. ```text [retryWithBackoff] Attempt 1 failed, retrying in 100ms... [retryWithBackoff] Error ValidationError is not retryable, failing immediately [retryWithBackoff] Failed after 3 attempts ``` -------------------------------- ### Create source directory for decorator code Source: https://github.com/boostercloud/booster/blob/main/website/docs/10_going-deeper/rockets.mdx Set up the 'src' directory to organize your rocket's decorator and singleton code. ```sh mkdir src ``` -------------------------------- ### Run Unit Tests for Local Infrastructure Package Source: https://github.com/boostercloud/booster/blob/main/website/docs/12_contributing.md Execute unit tests specifically for the 'framework-provider-local-infrastructure' package. The '-v' flag enables verbose output. ```bash rushx test:provider-local-infrastructure -v ``` -------------------------------- ### Install AWS File Uploads Dependencies Source: https://github.com/boostercloud/booster/blob/main/website/docs/10_going-deeper/rockets/rocket-file-uploads.md Install the necessary npm packages for the AWS file uploads rocket. This includes core, types, and the AWS provider package. ```bash npm install --save @boostercloud/rocket-file-uploads-core @boostercloud/rocket-file-uploads-types npm install --save @boostercloud/rocket-file-uploads-aws ``` -------------------------------- ### Deploy Application to Cloud with Booster Source: https://github.com/boostercloud/booster/blob/main/website/docs/02_getting-started/coding.mdx Deploys your application to the cloud for a specified environment. Booster automatically handles resource creation and updates. ```bash boost deploy -e production ``` -------------------------------- ### Filter and Get Product Count Source: https://github.com/boostercloud/booster/blob/main/website/docs/06_graphql.md Use `Booster.readModel` to filter read models by specified criteria and get the total count. This is useful for aggregating data based on dynamic filters. ```typescript import { Command } from "@boostercloud/framework-core" import { ProductReadModel } from "../read-models/product-read-model" @Command({ authorize: 'all', }) export class GetProductsCount { public constructor(readonly filters: Record) {} public static async handle(): Promise { const searcher = Booster.readModel(ProductReadModel) searcher.filter({ sku: { contains: 'toy' }, or: [ { description: { contains: 'fancy' }, }, { description: { contains: 'great' }, }, ], }) const result = await searcher.search() return { count: result.length } } } ``` -------------------------------- ### Execute Booster Components with CLI Flag Source: https://github.com/boostercloud/booster/blob/main/website/proposals/0007-components/index.mdx This command demonstrates how to execute specific Booster components using the `--exec` flag. It allows specifying the run-time for component execution. ```bash pnpm boost event:generate --name AccountCreated --fields 'amount:number' ``` -------------------------------- ### GraphQL Response for DeleteFile Source: https://github.com/boostercloud/booster/blob/main/website/docs/10_going-deeper/rockets/rocket-file-uploads.md Example JSON response after a successful DeleteFile mutation. ```json { "data": { "DeleteFile": true } } ``` -------------------------------- ### GraphQL Mutation for DeleteFile Source: https://github.com/boostercloud/booster/blob/main/website/docs/10_going-deeper/rockets/rocket-file-uploads.md Example GraphQL mutation to trigger the DeleteFile command. ```graphql mutation { DeleteFile(input: { storageName: "clientst", directory: "client1", fileName: "myfile.txt" } ) } ``` -------------------------------- ### Run Unit Tests Source: https://github.com/boostercloud/booster/blob/main/CONTRIBUTING.md Execute all unit tests for the project using the 'rush test' command. For package-specific tests, navigate to the package directory and run 'rushx test'. ```bash rush test ``` -------------------------------- ### Add TypeScript as a development dependency Source: https://github.com/boostercloud/booster/blob/main/website/docs/10_going-deeper/rockets.mdx Install TypeScript as a dev dependency for your Booster rocket package. ```sh npm install typescript --save-dev ``` -------------------------------- ### Demo Webhook Request Source: https://github.com/boostercloud/booster/blob/main/website/docs/10_going-deeper/rockets/rocket-webhook.md Example `curl` command to send a POST request to a local webhook endpoint. ```bash curl --request POST 'http://localhost:3000/webhook/command?param1=testvalue' ``` -------------------------------- ### Compile Project Source: https://github.com/boostercloud/booster/blob/main/CONTRIBUTING.md Compile the entire Booster project using the Rush build command. This ensures all packages are built correctly. ```bash rush build ``` -------------------------------- ### Install Metadata Booster and TS Patch Source: https://github.com/boostercloud/booster/blob/main/packages/metadata-booster/README.md Add the metadata-booster transformer and ts-patch to your project's development dependencies. ```shell npm install --save-dev "@boostercloud/metadata-booster" npm install --save-dev "ts-patch" ``` -------------------------------- ### Deploy to a Specific Environment using CLI Source: https://github.com/boostercloud/booster/blob/main/website/docs/10_going-deeper/environment-configuration.mdx Use the Booster CLI to deploy your application to a specified environment. The `-e` flag followed by the environment name is required. ```sh boost deploy -e prod ``` -------------------------------- ### Specific Post Response Source: https://github.com/boostercloud/booster/blob/main/website/docs/02_getting-started/coding.mdx Example response for retrieving a specific post by ID. It returns the details of the requested post. ```json { "data": { "PostReadModel": { "id": "95ddb544-4a60-439f-a0e4-c57e806f2f6e", "title": "Build a blog in 10 minutes with Booster", "author": "Boosted developer" } } } ``` -------------------------------- ### Run AWS Deployment Integration Tests Source: https://github.com/boostercloud/booster/blob/main/CONTRIBUTING.md Tests the deployment process of a sample project to AWS. This verifies that applications can be successfully provisioned in the AWS environment. ```bash rushx integration/aws-deploy -v ``` -------------------------------- ### Build Static Website Source: https://github.com/boostercloud/booster/blob/main/website/README.md Generates the static content for the website into the 'build' directory. This output can be hosted on any static hosting service. ```bash npm run build ``` -------------------------------- ### Initialize BoosterWebhook with Handlers Source: https://github.com/boostercloud/booster/blob/main/website/docs/10_going-deeper/rockets/rocket-webhook.md Define the `buildBoosterWebhook` function to initialize the `BoosterWebhook` with specific webhook origins and their corresponding handler classes. ```typescript function buildBoosterWebhook(config: BoosterConfig): BoosterWebhook { return new BoosterWebhook(config, [ { origin: 'test', handlerClass: TestHandler, }, { origin: 'other', handlerClass: FacebookHandler, }, ]) } ``` -------------------------------- ### Webhook Handler Return Type Example Source: https://github.com/boostercloud/booster/blob/main/website/docs/10_going-deeper/rockets/rocket-webhook.md Demonstrates returning a `WebhookHandlerReturnType` object with a body and custom headers from a webhook handler. ```typescript public static async handle(webhookEventInterface: WebhookEvent, register: Register): Promise { return Promise.resolve({ body: 'ok', headers: { Test: 'test header', }, }) } ``` -------------------------------- ### Initialize Terraform Source: https://github.com/boostercloud/booster/blob/main/website/docs/10_going-deeper/infrastructure-providers.mdx Initialize Terraform in the stack directory. This command only needs to be run once. ```shell > terraform init ``` -------------------------------- ### Send GraphQL Subscription Operation Source: https://github.com/boostercloud/booster/blob/main/website/docs/06_graphql.md Send a `start` message with the subscription query. The `id` field is used to correlate messages. ```json { "id": "1", "type": "start", "payload": { "query": "subscription { CartReadModel(id:\"demo\") { id items } }" } } ``` -------------------------------- ### Run Integration Tests Locally with Rush Source: https://github.com/boostercloud/booster/blob/main/CONTRIBUTING.md Before submitting a Pull Request, it is recommended to run integration tests locally. Use the `rushx` command with the appropriate script name and the `-v` flag for verbose output. ```bash rushx