Thank you for considering a contribution. This document covers everything you need to get started.
- Code of Conduct
- How to Contribute
- Development Setup
- Code Standards
- Pull Request Process
- Reporting Issues
This project follows the Contributor Covenant Code of Conduct. By participating you agree to uphold it. Report unacceptable behaviour to the project maintainers.
Good starting points:
- Fix a bug listed in Issues
- Improve test coverage for the engine or data layers
- Add drug/interaction data to the seed files
- Improve frontend accessibility or mobile layout
- Improve API documentation or error messages
For larger features, open an issue first to discuss scope before writing code.
- Python 3.11+
- Node 20+
- Git
# Create and activate a virtual environment
python -m venv .venv
source .venv/bin/activate # Linux/macOS
.venv\Scripts\activate # Windows
# Install in editable mode with dev dependencies
pip install -e ".[dev]"
# Seed the database
python -m medgraph.cli seed
# Run the API
python -m medgraph.cli servecd dashboard
npm install
npm run devpytest tests/ -vruff check medgraph/ tests/ # lint
ruff format medgraph/ tests/ # format- Formatter / linter:
ruff(configured inpyproject.toml, line length 100) - Type hints: required on all public functions and class methods
- Docstrings: module-level and public API docstrings expected
- All new code must have associated
pytesttests - Do not add optional dependencies unless strictly necessary
- Strict mode TypeScript — no
anywithout justification - Tailwind CSS v4 utility classes; no custom CSS unless unavoidable
- Components in
dashboard/src/components/, hooks indashboard/src/hooks/ - Prefer functional components and React hooks
Follow conventional commits:
feat: add enzyme inhibition strength display
fix: handle missing RxNorm CUI gracefully
docs: update API endpoint table in README
test: add pathfinder max-depth edge case
refactor: extract risk scorer into standalone module
-
Fork the repository and create a feature branch from
main:git checkout -b feat/my-feature
-
Make your changes, write tests, and verify everything passes:
pytest tests/ -v ruff check medgraph/ tests/ cd dashboard && npm run build
-
Open a pull request against
mainwith:- A clear title following the commit convention
- Description of what changed and why
- Reference to any related issues (
Closes #42)
-
A maintainer will review within a few days. Address review comments in new commits (do not force-push during review).
-
Once approved and CI passes, a maintainer will merge.
When filing a bug, include:
- MEDGRAPH version / git SHA
- Python version and OS
- Exact steps to reproduce
- Expected behaviour vs actual behaviour
- Relevant log output or error messages
For security-sensitive issues, do not file a public issue — contact the maintainers directly.