Thank you for your interest in contributing to HealthDonor Protocol! This guide covers everything you need to get started.
- Node.js >= 18.x
- npm >= 9.x
- Rust and Cargo (for Soroban smart contracts)
- Docker and Docker Compose (for Postgres and Redis)
-
Clone the repository:
git clone https://github.com/Emeka000/Health-chain-stellar.git cd Health-chain-stellar -
Start infrastructure services:
docker-compose up -d
This starts Postgres and Redis.
-
Set up the backend:
cd backend cp .env.example .env # Edit .env with your configuration npm install npm run migration:run npm run start:dev
-
Set up the frontend:
cd frontend npm install npm run dev -
Build smart contracts (optional):
cd contracts cargo build
Health-chain-stellar/
├── backend/ # NestJS API server
│ ├── src/ # Source code (modules, services, controllers)
│ ├── test/ # E2E and integration tests
│ ├── docs/ # Backend documentation
│ └── .env.example # Environment variable template
├── frontend/ # Frontend application
│ ├── src/ # Source code
│ └── health-chain/ # Health chain UI components
├── contracts/ # Soroban smart contracts (Rust)
│ └── src/ # Contract source code
├── scripts/ # Utility scripts
├── docs/ # Project documentation
└── docker-compose.yml # Postgres + Redis setup
cd backend
npm run test # Run all unit tests
npm run test:watch # Watch mode
npm run test:cov # With coverage reportcd backend
npm run test:e2ecd contracts
cargo testcd frontend
npx tsc --noEmitUse descriptive branch names with prefixes:
feat/— New features (e.g.,feat/blood-unit-search)fix/— Bug fixes (e.g.,fix/donation-escrow-timing)docs/— Documentation (e.g.,docs/api-endpoint-reference)chore/— Maintenance tasks (e.g.,chore/update-dependencies)refactor/— Code restructuringtest/— Adding or updating tests
Follow Conventional Commits:
type(scope): short description
Optional longer description explaining the change.
Types: feat, fix, docs, style, refactor, test, chore, perf
Examples:
feat(donation): add time-locked fund release
fix(contract): prevent reentrancy in escrow withdrawal
docs: add API endpoint documentation
Before opening a PR, ensure:
- Tests pass (
npm run testfor backend,cargo testfor contracts) - Linting passes (
npm run lintfor backend) - New features have accompanying tests
- Database schema changes include migration files
- Commit messages follow the conventional format
- PR description explains what changed and why
- Open a PR against the
mainbranch. - Fill in the PR template with a clear description.
- Reference related issues (e.g.,
Closes #42). - Wait for CI checks to pass.
- Address review feedback promptly.
- A maintainer will merge once approved.
- Follow the ESLint configuration in
backend/eslint.config.mjs. - Use Prettier for formatting (config in
backend/.prettierrc). - Run linting:
cd backend && npm run lint
- Follow NestJS conventions: modules, services, controllers, DTOs.
- Use TypeScript strict mode.
- Follow existing component patterns.
- Run clippy for linting:
cd contracts && cargo clippy
- Ensure no compiler warnings.
Given the medical domain of this project, security is critical. Do not open public issues for security vulnerabilities.
Instead, please refer to our Security Policy for responsible disclosure instructions.
Look for issues labeled with:
good first issue— Beginner-friendly taskshelp wanted— Tasks where we need community help
Please be respectful and constructive in all interactions. We are building a welcoming community for contributors of all backgrounds and experience levels.
By contributing, you agree that your contributions will be licensed under the same license as the project.
If you have questions about contributing:
- Open a GitHub Issue for bugs or feature requests
- Check existing documentation in
docs/andbackend/docs/
Thank you for contributing to HealthDonor Protocol!