Getting Started
This document is a mirror of the Rhapsody README.
Prerequisites
Install the correct versions of Node.js and PNPM using asdf:
asdf install
Install
Install client and server dependencies:
pnpm install
Developing
During development, you can run Rhapsody against a QA environment or locally-running backend services.
Run Against a QA Environment (Preferred)
How does this work?
When you run Rhapsody against a QA environment, URLs for the backend services Rhapsody communicates with are pointed to those running in the specified environment. We accomplish this by first pulling configs from the appropriate Kubernetes cluster and replacing the environment variables for backend services in deploy/manifests/dev/dev.env with the values pulled from Kubernetes.
If you haven't done so already, set up your machine using the dev-o-nomicon task:
task initVerify the networking stack is running:
task net:upStart Rhapsody using one of the QA environments:
pnpm qa NUMBER
# pnpm qa 5Navigate to http://localhost.qasalesloft.com.
Run Against Local Backend Services
Assuming all necessary backend services are running locally, use the following command to run Rhapsody against local services:
pnpm local
Environment Variables
Many global values in Rhapsody, e.g. URLs to backend services, are driven by environment variables. This allows us to reconfigure those values easily. Environment variables required for local development are stored in deploy/manifests/dev/dev.env. In the rare event you need to override these values, you can use a .env file. Copy .env.sample to use as a base to add environment variable overrides.
cp .env.sample .env
When running against QA, environment variables are pulled directly from Kubernetes.
Testing
We use Jest to run our React test suite. Use the following commands to run tests:
pnpm test # Normal mode
pnpm test --watch # Watch mode
Tip: When running an NPM script, the -- separator lets you pass options directly to the underlying process. For reasons, we need to do so twice.
Linting
If your editor has Biome and ESLint integrations, it can be configured to use the repo settings. We have a CLI tool that can automatically set up VS Code. Other IDEs/editors will need to be configured manually.
pnpm setup-ide:vscode
Use the following commands to run our linters via the command line:
pnpm biome check
pnpm lint
Codemods
Codemods are available to assist in changing certain code patterns. Use the following commands to run codemods:
pnpm codemod # CLI usage
pnpm codemod CODEMOD PATH/TO/FILE # Apply CODEMOD to FILE