Thank you for your interest in contributing to netballstats! This guide explains how to develop and submit changes.
- Getting Started
- Development Setup
- Making Changes
- Opening a Pull Request
- Code Review Process
- Merge and Deployment
- Style Guides
- Questions or Issues
- Git and GitHub account access to craigmoyle/netballstats
- Node.js (v22 recommended; matches CI environment) and npm for frontend development
- R (v4.0+) and renv for backend development
- Docker (optional) for local API testing
- GitHub CLI (
gh) for convenient command-line operations
netballstats/
├── api/ # R Plumber API service
│ ├── plumber.R # API entry point
│ ├── R/ # Helper modules
│ └── ...
├── assets/ # Shared frontend scripts and styles
├── scripts/ # Data refresh and utilities
├── infra/ # Azure infrastructure (Bicep)
├── azure.yaml # Azure deployment configuration
├── package.json # Frontend dependencies
├── AGENTS.md # Canonical agent operating guidance (harness-neutral)
├── CLAUDE.md # Product design context for UI/copy work
├── DESIGN.md # Design tokens and system spec
├── CONTRIBUTING.md # This file
└── .github/
├── BRANCH_PROTECTION.md # Branch protection policy
├── CODEOWNERS # Code ownership
└── workflows/ # GitHub Actions
For detailed system architecture, see AGENTS.md.
# Clone
git clone https://github.com/craigmoyle/netballstats.git
cd netballstats
# Create a new feature branch (never work on main)
git checkout -b feature/my-feature# Install dependencies
npm install
# Build and verify the static site (matches CI)
npm run build:verify
# Output is in dist/
ls dist/# Restore R dependencies with renv
Rscript -e "renv::restore()"
# Test the API locally (if Docker available)
docker build -f Dockerfile.azure -t netballstats-api .
docker run -p 8000:8000 netballstats-api
# Or validate R syntax
Rscript -e "parse(file='api/plumber.R')"- The database is Azure PostgreSQL Flexible Server (production)
- See
scripts/build_database.Rfor schema and refresh logic - See
AGENTS.mdfor database conventions and helper functions
Follow the standards outlined in AGENTS.md:
- Use vanilla JavaScript with shared UI helpers from
assets/config.js - Maintain the warm amber and teal palette
- Support both light and dark themes
- Ensure WCAG AA accessibility
- Use the typography system: Fraunces (body) and Teko (display)
- Use parameterized SQL for all queries (SQLite + PostgreSQL compatible)
- Validate all inputs strictly (no silent fallbacks)
- Log errors explicitly, not in broad try/catch wrappers
- Follow existing helper patterns in
api/R/helpers.R
- Keep commits focused (one logical change per commit)
- Write clear commit messages in present tense
- ✅ "Add international player stats page"
- ❌ "Added stuff" or "fixed bugs"
- Update AGENTS.md if you change operational decisions
# Frontend validation
npm run build:verify # Verify build and validation succeeds
# Backend validation
Rscript -e "parse(file='api/plumber.R')"
Rscript -e "parse(file='api/R/helpers.R')"
# Git checks
git status # Review changes
git diff --cached # Review staged changesThe repository uses these validation approaches:
- Frontend:
npm run build:verifyvalidates syntax, runs checks, and outputs artifacts - Backend:
Rscript -e "parse(file='...')"validates R syntax - API: Regression tests in
scripts/test_api_regression.R - Container:
Scan container image / scancheck scans for vulnerabilities
See AGENTS.md for detailed testing patterns and data conventions.
# Ensure you're on a feature branch
git branch
# Commit your changes
git add .
git commit -m "Add international player stats page"
# Keep commits clean
git log --oneline -5
# Push to GitHub
git push origin feature/my-feature-
Click "Compare & pull request" (or use
gh pr create) -
Write a clear PR title and description:
Title: Should be concise and describe the change
- ✅ "Add international player stats page"
- ✅ "Fix: Handle empty dataset in chart"
- ❌ "Updates" or "stuff"
Description: Should explain:
- What changed and why
- Any user-facing effects
- Any breaking changes or database migrations
- Links to related issues (if any)
-
Set a reviewer (usually auto-assigned via CODEOWNERS)
-
Ensure your branch is up-to-date with
main
Once you push, GitHub automatically:
- Runs status checks:
Scan container image / scan(required on every PR, optimized for frontend changes)
- Requests code owner reviews where relevant
- Blocks merging until all checks pass
- Code owners will review your changes within 24–48 hours
- Feedback may request changes — this is normal and valuable
- Address feedback by pushing updates to your branch
- Old approvals automatically dismiss when you push new commits
- You don't need to request re-review; the reviewer will check the updates
Example workflow:
- Read the comment carefully
- Make the necessary fix in your local branch
- Commit and push the change
- Mark the conversation as resolved when appropriate
- Be respectful and constructive in all review comments
- Focus on the code, not the person
- Ask clarifying questions if a comment is unclear
- Prefer small, focused changes over large, risky rewrites
Before merging, confirm:
- All status checks are passing
- Review feedback is resolved
- The PR is current with
main - The change is documented if needed
Use Squash and merge or Rebase and merge. Do not create merge commits.
- The frontend deploys automatically via Azure Static Web Apps
- Database refresh jobs remain synchronized through the Azure deployment process
- Monitor deployment status and logs if something looks off
- Use the existing editorial tone and netball terminology
- Preserve the warm amber and teal palette
- Keep the typography system intact
- Follow the repo guidance in
AGENTS.md
- See TROUBLESHOOTING.md
- Review BRANCH_PROTECTION.md
- Check AGENTS.md for repository context
Last Updated: May 27, 2026