-
-
Notifications
You must be signed in to change notification settings - Fork 0
Development and Contributing
This page describes practical local development workflows for Kanfei. For the full contributor guide — including code quality standards, PR process, and AI-assisted contribution policy — see CONTRIBUTING.md in the repo.
-
backend/FastAPI app + logger daemon + protocol/services/models -
frontend/React + TypeScript + Vite app -
tests/backend/backend test suite -
tests/e2e/Playwright end-to-end test suite -
scripts/hooks and tooling (pre-push hook, E2E report generator) -
reference/Davis protocol reference materials
python station.py setupProduction-style app server:
python station.py runDevelopment mode (backend + frontend dev server):
python station.py devBackend tests:
python station.py testFrontend type check:
cd frontend && npx tsc --noEmitBoth must pass before submitting changes.
E2E tests run locally, not in CI. They are required for UI behavior changes — dashboard rendering, gauge layout, Settings UI, navigation, WebSocket/data pipeline changes, and API shape changes. They are not required for backend-only changes, pure CSS tweaks, documentation, CI config, or driver additions.
Setup (one-time):
cd frontend && npm run build
cd ../tests/e2e && npm install
npx playwright install chromiumRun and generate a markdown report for your PR:
./scripts/e2e-report.shThe report script runs all Playwright specs against a fixture database on port 8765 (avoids conflicts with a running station.py run on 8000) and outputs a markdown summary with pass/fail counts, duration, and failure details. Paste the output into your PR comment before requesting review.
The repo includes a pre-push hook that reminds you to run the E2E suite when pushing an E2E branch. Install it with:
git config core.hooksPath scripts/hooksThe hook is informational only — it does not block the push.
- Defaults come from
.env.example. - Active runtime config is persisted in SQLite
station_config. - Setup Wizard can initialize config if DB is empty.
- Logger daemon is the only process that should own the station connection (serial device or network socket).
- Use setup probe/auto-detect endpoints for safe detection workflows.
- If hardware is absent, degraded mode still allows UI and many APIs for frontend work.
See Driver Development for the full guide covering the StationDriver interface, SensorSnapshot field reference, driver registration, and test fixture workflow.
-
mainis the primary development and release branch -
feature/*branches for larger work,fix/*for bugfixes -
feature/e2e/*orfix/e2e/*for changes that require E2E testing (UI behavior changes) - PR flow into
main - Small changes can go directly to main; larger work should use branches + PRs
- Multi-phase issues: use
Ref #N(notCloses #N) until the final phase PR - E2E branches: run
./scripts/e2e-report.shand post results to PR before requesting review
AI tools (Claude Code, Copilot, Cursor, etc.) are welcome. The project evaluates contributions on quality, not origin. Key requirements:
- Disclose AI use in the PR description (a simple "AI-assisted" is fine)
- Understand every line — you must be able to explain your code when asked
- Verify, don't trust — check that imports exist, function signatures are correct, and the code actually runs
- Run all tests, not just the ones you wrote
- No bulk AI refactors without prior discussion in an issue
See CONTRIBUTING.md for the full AI policy, including what reviewers look for and what will get a PR rejected.
The kanfei-nowcast package is a separate proprietary product. Do not reference its internal architecture, detection algorithms, or implementation details in issues, PRs, or code comments. Describe only user-visible symptoms and outcomes.
When adding docs:
- prefer file/module references
- avoid describing features not present in code
- update related wiki pages when adding endpoints/config keys
- verify documentation against actual code behavior — do not document what code should do
- hardware driver testing (see Supported Hardware for in-testing drivers)
- API response examples in wiki pages
- additional troubleshooting playbooks
- integration testing for IPC and service interactions
- documentation for deployment hardening (reverse proxy, backup automation)
- Bugs: GitHub Issues
- Feature ideas: GitHub Discussions — Ideas
- Questions: GitHub Discussions — Q&A