-
Notifications
You must be signed in to change notification settings - Fork 18
docs: enhance contributing section in README #952
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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`) | ||
|
|
||
| ### 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
|
||
| 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) | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.modspecifiesgo 1.25.7andapps/relay/go.modspecifiesgo 1.25.4, soGo 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+).