This guide will help you set up your local development environment for contributing to OpenDIF Core.
Before you begin, ensure you have the following installed:
-
Fork and clone the repository:
git clone https://github.com/YOUR_USERNAME/opendif-mvp.git cd opendif-mvp -
Add the upstream remote:
git remote add upstream https://github.com/OpenDIF/opendif-mvp.git
-
Run the setup script:
make setup-all
This will:
- Install Git hooks (pre-commit checks)
- Install Go dependencies for all services
- Install npm dependencies for all frontend portals
Always create a new branch from main for your changes:
git checkout main
git pull upstream main
git checkout -b feature/your-feature-name
# or
git checkout -b fix/issue-numberUnit Tests:
# Run all unit tests
go test ./...
# Run tests for a specific service
cd exchange/consent-engine
go test ./...Integration Tests:
cd tests/integration
docker compose -f docker-compose.test.yml up -d
go test -v ./...
docker compose -f docker-compose.test.yml downBuild Validation:
# Build all services
make validate-build-all
# Build a specific service
cd exchange/consent-engine
go build .- Follow standard Go idioms and conventions
- Run
go fmt ./...before committing - Run
go vet ./...to catch common mistakes - Use
golangci-lintif available (optional but recommended)
Write clear, descriptive commit messages:
- Use the imperative mood ("Add feature" not "Added feature")
- Keep the first line under 50 characters
- Add a blank line and detailed explanation if needed
- Reference issues:
Fixes #123orCloses #456
Example:
Fix consent-engine database connection handling
- Handle connection timeouts gracefully
- Add retry logic for transient failures
- Update error messages for better debugging
Fixes #123
Before submitting a pull request, ensure:
- Code follows project style guidelines
- All tests pass locally
- New code includes appropriate tests
- Documentation is updated if needed
- Commit messages are clear and descriptive
- No merge conflicts with
mainbranch
opendif-mvp/
├── exchange/ # Go backend services
│ ├── orchestration-engine/
│ ├── policy-decision-point/
│ ├── consent-engine/
│ └── ...
├── portals/ # Frontend React applications
│ ├── member-portal/
│ ├── admin-portal/
│ └── consent-portal/
├── tests/ # Integration tests
│ └── integration/
└── docs/ # Documentation
- Check existing Issues
- Review Pull Request Guidelines
- See Reporting Issues for bug reports
Once your development environment is set up:
- Find an issue to work on or create a new one
- Create a branch for your changes
- Make your changes and test them
- Submit a pull request following our Pull Request Guidelines