Thank you for your interest in contributing to reui! This document provides guidelines and instructions for contributing to the project.
- Code of Conduct
- Getting Started
- Development Workflow
- Branch Naming Conventions
- Commit Message Guidelines
- Pull Request Process
- CI/CD Requirements
- Testing Requirements
- Code Style Guidelines
- Documentation
By participating in this project, you agree to maintain a respectful and inclusive environment for all contributors.
- Node.js 18.x or higher
- npm or yarn
- Git
- Foundry (for smart contract development)
-
Fork the repository on GitHub
-
Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/reui.git cd reui -
Add the upstream repository:
git remote add upstream https://github.com/DeborahOlaboye/reui.git
-
Install dependencies:
# Frontend dependencies cd frontend npm install # Smart contract dependencies cd ../contracts forge install
-
Set up environment variables:
# Frontend cd frontend cp .env.example .env.local # Edit .env.local with your values
-
Sync with upstream:
git checkout main git pull upstream main
-
Create a feature branch:
git checkout -b feat/your-feature-name
-
Make your changes and test locally
-
Commit your changes following our commit guidelines
-
Push to your fork:
git push origin feat/your-feature-name
-
Open a Pull Request on GitHub
Use the following prefixes for branch names:
feat/- New features- Example:
feat/dark-mode-toggle
- Example:
fix/- Bug fixes- Example:
fix/login-validation
- Example:
docs/- Documentation changes- Example:
docs/api-endpoints
- Example:
refactor/- Code refactoring- Example:
refactor/user-service
- Example:
test/- Test additions or updates- Example:
test/integration-tests
- Example:
chore/- Maintenance tasks- Example:
chore/update-dependencies
- Example:
style/- Code style changes (formatting, etc.)- Example:
style/eslint-fixes
- Example:
perf/- Performance improvements- Example:
perf/optimize-queries
- Example:
For issue-specific branches, use:
issue-{number}-{description}- Example:
issue-137-cicd-pipeline
- Example:
We follow Conventional Commits specification.
<type>(<scope>): <subject>
<body>
<footer>
feat: A new featurefix: A bug fixdocs: Documentation changesstyle: Code style changes (formatting, missing semi-colons, etc.)refactor: Code refactoringperf: Performance improvementstest: Adding or updating testsbuild: Changes to build system or dependenciesci: Changes to CI/CD configurationchore: Other changes that don't modify src or test filesrevert: Reverts a previous commit
feat(frontend): add dark mode toggle component
Add a theme toggle component that allows users to switch between light,
dark, and system theme preferences. Theme preference is persisted to
localStorage and applied on page load.
Closes #150fix(contracts): resolve reentrancy vulnerability in withdraw function
Add ReentrancyGuard to prevent reentrancy attacks on the withdraw
function. Update tests to verify the fix.
Fixes #142docs: add deployment guide for Vercel and Netlify
Create comprehensive deployment documentation covering environment
setup, configuration, and troubleshooting for multiple platforms.- Use the imperative mood ("add" not "added" or "adds")
- Don't capitalize the first letter of the subject
- No period at the end of the subject line
- Limit subject line to 72 characters
- Separate subject from body with a blank line
- Wrap body at 72 characters
- Reference issues and pull requests in the footer
-
Update your branch with the latest changes from main:
git checkout main git pull upstream main git checkout your-branch git rebase main
-
Run all tests and ensure they pass:
# Frontend tests cd frontend npm run lint npm run test npm run build # Contract tests cd contracts forge test forge fmt --check
-
Review your changes:
git diff main...your-branch
- Use the pull request template provided
- Fill in all required sections
- Link related issues using keywords (Closes #123, Fixes #456)
- Add appropriate labels
- Request review from code owners (automatic via CODEOWNERS)
- All CI checks must pass
- At least 1 approving review required
- All conversations must be resolved
- Branch must be up to date with base branch
- Conventional commit format followed
- Tests added/updated for new features or bug fixes
- Documentation updated if needed
PR titles should also follow conventional commit format:
feat(frontend): add user authentication
fix(contracts): resolve gas optimization issue
docs: update API documentation
All pull requests must pass the following automated checks:
- Lint: ESLint and TypeScript checks
- Test: Unit and integration tests with Jest/React Testing Library
- E2E: End-to-end tests with Playwright
- Build: Production build verification
- Test: Foundry test suite
- Coverage: Minimum 80% code coverage
- Format: Solidity formatting check
- Security: Slither static analysis
- Coverage Report: Code coverage must not decrease
- Bundle Size: Frontend bundle size check
- Security Scan: Trivy vulnerability scanning
- Performance: Lighthouse performance score > 90
- Auto-labeling based on changed files
- PR size labeling
- Conventional commit validation
- Auto-assign reviewers
-
Unit Tests: Test individual components and functions
npm run test -
Integration Tests: Test component interactions
npm run test:integration
-
E2E Tests: Test complete user flows
npm run test:e2e
-
Unit Tests: Test individual contract functions
forge test -
Integration Tests: Test contract interactions
forge test --match-path test/integration/**
-
Coverage: Generate coverage report
forge coverage
-
Gas Reports: Check gas consumption
forge test --gas-report
- Write tests for all new features
- Update tests for bug fixes
- Maintain or improve code coverage
- Use descriptive test names
- Include edge cases and error scenarios
- Mock external dependencies appropriately
- Use TypeScript for type safety
- Follow ESLint configuration
- Use functional components with hooks
- Implement proper error handling
- Use meaningful variable names
- Add JSDoc comments for complex functions
- Follow Solidity style guide
- Use NatSpec comments for all public functions
- Implement proper access control
- Follow checks-effects-interactions pattern
- Optimize for gas efficiency
- Use events for important state changes
- Keep functions small and focused
- Follow DRY (Don't Repeat Yourself) principle
- Write self-documenting code
- Add comments for complex logic
- Use consistent naming conventions
- Adding new features
- Changing existing behavior
- Adding new configuration options
- Fixing significant bugs
- Updating dependencies
- Code Comments: Explain complex logic
- README: Project overview and quick start
- API Documentation: Endpoint and function documentation
- User Guides: Step-by-step instructions
- Architecture Docs: System design and decisions
- Keep documentation up to date with code changes
- Use clear and concise language
- Include code examples where helpful
- Add diagrams for complex flows
- Link to related documentation
- Open an issue for bugs or feature requests
- Join discussions in existing issues
- Review documentation and guides
- Check CI/CD logs for build failures
Contributors will be recognized in:
- GitHub contributors page
- Release notes for significant contributions
- Project documentation
By contributing to reui, you agree that your contributions will be licensed under the same license as the project.
Thank you for contributing to reui! 🎉
For questions or clarifications, please open an issue or reach out to the maintainers.