Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 99 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,24 +86,118 @@ For self-hosted options, see our [installation guide](https://docs.ctrlplane.dev

## 🛠️ Contributing

### Local Setup
We welcome contributions! This section covers everything you need to get the project running locally and start contributing.

#### Prereqs
### Prerequisites

- Docker engine installed and running
- [Flox](https://flox.dev/docs/install-flox/install/) installed
- [Docker](https://docs.docker.com/get-docker/) engine installed and running
- [Flox](https://flox.dev/docs/install-flox/install/) installed (manages Node.js, pnpm, Go, and other tooling)
- [pnpm](https://pnpm.io/installation) (if not using Flox)
- [Go 1.22+](https://go.dev/dl/) (only needed if working on `workspace-engine` or `relay`)
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Go version requirement here looks out of date. apps/workspace-engine/go.mod specifies go 1.25.7 and apps/relay/go.mod specifies go 1.25.4, so Go 1.22+ will not be sufficient for contributors working on these apps. Please update the prerequisite to match the repository’s current minimum Go version (likely 1.25+).

Suggested change
- [Go 1.22+](https://go.dev/dl/) (only needed if working on `workspace-engine` or `relay`)
- [Go 1.25+](https://go.dev/dl/) (only needed if working on `workspace-engine` or `relay`)

Copilot uses AI. Check for mistakes.

### First-Time Setup

```bash
git clone https://github.com/ctrlplanedev/ctrlplane.git
cd ctrlplane

# Activate the Flox environment (installs all required tooling)
flox activate

# Start local services (PostgreSQL, etc.)
docker compose -f docker-compose.dev.yaml up -d

# Install dependencies and build all packages
pnpm i && pnpm build
cd packages/db && pnpm migrate && cd ../..

# Apply database migrations
pnpm -F @ctrlplane/db migrate

# Start all dev servers
pnpm dev
```

> **Reset everything** (wipe volumes and start fresh):
> ```bash
> docker compose -f docker-compose.dev.yaml down -v
> docker compose -f docker-compose.dev.yaml up -d
> pnpm -F @ctrlplane/db migrate
> pnpm dev
> ```

### Day-to-Day Development

| Command | Description |
|---|---|
| `pnpm dev` | Start all dev servers |
| `pnpm build` | Build all packages |
| `pnpm test` | Run all TypeScript tests |
| `pnpm lint` | Lint all TypeScript code |
| `pnpm format:fix` | Auto-format all TypeScript code |
| `pnpm typecheck` | TypeScript type check across all packages |
| `pnpm -F <package> test` | Run tests for a specific package |
| `pnpm -F <package> test -- -t "test name"` | Run a specific test by name |

### Database

```bash
pnpm -F @ctrlplane/db migrate # Run migrations
pnpm -F @ctrlplane/db push # Apply schema changes without a migration file (dev only)
pnpm -F @ctrlplane/db studio # Open Drizzle Studio UI
```

### E2E Tests (Playwright)

```bash
cd e2e
pnpm exec playwright test # Run all e2e tests
pnpm exec playwright test tests/api/resources.spec.ts # Run a specific file
pnpm test:api # Run all API tests
pnpm test:debug # Run in debug mode
```

### workspace-engine (Go)

```bash
cd apps/workspace-engine
go run ./... # Run without building
go build -o ./bin/workspace-engine . # Build binary
go test ./... # Run tests
Comment on lines +161 to +165
Copy link

Copilot AI Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

go run ./... will fail in this module because ./... expands to multiple packages including more than one package main (e.g., . and tools/seed). Use a single main package target (for example go run .) so the command works as written.

Copilot uses AI. Check for mistakes.
golangci-lint run # Lint
go fmt ./... # Format
```

### Monorepo Structure

```text
apps/
api/ # Node.js/Express REST API — core business logic
web/ # React 19 + React Router frontend
workspace-engine/ # Go reconciliation engine
relay/ # Go WebSocket relay for agent communication
packages/
db/ # Drizzle ORM schema + migrations (PostgreSQL)
trpc/ # tRPC server setup
auth/ # Authentication integration
integrations/ # External service adapters
e2e/ # Playwright end-to-end tests
```

### Code Style

- **TypeScript**: explicit types, `interface` for public APIs, `async/await`, named imports
- **React**: functional components only, typed as `const Foo: React.FC<Props> = () => {}`
- **Tests**: vitest with typed fixtures
- **Go**: follow `apps/workspace-engine/CLAUDE.md` guidelines
- Run `pnpm lint` and `pnpm format:fix` before submitting a PR

### Opening a Pull Request

1. Fork the repo and create a branch from `main`
2. Make your changes, add tests where applicable
3. Run `pnpm test`, `pnpm lint`, and `pnpm typecheck` to verify everything passes
4. Open a PR against `main` with a clear description of what changed and why

## :heart: Community

- [GitHub Discussions](https://github.com/ctrlplanedev/ctrlplane/discussions)
Expand Down
Loading