Contributing
How to land code in GreekManage.
Branch naming
feature/issue-<N>-<short-description>
fix/issue-<N>-<short-description>
chore/<short-description>
docs/<short-description>
Examples:
feature/issue-148-pnm-rate-limitfix/issue-152-election-runoff-tiechore/upgrade-django-6-1docs/dev-onboarding
Always branch from main. Sync regularly with git pull --rebase origin main.
Pull request workflow
- Open a draft PR early. Even with a few commits, draft PRs let CI start running and reviewers see direction.
- Reference the issue. PR body must include
Closes #Nso the issue auto-closes on merge. - Write tests. Targets: backend ≥80% coverage; frontend ≥70%. PRs that drop coverage are blocked by the SonarQube quality gate.
- Run security checks locally before pushing.
npm run security:full
- Pass CI. All required checks must be green:
- Backend tests (pytest, scoped to changed apps)
- Frontend tests (Vitest) + build
- Android Gradle build
- SAST (Bandit + Semgrep)
- SCA (pip-audit + npm audit)
- Trivy filesystem scan
- SonarQube quality gate
- E2E smoke (
@smoketagged tests + ZAP API + ZAP baseline) - Claude Code Review (advisory; doesn't block)
- Get one approving review. Repo enforces this on
main. - Squash and merge. Use the GitHub "Squash" button to keep
mainhistory clean.
PR description template
## What
Short summary of the change.
## Why
The problem this solves or feature this enables. Link the issue.
## How
Notable implementation choices and trade-offs.
## Test plan
- [ ] Unit tests added for new logic
- [ ] E2E test added if user-facing
- [ ] Manual QA notes
Closes #N
Code review
We review for:
- Correctness — does it do what the issue asked?
- Tests — are edge cases covered?
- Security — auth checks, input validation, no secrets in code
- Performance — N+1 queries, missing indexes, unbounded list ops
- Multi-tenancy — does it respect RLS /
OrganizationContextMiddleware? - API design — is the endpoint shape consistent with neighbors?
- Naming + readability
Reviewers leave inline comments and a top-level approval / changes-requested. Authors respond to every comment (resolve, fix, or push back with reasoning).
Style
- Backend:
blackfor formatting (auto-applied via pre-commit),rufffor linting, type hints on public APIs - Frontend:
prettierfor formatting,eslintfor linting, strict TypeScript (noanyunless commented why) - SQL in migrations: lowercase keywords, snake_case identifiers
- Mermaid diagrams in docs: use the existing color tokens (
#334155primary)
Adding a new Django app
cd backend && python manage.py startapp <name> apps/<name>- Add
apps.<name>toINSTALLED_APPSinbackend/greekmanage/settings.py - Create
apps/<name>/urls.py, register inbackend/greekmanage/urls.py - Add
apps/<name>/permissions.pyif app-specific permissions are needed - Define your models — inherit from
apps.common.models.TimeStampedModelif you wantcreated_at/updated_atfor free - Run
python manage.py makemigrations <name>and review the migration - Document the app at
docs-site/docs/developers/apps/<name>.mdx - Add tests under
backend/apps/<name>/tests/
Adding a new endpoint
- Define a serializer in
apps/<app>/serializers.py - Add a viewset / view in
apps/<app>/views.pywithpermission_classes - Wire it up in
apps/<app>/urls.py - Write at least one test in
apps/<app>/tests/test_<feature>.py - Regenerate the OpenAPI schema and commit it:
python manage.py spectacular --file ../docs-site/openapi/greekmanage.yamlcd ../docs-site && npm run docusaurus gen-api-docs all
- The new endpoint shows up in the API reference automatically
Adding a frontend page
- Create the route in
frontend/src/router.tsx - Create the page component in
frontend/src/pages/<role>/<page>.tsx - If admin-only or module-gated, wrap with
<RoleGuard>/<ModuleGuard> - Add a Vitest test in the same folder if logic-heavy
- If user-facing, add a docs page under
docs-site/docs/<role>/<page>.mdx
Security gates
Some changes touch security-sensitive surfaces and require extra review:
- Auth flows (login, SSO, JWT) — review by 2 maintainers
- Permission classes — review by 2 maintainers
- Encryption / key handling — review by maintainer + log entry in
SECURITY.md - Audit log changes — review by maintainer; never delete log entries
- Payment processing — PCI-relevant; review by maintainer + manual QA in staging
Release process
- Bump
backend/VERSIONandfrontend/package.jsonto the new SemVer - Update
CHANGELOG.mdwith the new entry (Added / Changed / Fixed sections) - Open a release PR titled
Release vX.Y.Z - Squash-merge after approval
- Tag the release:
git tag vX.Y.Z && git push origin vX.Y.Z - Production deploy: separate workflow, manually triggered (not automatic on tag)
Reporting security issues
Do not open a public issue for a security vulnerability. Email security@greekmanage.com with:
- A description of the vulnerability
- Reproduction steps
- Impact assessment
We respond within 24 hours and follow SECURITY.md for disclosure.
Code of conduct
Treat collaborators as you'd want to be treated. Disagree on technical merits; don't make it personal. Reviewers and authors share the same goal.
Help
- Architecture questions: tag
@maintainersin your PR - Stuck on local setup: see Getting started — most issues are env vars
- Slack / Discord: link in repo README