Skip to content

Commit 155c921

Browse files
docs: enhance contributing section in README (#952)
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Aditya Choudhari <adityachoudhari26@users.noreply.github.com>
1 parent 0082cce commit 155c921

1 file changed

Lines changed: 99 additions & 5 deletions

File tree

README.md

Lines changed: 99 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,24 +86,118 @@ For self-hosted options, see our [installation guide](https://docs.ctrlplane.dev
8686

8787
## 🛠️ Contributing
8888

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

91-
#### Prereqs
91+
### Prerequisites
9292

93-
- Docker engine installed and running
94-
- [Flox](https://flox.dev/docs/install-flox/install/) installed
93+
- [Docker](https://docs.docker.com/get-docker/) engine installed and running
94+
- [Flox](https://flox.dev/docs/install-flox/install/) installed (manages Node.js, pnpm, Go, and other tooling)
95+
- [pnpm](https://pnpm.io/installation) (if not using Flox)
96+
- [Go 1.22+](https://go.dev/dl/) (only needed if working on `workspace-engine` or `relay`)
97+
98+
### First-Time Setup
9599

96100
```bash
97101
git clone https://github.com/ctrlplanedev/ctrlplane.git
98102
cd ctrlplane
99103

104+
# Activate the Flox environment (installs all required tooling)
100105
flox activate
106+
107+
# Start local services (PostgreSQL, etc.)
101108
docker compose -f docker-compose.dev.yaml up -d
109+
110+
# Install dependencies and build all packages
102111
pnpm i && pnpm build
103-
cd packages/db && pnpm migrate && cd ../..
112+
113+
# Apply database migrations
114+
pnpm -F @ctrlplane/db migrate
115+
116+
# Start all dev servers
104117
pnpm dev
105118
```
106119

120+
> **Reset everything** (wipe volumes and start fresh):
121+
> ```bash
122+
> docker compose -f docker-compose.dev.yaml down -v
123+
> docker compose -f docker-compose.dev.yaml up -d
124+
> pnpm -F @ctrlplane/db migrate
125+
> pnpm dev
126+
> ```
127+
128+
### Day-to-Day Development
129+
130+
| Command | Description |
131+
|---|---|
132+
| `pnpm dev` | Start all dev servers |
133+
| `pnpm build` | Build all packages |
134+
| `pnpm test` | Run all TypeScript tests |
135+
| `pnpm lint` | Lint all TypeScript code |
136+
| `pnpm format:fix` | Auto-format all TypeScript code |
137+
| `pnpm typecheck` | TypeScript type check across all packages |
138+
| `pnpm -F <package> test` | Run tests for a specific package |
139+
| `pnpm -F <package> test -- -t "test name"` | Run a specific test by name |
140+
141+
### Database
142+
143+
```bash
144+
pnpm -F @ctrlplane/db migrate # Run migrations
145+
pnpm -F @ctrlplane/db push # Apply schema changes without a migration file (dev only)
146+
pnpm -F @ctrlplane/db studio # Open Drizzle Studio UI
147+
```
148+
149+
### E2E Tests (Playwright)
150+
151+
```bash
152+
cd e2e
153+
pnpm exec playwright test # Run all e2e tests
154+
pnpm exec playwright test tests/api/resources.spec.ts # Run a specific file
155+
pnpm test:api # Run all API tests
156+
pnpm test:debug # Run in debug mode
157+
```
158+
159+
### workspace-engine (Go)
160+
161+
```bash
162+
cd apps/workspace-engine
163+
go run ./... # Run without building
164+
go build -o ./bin/workspace-engine . # Build binary
165+
go test ./... # Run tests
166+
golangci-lint run # Lint
167+
go fmt ./... # Format
168+
```
169+
170+
### Monorepo Structure
171+
172+
```text
173+
apps/
174+
api/ # Node.js/Express REST API — core business logic
175+
web/ # React 19 + React Router frontend
176+
workspace-engine/ # Go reconciliation engine
177+
relay/ # Go WebSocket relay for agent communication
178+
packages/
179+
db/ # Drizzle ORM schema + migrations (PostgreSQL)
180+
trpc/ # tRPC server setup
181+
auth/ # Authentication integration
182+
integrations/ # External service adapters
183+
e2e/ # Playwright end-to-end tests
184+
```
185+
186+
### Code Style
187+
188+
- **TypeScript**: explicit types, `interface` for public APIs, `async/await`, named imports
189+
- **React**: functional components only, typed as `const Foo: React.FC<Props> = () => {}`
190+
- **Tests**: vitest with typed fixtures
191+
- **Go**: follow `apps/workspace-engine/CLAUDE.md` guidelines
192+
- Run `pnpm lint` and `pnpm format:fix` before submitting a PR
193+
194+
### Opening a Pull Request
195+
196+
1. Fork the repo and create a branch from `main`
197+
2. Make your changes, add tests where applicable
198+
3. Run `pnpm test`, `pnpm lint`, and `pnpm typecheck` to verify everything passes
199+
4. Open a PR against `main` with a clear description of what changed and why
200+
107201
## :heart: Community
108202

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

0 commit comments

Comments
 (0)