Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
# Contributing to HomeRacker
Thanks for your interest in contributing! Even getting this far is already worth a ton 🏋
> 🤖 Using a coding agent? Point it at [AGENTS.md](AGENTS.md), the canonical instruction set for this repo (see [CLAUDE.md](CLAUDE.md) for example).
## 📦 Contribution Scope
This repository contains the **HomeRacker Core** system. We accept **bugfixes and improvements to the core model** here.
**New features, modules, and extensions** (e.g. new mount types, adapters, accessories) should be contributed to the [HomeRacker Community Repository](https://github.com/kellerlabs/homeracker-community).
> 💡 Not sure where your contribution belongs? [Open an issue](https://github.com/kellerlabs/homeracker/issues) or [start a discussion](https://github.com/kellerlabs/homeracker/discussions) first, we're happy to help you find the right place.
## 🚀 Quick Start
### Pre-commit Hooks (Required)
This repository uses [pre-commit](https://pre-commit.com/) to enforce code quality checks before commits.
**Prerequisites**: Python 3.x installed on your system
```bash
# Clone and setup
git clone https://github.com/kellerlabs/homeracker.git
cd homeracker
# On Debian/Ubuntu systems, you need to install the python3-venv package before next command
python3 -m venv .venv
# Activate the virtual environment
# Windows (Git Bash/CMD/PowerShell):
source .venv/Scripts/activate
# macOS/Linux:
source .venv/bin/activate
# Install scadm package (openscad dependency manager)
pip install -e cmd/scadm
# Install OpenSCAD (Windows/Linux/macOS) + Dependencies
scadm install
# Install scadfmt (OpenSCAD formatter)
pip install -e cmd/scadfmt
# Optional (Opinionated VSCode Integration)
# see cmd/scadm/README.md and cmd/scadfmt/README.md for details
scadm vscode --openscad # For OpenSCAD development
scadm vscode --python # Install and configure Python extension
scadfmt vscode # Format .scad files with scadfmt (Format Document)
# Install pre-commit and the test tooling its hooks use
pip install pre-commit pytest -r requirements.txt
# Additional dependencies for OpensCAD and pre-commit (Ubuntu / Debian)
sudo apt install libopengl0 shellcheck
# Verify installation
scadm render models/wallmount/parts/wallmount.scad
# Discover and render all models
./cmd/test/test-models.sh
# Install the git hooks
pre-commit install --install-hooks -t commit-msg -t pre-commit
# Let git blame skip bulk formatting commits (GitHub does this already)
git config blame.ignoreRevsFile .git-blame-ignore-revs
```
Now pre-commit will automatically run on `git commit`. To manually run hooks on all files:
```bash
pre-commit run --all-files
```
The hooks can be found here: [.pre-commit-config.yaml](.pre-commit-config.yaml)
## 📐 HomeRacker Standards
- **Base unit**: 15mm
- **Lock pins**: 4mm square
- **Walls**: 2mm thickness
- **Tolerance**: 0.2mm
- **Quality**: `$fn=100` for production
## 🛠️ Development Guidelines
### Code Standards
- **DRY, KISS, YAGNI** - Keep it simple
- `.scad` files are formatted by `scadfmt`. The pre-commit hook formats staged files and stops the commit when it changed one: stage the result and commit again. By hand: `scadfmt format <path>`, see [cmd/scadfmt/README.md](cmd/scadfmt/README.md)
- Use [BOSL2](https://github.com/BelfrySCAD/BOSL2/wiki) for complex geometry
- Group parameters with `/* [Section] */` comments
- Add sanity checks: `assert(height % 15 == 0, "Must be multiple of 15mm")`
### Configurator (TypeScript)
- Lives in `configurator/`; run `npm ci && npm run check` before committing (the pre-commit hook does this when files under `configurator/` change)
- Keep `src/engine/` free of DOM and Three.js; put geometry rules there with a Vitest case
- Anything visible in the 3D view: run `npm run dev` and check it in the browser before you commit, and hand the URL to whoever reviews the change
- See [configurator/README.md](configurator/README.md)
### Site (Astro)
- Lives in `site/`; renders the READMEs of this repo. Run `npm ci && npm run check` there (the pre-commit hook does this when the site or a rendered README changes)
- Relative README links become site links; keep using them instead of absolute GitHub URLs
- Anything visible on a page: run `npm run dev` and check it in the browser before you commit, and hand the URL to whoever reviews the change
- A user-visible change to the site or configurator adds or updates an E2E test in `site/e2e/`, see [TESTING.md](TESTING.md#site-and-configurator-e2e-tests)
- See [site/README.md](site/README.md)
### Python Code Standards
- **Docstrings**: All functions must use [Google style docstrings](https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings)
```python
def example_function(param1: str, param2: int) -> bool:
"""Brief one-line summary of what the function does.
More detailed explanation if needed (optional).
Args:
param1: Description of first parameter
param2: Description of second parameter
Returns:
Description of return value
Raises:
ValueError: Description of when this exception is raised
"""
```
- See `cmd/scadm/scadm/flatten.py` for real examples
- Use type hints for function parameters and return values
- Keep inline comments minimal - code should be self-documenting
### Testing
- Run `./cmd/test/test-models.sh` to discover and render all models
- Run `scadm render <file.scad>` to validate individual files
- "Render" = compile .scad to binary STL via OpenSCAD (validates syntax, geometry, includes)
- Test edge cases (min/max parameter values)
### Flattened Exports
Files in `models/<model_type>/parts/` are automatically flattened on commit via `scadm flatten --all`. Configuration is in the `"flatten"` key of `scadm.json`. See [cmd/scadm/README.md](cmd/scadm/README.md) for details.
## 📝 Commit Conventions
This project uses [Conventional Commits](https://www.conventionalcommits.org/) for automated changelog generation and semantic versioning.
### Commit Format
```
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]
```
### Commit Types
| Type | Description | Version Bump |
|------|-------------|--------------|
| `feat:` | New feature | **minor** (0.x.0) |
| `fix:` | Bug fix | **patch** (0.0.x) |
| `feat!:` or `fix!:` | Breaking change | **major** (x.0.0) |
| `docs:` | Documentation only | **patch** (0.0.x) |
| `chore:` | Maintenance tasks | **patch** (0.0.x) |
| `refactor:` | Code restructuring | **patch** (0.0.x) |
| `test:` | Adding tests | **patch** (0.0.x) |
### Examples
```bash
# Feature (bumps minor version)
feat: add gridfinity adapter module
# Bug fix (bumps patch version)
fix: correct tolerance in wallmount holes
# Breaking change (bumps major version)
feat!: change base unit from 15mm to 20mm
# Documentation (no version bump)
docs: update installation instructions in README
# Maintenance (no version bump)
chore: update OpenSCAD to nightly-2024.11.20
# With scope
feat(wallmount): add cable management clips
fix(core): correct lock pin dimensions
```
### Breaking Changes
> [!IMPORTANT]
> Breaking changes must be aligned with the codeowners beforehand. We should avoid breaking changes as much as possible.
For breaking changes, use `!` after the type or add `BREAKING CHANGE:` in the footer:
```bash
feat!: change base unit from 15mm to 14mm
# or
feat: change base unit from 15mm to 14mm
BREAKING CHANGE: Base unit changed from 15mm to 14mm. All models need regeneration.
```
### Release Process
Releases are automated using Camunda's GitHub actions from [infra-global-github-actions](https://github.com/camunda/infra-global-github-actions):
- Commits following Conventional Commits automatically update the changelog
- Release PRs are created automatically when commits are pushed to `main`
- Scheduled releases run weekly via auto-merge workflow
- Manual releases can be triggered via GitHub Actions workflow dispatch
- PR titles are validated to ensure Conventional Commits compliance
**Note:** The workflows require GitHub App credentials configured as repository secrets.
## 🔄 Pull Request Workflow
1. Create branch or fork: `git checkout -b feature/my-feature`
2. Make changes following standards above
3. Test thoroughly
4. Commit: `git commit -m "feat: add cool feature"`
5. Push: `git push origin feature/my-feature`
6. Create PR with description and screenshots
Every PR runs [`ci.yml`](.github/workflows/ci.yml). Its `check-results` job passes once every job that applies to your change passed. It and the PR title check are the only required checks. See the [CI overview](.github/workflows/README.md).
### 🔭 Preview Deployments
A PR touching `site/` or `configurator/` is published at `https://homeracker.org/preview/pr-<number>/` and a bot comments the link. It rebuilds on every push and disappears when the PR closes.
To preview a PR that touches neither path, add the `deploy-preview` label (e.g. if you want to see your new model in the catalog).
Previews come from branches in this repository only. A PR from a fork never gets one, because a preview serves its author's HTML and JavaScript from the live domain.
Since previews are served from a subpath, never write a root-absolute internal link. Use `import.meta.env.BASE_URL` in components and client scripts, and pass the base explicitly into anything that runs at build time in Node, such as the rehype plugins in `site/src/lib/`. To check a subpath build locally:
```sh
cd site
SITE_BASE=/preview/pr-999/ npm run build
```
## 📂 Project Structure
```
models/ # OpenSCAD models, one folder per model type
# (bracket, core, crates, elgato_prompter_adapter, foot,
# gridfinity, inception, keystone, panel, pinpusher,
# racklink, rackmount_ears, sleeve, wallmount)
cmd/ # Python and shell tooling
├── scadm/ # OpenSCAD dependency manager, published to PyPI
├── test/ # Model render and Renovate config test scripts
├── export/ # MakerWorld description export tooling
├── setup/ # VS Code OpenSCAD setup script
├── linux/ # OpenSCAD wrapper for Linux
└── lib/ # Shared shell helpers
configurator/ # TypeScript web configurator
site/ # Astro site, renders this repo's READMEs
docs/ # Style guide, workflows, and ADRs in docs/decisions/
png_creation/ # Marketing render generation
.claude/ # Agent config: skills/, rules/ (path-scoped guidelines), agents/
.github/ # Workflows, composite actions, PR template
bin/ # OpenSCAD binaries and libraries, created by `scadm install` (gitignored)
```
`models/README.md` is the catalog index. Add an entry there whenever you add a model folder.
## 💬 Getting Help
- [Open an issue](https://github.com/kellerlabs/homeracker/issues) for bugs
- [Start a discussion](https://github.com/kellerlabs/homeracker/discussions) for questions
- [Community Repo](https://github.com/kellerlabs/homeracker-community) for new features and extensions
- See [scadm documentation](cmd/scadm/README.md) for dependency manager details
## 🔔 Discord Integration
The repository is integrated with Discord to announce updates:
- **Channel**: `#homeracker-announcements`
- **Webhook Name**: GitHub Releases
- **Events**: Release events
- **Configuration**: Discord GitHub-formatted webhook (`/github` suffix)
Releases automatically post to the Discord server, keeping the community updated.
## 📜 License
Contributions are licensed under MIT (code) and CC BY-SA 4.0 (models).
---
**Platform**: Windows/Linux/macOS (macOS treated as Linux, untested)
e6ec7bab9This file is pinned to the selected release. Download the original to open it in your design tool.