2.0 KiB
2.0 KiB
Contributing to Bach to Basics
Thanks for your interest! This guide covers the practical bits of working on the codebase.
Quick start (development)
pnpm install
pnpm backend:setup # creates backend/.venv with the core deps
pnpm dev # starts frontend (5173) + backend (8000) concurrently
Project layout
frontend/: React 19 + Vite + TypeScript appsrc/components/: UI components, organised by featuresrc/engine/:SyncEngine,AudioEngine, MIDI clock (no React inside)src/store/: Zustand statesrc/views/: top-level layouts (PracticeView)
backend/: FastAPI approuters/: endpoint groups (transcribe,omr,youtube,export_routes,fingering)services/: long-running blocking work, run in dedicated executors with timeouts
shared/: TypeScript types used by the frontend (the backend has its own duplicates intentionally, keeps backend deployable independently)
Conventions
- TypeScript strict mode is on.
pnpm --filter frontend exec tsc --noEmitshould pass cleanly. - No
anywithout a comment explaining why. - All audio-engine work happens off the React tree. The
SyncEngineis a singleton that emits events on amittbus; views subscribe viauseEffect. - Backend services are blocking-by-default and wrapped in
_run_in_*_pool()helpers with hard timeouts. Don't add long-running CPU work directly in route handlers.
Before opening a PR
pnpm --filter frontend exec tsc --noEmit: type checkpnpm test: frontend unit tests- If you touched the backend:
cd backend && python -m py_compile $(find . -name "*.py" -not -path "./.venv/*") - Verify the dev server still boots cleanly (
pnpm dev)
Reporting bugs
Include:
- Browser + OS version
- Whether you're running via
pnpm devor Docker - Steps to reproduce
- Anything in the browser console (DevTools > Console) and the backend terminal
Security
Found a vulnerability? Please don't open a public issue. Reach out via the contact info on the repo owner's GitHub profile.