The following packages are required before running make install_dev_tools:
# Build essentials and core development tools
sudo apt-get install -y build-essential pkg-config
# ICU support (required for PostgreSQL build)
sudo apt-get install -y libicu-dev
# UUID support
sudo apt-get install -y uuid-dev
# Python development libraries
sudo apt-get install -y libbz2-dev libsqlite3-dev tk-dev liblzma-dev
# WeasyPrint dependencies (required by the backend PDF generation)
sudo apt-get install -y libpango-1.0-0 libpangocairo-1.0-0 libcairo2mise installs the tool versions pinned in .tool-versions (repo root: Node.js, Python, gcloud; bc_obps: Python, Poetry, PostgreSQL).
curl https://mise.run | shWe use mise in shims mode, so terminals, make, IDEs and git hooks all resolve the same tools. Add this to ~/.profile (zsh: ~/.zprofile with zsh instead of bash):
eval "$(~/.local/bin/mise activate bash --shims)"Then log out and back in (or open a new login shell) and run mise doctor. It should report shims_on_path: yes and no problems.
With shims, mise env vars (like
PGDATAfrombc_obps/mise.toml) are applied to the tool commands themselves (pg_ctl,psql, …), not exported to your shell, soecho $PGDATAprints nothing. Usemise envto see them.
-
Ensure you have push access (most likely by being added to the @bcgov/cas-developers GitHub team) to bcgov/cas-registration.
-
Ensure you have GPG commit signing set up on your local environment. See gpg-ssh-setup-guide.md for step-by-step instructions.
- Ensure your
git config user.emailmatches the email used when generating the GPG key. - Verify signing works by running
git log --show-signatureafter a commit. Once pushed, a "Verified" badge appears next to your commits on GitHub.
- Ensure your
-
Clone a local copy of bcgov/cas-registration.
In bc_obps directory, create a bc_obps/.env file from the bc_obps/.env.example file. See the 1Password Clean Growth Digital Services Team vault for the bc_obps/.env values in document OBPS backend ENV.
In bciers directory, create a bciers/.env file from the bciers/.env.example file. See the 1Password Clean Growth Digital Services Team vault for the bciers/.env values in document OBPS FE env.
In bciers directory, create a bciers/.env.local file from the bciers/.env.local.example file. See the 1Password Clean Growth Digital Services Team vault for the bciers/.env.local values in document OBPS FE env.local.
-
From the terminal, cd into directory
cas-registration/bc_obps. -
Run
mise trust(one time) so mise loadsbc_obps/mise.toml, which setsPGDATAtobc_obps/.pgdata(gitignored). -
Run
make install_dev_tools. This installs Python, Poetry and PostgreSQL via mise, creates the local postgres cluster inbc_obps/.pgdataif it doesn't exist yet, and starts the postgres server. -
Run
make install_poetry_depsto install all Python dependencies. OPTIONAL: To activate the virtual environment, runeval $(poetry env activate). To exit rundeactivate. -
Set a password for your database user.
make install_dev_toolsmakes your shell user (whoami) the postgres superuser: over the local socket only your OS user can connect, with no password, but Django connects over TCP, which requires one. SetDB_USERin your.envto your shell user (lowercase — role names are case-sensitive) and use yourDB_PASSWORDvalue here:psql -d postgres -c "\password" -
Run
make start_pgto start the postgres server if it is not already running, thenmake create_dbto create the database. -
Run
make migrateto run all database migrations. -
Run
make runto start the development server (default port :8000). Navigate to/api/docsin your browser to verify.
If you see an error about port 5432 being in use, you may need to stop the system PostgreSQL:
sudo systemctl stop postgresqlThen restart PostgreSQL:
make start_pgpassword authentication failed for user "<your_db_user>": the role's password doesn't matchDB_PASSWORDin your.env. Set it again withpsql -d postgres -c "\password"(frombc_obps).role "<your_db_user>" does not exist:DB_USERin your.envisn't your shell user (only your shell user exists in a new cluster). Either setDB_USERtowhoami, or create the role withpsql -d postgres -c "CREATE USER <your_db_user> WITH SUPERUSER PASSWORD '<your DB_PASSWORD>';".- Cluster created before local auth was locked down (
bc_obps/.pgdata/pg_hba.confusestrust): recreate it withmake stop_pg && rm -rf .pgdata && make install_dev_tools, then continue from step 5. This deletes your local data.
If postgres commands fail with no database directory specified and environment variable PGDATA unset, run mise trust in bc_obps and run the command from inside bc_obps (mise env | grep PGDATA should print the path).
This project uses Poetry, managed by mise.
You can activate the virtual environment in two ways:
-
Using Poetry (recommended):
eval $(poetry env activate)
Note: Poetry 2.0+ removed the
shellcommand.poetry env activatenow prints the activation script rather than spawning a shell — useeval $(poetry env activate)to activate it. Alternatively, prefix individual commands withpoetry run:poetry run python manage.py [command]
-
Direct activation (alternative):
source $(poetry env info --path)/bin/activate
- Start PostgreSQL:
make start_pg- Stop PostgreSQL:
make stop_pgYou can verify your installation by checking the versions of installed components:
# Check Python version
python --version
# Check Poetry version
poetry --version
# Check PostgreSQL version
psql --versionAfter system restart, you'll need to:
-
Start PostgreSQL: Either run
make start_pgfrom inside the cas-registration/bc_obps directory ormake -C bc_obps start_pgfrom the root (cas-registration/) directory -
Activate the virtual environment:
# Using Poetry eval $(poetry env activate) # Or alternatively, activate directly: source $(poetry env info --path)/bin/activate
-
From inside the
cas-registration/bc_obpsdirectory, runmake run. This will start running the backend development server locally (default port is :8000; terminal output will indicate what localhost address to use to access the backend server). To test it out, navigate to the /api/docs endpoint in your browser
-
After completing the Frontend Development Setup (if not done yet, see below), open a new terminal window and navigate to the bciers directory:
cd bciers -
Start all frontend applications:
yarn dev-all
-
Open your browser in incognito mode and navigate to:
http://localhost:3000/onboarding -
Click the "Log in with Business BCeID" button
-
On the login page, enter your username and password, then click the Continue button
-
On the next page, select "Compliance" or another available option to proceed with the application
This guide will help you set up the frontend development environment for the CAS Registration project.
-
Node.js
- Version: as specified in
.tool-versionsat the repo root - Required for running the JavaScript/TypeScript codebase
- Version: as specified in
-
Package Manager
- Yarn (Modern version using
.yarnrc.yml) - Used for managing project dependencies
- Yarn (Modern version using
-
Version Manager
- mise (recommended), or a manual install of the versions in
.tool-versions - Helps manage tool versions consistently across the team
- mise (recommended), or a manual install of the versions in
- Linux/Unix-based system or WSL for Windows users
- Git (for version control)
- Docker and Docker Compose (for containerized development)
-
Install
mise(if not already installed — see Prerequisites above for setup) -
Install Node.js
From the repo root, mise picks up the version from
.tool-versions:mise install
-
Install Node.js
- Using nvm:
Look at the supported development version of node in
.tool-versionsnvm install <Node version> nvm use <Node version>
- Or download directly from Node.js website
- Using nvm:
Look at the supported development version of node in
-
Install Yarn
corepack enable mise reshim # creates the yarn shim
-
Clone the repository (if not already done)
git clone https://github.com/bcgov/cas-registration.git cd cas-registration/bciers -
Install dependencies
yarn install
-
Set up environment variables
cp .env.local.example .env.local
Edit
.env.localwith your local configuration values (see 1Password vaultOBPS FE env.local)
The frontend is organized as a monorepo using Nx, containing multiple applications and shared libraries.
| Application | Path | Description |
|---|---|---|
dashboard |
/bciers/apps/dashboard |
Dashboard application |
registration |
/bciers/apps/registration |
Registration application |
reporting |
/bciers/apps/reporting |
Reporting application |
administration |
/bciers/apps/administration |
Administration interface |
coam |
/bciers/apps/coam |
COAM application |
Located in /bciers/libs/shared/:
| Library | Path | Purpose |
|---|---|---|
actions |
shared/actions |
Shared actions and state management |
components |
shared/components |
Reusable UI components |
img |
shared/img |
Shared images and assets |
proxies |
shared/proxies |
Common proxy functions |
styles |
shared/styles |
Shared styling and themes |
testConfig |
shared/testConfig |
Testing configurations and utilities |
types |
shared/types |
Shared TypeScript types and interfaces |
To run any of these applications, use the project name in the nx commands:
# Examples
yarn nx run dashboard:dev # Run dashboard in development mode
yarn nx run registration:dev # Run registration in development mode
yarn nx run reporting:dev # Run reporting in development mode
yarn nx run administration:dev # Run administration in development mode
yarn nx run coam:dev # Run COAM in development modeThe shared libraries are automatically available to all applications in the monorepo. When making changes to shared libraries, all dependent applications will be automatically rebuilt.
-
Start the administration app
yarn admin
This will start the app on port 4001
-
Start the COAM app
yarn coam
This will start the app on port 7000
-
Run unit tests
yarn admin:test # For administration app tests yarn coam:test # For COAM app tests yarn components:test # For shared components tests yarn utils:test # For utilities tests
-
Run E2E tests
yarn admin:e2e # For administration app E2E tests yarn coam:e2e # For COAM app E2E tests
-
Run E2E tests with UI
yarn admin:e2e:ui # For administration app E2E tests with UI yarn coam:e2e:ui # For COAM app E2E tests with UI
-
Build the administration app
yarn admin:build
-
Build the COAM app
yarn coam:build
- Node.js (version in
.tool-versions) - Yarn (via Node's Corepack)
- Nx CLI (installed via project dependencies)
The project uses Nx as a build system. You can run commands in two ways:
- Using project dependencies (recommended):
yarn nx run {project}:{target} - Using direct nx commands (if installed globally):
nx {target} {project}
| Command Purpose | Command to Run |
|---|---|
| Development server | yarn nx run {project}:dev |
| Build project | yarn nx run {project}:build |
| Start production server | yarn nx run {project}:start |
| Run tests | yarn nx run {project}:test |
| Run E2E tests | yarn nx run {project}:e2e |
| Run E2E tests with UI | yarn nx run {project}:e2e:ui |
| Format code check | yarn nx format:check |
| Format code write | yarn nx format:write |
For the administration app:
yarn nx run administration:dev # Start development server
yarn nx run administration:build # Build the app
yarn nx run administration:test # Run testsFor the COAM app:
yarn nx run coam:dev # Start development server
yarn nx run coam:build # Build the app
yarn nx run coam:test # Run tests-
Run multiple projects in parallel:
yarn nx run-many --target=test
-
Format specific projects:
yarn nx format:check --projects project1,project2 yarn nx format:write --projects project1,project2
-
Node.js version mismatch
- Verify your Node.js version:
node --version
- Should match the
nodejsversion in.tool-versions(check withmise ls node)
- Verify your Node.js version:
-
Yarn issues
- Clear yarn cache:
yarn cache clean
- Remove node_modules and reinstall:
rm -rf node_modules yarn install
- Clear yarn cache:
-
Port conflicts
- Check if ports 4001 or 7000 are already in use:
lsof -i :4001 lsof -i :7000
- Check if ports 4001 or 7000 are already in use:
prek runs formatting and lint checks required for PRs to pass CI.
From the repo root, install prek and register the git hooks:
mise install # installs prek (pinned in .tool-versions)
prek install # registers the pre-commit hook
prek install --hook-type commit-msg # also enables commit message lintingAlternatively, run all hooks manually without installing:
prek run --all-filesThis project follows Conventional Commits. Common types: feat, fix, test, docs, chore, refactor. See .gitlint for configuration details.
Branch names follow the same convention, e.g. docs/#123-add-readme or feat/#456-some-feature.
Last updated: June 19, 2026