Skip to main content

Development Setup

Prerequisites

  • Node.js >= 24 (see .nvmrc)
  • npm >= 11
  • Docker (for container builds and E2E tests)

Getting Started

git clone https://github.com/steilerDev/cornerstone.git
cd cornerstone
git submodule update --init # Initialize wiki submodule
npm install # Install all workspace dependencies
npm run dev # Start server (port 3000) + client dev server (port 5173)

In development, the Webpack dev server at http://localhost:5173 proxies /api/* requests to the Fastify server at http://localhost:3000.

Common Commands

CommandDescription
npm run devStart both server and client in watch mode
npm run dev:serverStart only the Fastify server
npm run dev:clientStart only the Webpack dev server
npm run buildBuild all packages (shared -> client -> server)
npm testRun all unit and integration tests
npm run lintLint all code
npm run formatFormat all code
npm run typecheckType-check all packages
npm run db:migrateRun pending database migrations
npm run docs:devStart the docs site dev server
npm run docs:buildBuild the docs site

Project Structure

Cornerstone is an npm workspaces monorepo:

cornerstone/
shared/ # @cornerstone/shared - TypeScript types
server/ # @cornerstone/server - Fastify REST API
client/ # @cornerstone/client - React SPA
e2e/ # @cornerstone/e2e - Playwright E2E tests
docs/ # @cornerstone/docs - This documentation site

Build order: shared -> client -> server. The docs and e2e workspaces are standalone.

Parallel Sessions (Worktrees)

Multiple development sessions can run in parallel using git worktrees. Each worktree gets its own directory with isolated node_modules/, database, and dev server ports.

See the CLAUDE.md file for detailed worktree setup instructions.

Docker Build

docker build -t cornerstone .
docker run -p 3000:3000 -v cornerstone-data:/app/data cornerstone

For more details, see the Docker Setup guide.