Skip to main content

Dev Environment Setup

This page covers what you need on your machine to develop CDT itself. If you only want to use CDT or self-host it, see the user Installation guide instead.

Toolchain

ToolVersionNotes
Node.js18.0+ (LTS)Use nvm for easy version management
Yarn1.x classicThe repo's lockfile is yarn.lock
Gitany recentRequired to clone and push branches
Docker Desktop or Engine + Compose24.0+Runs PostgreSQL, MinIO, Martin
VS CodelatestRecommended editor — repo has shared settings

For the full prerequisite versions and platform notes, see Installation.

Initial setup

git clone https://github.com/CollabDigitalTwins/core.git
cd core
yarn install
cp .env.example .env

Open .env and fill in at least the required keys — see the Environment variables reference.

Local services

The fastest path is to run PostgreSQL, MinIO, and Martin with Docker Compose:

docker compose up -d postgres minio martin
npx prisma migrate dev # apply schema to a fresh database
yarn dev

The application is available at http://localhost:3000.

The repository ships a .vscode/extensions.json with the extensions the team relies on:

  • ESLint — surfaces lint errors as you type
  • Prettier — autoformat on save
  • Prisma — schema syntax and autocomplete
  • Tailwind CSS IntelliSense — class name completion
  • GitLens — inline blame and history

Open the Command Palette → Show Recommended Extensions to install them in one click.

Editor configuration

The repo includes .editorconfig, .prettierrc, and eslint.config.mjs. Enable format on save so your changes always match the project style. If you need to format from the command line:

yarn lint        # ESLint
yarn format # Prettier

Useful commands

CommandWhat it does
yarn devRun the dev server with Turbopack (hot reload)
yarn buildProduction build — useful before opening a PR
yarn lintRun ESLint over the codebase
yarn testRun the unit and integration test suites
npx prisma studioBrowse and edit database records in a local UI
npx prisma migrate devApply pending migrations to your local database
docker compose logs -f cdtTail logs from the application container

Running the test suite

CDT uses Vitest for unit tests and Playwright for end-to-end. Both run via:

yarn test          # all tests
yarn test:unit # unit only
yarn test:e2e # Playwright

Playwright requires browsers to be installed once with npx playwright install.

Troubleshooting setup

For common installation failures (port conflicts, Prisma errors, missing modules), see the Troubleshooting page.