# Contributing to CNC Simulator Pro First off โ€” **thank you** for taking the time to contribute! ๐ŸŽ‰ CNC Simulator Pro exists to make CNC education free and accessible. Every contribution โ€” whether it's a bug report, a new example program, a tool definition, a documentation fix, or a feature โ€” helps move that mission forward. The following is a set of guidelines for contributing. Use your best judgment โ€” these are guidelines, not rules. --- ## ๐Ÿš€ Quick Start for Contributors ```bash # 1. Fork & clone git clone https://github.com//cnc.git cd cnc # 2. Install dependencies bun install # 3. Run the dev server bun run dev # โ†’ http://localhost:3000 # 4. Create a branch git checkout -b fix/my-improvement ``` --- ## ๐Ÿ› Reporting Bugs A good bug report makes fixing it easy. Before opening an issue: 1. **Search existing issues** to avoid duplicates. 2. Try the **latest `main`** branch โ€” it may already be fixed. 3. Open a [bug report](https://github.com/rudra496/cnc/issues/new?labels=bug&template=bug_report.md) and include: - What you expected to happen - What actually happened - Steps to reproduce - Your browser & OS (e.g. Chrome 125 on Windows 11) - The G-code program (if relevant) - Screenshots or a screen recording if visual --- ## ๐Ÿ’ก Suggesting Enhancements Have an idea? [Start a discussion](https://github.com/rudra496/cnc/discussions) first โ€” it's the best place to gauge interest before writing code. Once there's rough agreement, open a [feature request](https://github.com/rudra496/cnc/issues/new?labels=enhancement&template=feature_request.md). --- ## ๐Ÿ”ง Ways to Contribute You don't need to write code to help! Here are some great starting points: ### Easy wins - ๐Ÿ“ Improve documentation or the README - ๐ŸŒ Add translations or fix typos - ๐ŸŽจ Suggest UI/UX improvements - ๐Ÿงช Test the simulator with different G-code programs and report issues ### Code contributions - ๐Ÿ› ๏ธ Fix a [bug](https://github.com/rudra496/cnc/issues?q=is:issue+label:bug) - โž• Add a new **example G-code program** to `src/lib/cnc/examples.ts` - ๐Ÿ”ง Add a **tool definition** to `src/lib/cnc/tools.ts` - ๐Ÿงฑ Add a **material** to `src/lib/cnc/materials.ts` - ๐Ÿ“– Expand the **code reference** in `src/lib/cnc/reference.ts` - ๐ŸŽฏ Improve the **G-code parser** (`src/lib/cnc/parser.ts`) for more codes ### Look for these labels - [`good first issue`](https://github.com/rudra496/cnc/labels/good%20first%20issue) โ€” beginner-friendly - [`help wanted`](https://github.com/rudra496/cnc/labels/help%20wanted) โ€” community help appreciated - [`enhancement`](https://github.com/rudra496/cnc/labels/enhancement) โ€” new features --- ## ๐Ÿง‘โ€๐Ÿ’ป Development Workflow 1. **Fork** the repo and create your branch from `main`: ```bash git checkout -b feature/your-feature ``` 2. **Make your changes.** Keep commits focused and write clear messages. 3. **Test locally:** ```bash bun run lint # must pass bun run build # must succeed (static export) ``` 4. **Push** and open a Pull Request against `main`. 5. Reference any related issue (e.g. `Closes #123`). ### Code Style - The project uses **TypeScript** + **ESLint** + **Prettier** defaults. - Follow the patterns you see in the existing code. - Keep the core simulation logic (`src/lib/cnc/`) pure and well-typed. --- ## ๐Ÿ“‚ Project Structure Overview | Path | Purpose | |------|---------| | `src/lib/cnc/` | Core simulation engine โ€” parser, carve, store, tools, materials | | `src/components/cnc/` | UI components โ€” 3D scene, editor, control bar, panels | | `src/components/ui/` | shadcn/ui primitive components | | `src/app/` | Next.js app router pages & layout | | `public/` | Static assets, favicon, OG image | | `.github/workflows/` | CI build-check + GitHub Pages deploy | > โ„น๏ธ The core mechanism (parser, carve engine, store, tools, materials) is **stable and well-tested**. Prefer additive changes over rewrites when touching these files. --- ## ๐Ÿท๏ธ Pull Request Checklist - [ ] Branch is up to date with `main` - [ ] `bun run lint` passes - [ ] `bun run build` succeeds - [ ] Code follows existing style - [ ] Commit messages are clear - [ ] PR description explains the **what** and **why** - [ ] Linked any related issues --- ## ๐Ÿค Code of Conduct By participating, you agree to uphold our [Code of Conduct](./CODE_OF_CONDUCT.md). Be kind, respectful, and constructive. We're all here to make CNC learning better. --- Thanks again for contributing! ๐Ÿ› ๏ธโœจ