Thank you for your interest in contributing to PropChain Frontend! This guide will help you get started with contributing to our decentralized real estate platform.
Before you start contributing, make sure you have:
- Node.js v18+ (LTS recommended)
- npm, yarn, or pnpm package manager
- Git version control
- Web3 Wallet (MetaMask, Trust Wallet, etc.) for testing
- GitHub account for collaboration
-
Fork the Repository
# Fork the repository on GitHub, then clone your fork git clone https://github.com/YOUR_USERNAME/PropChain-FrontEnd.git cd PropChain-FrontEnd
-
Add Upstream Remote
git remote add upstream https://github.com/MettaChain/PropChain-FrontEnd.git
-
Install Dependencies
npm install # or yarn install # or pnpm install
-
Set Up Environment Variables
cp .env.example .env # Edit .env with your configurationKey variables to configure:
Variable Description Example NEXT_PUBLIC_API_URLBackend REST API base URL http://localhost:3001NEXT_PUBLIC_WS_URLWebSocket server URL ws://localhost:3001NEXT_PUBLIC_BLOCKCHAIN_NETWORKTarget network name sepoliaNEXT_PUBLIC_RPC_URLEthereum JSON-RPC endpoint https://sepolia.infura.io/v3/YOUR_KEYNEXT_PUBLIC_CHAIN_IDEVM chain ID (decimal) 11155111NEXT_PUBLIC_ENABLE_TESTNETEnable testnet features trueNEXT_PUBLIC_GOOGLE_ANALYTICS_IDGA4 measurement ID G-XXXXXXXXXXNEXT_PUBLIC_SENTRY_DSNSentry error tracking DSN https://...@sentry.io/...Never commit
.envto version control. It is already listed in.gitignore. -
Start Development Server
npm run dev # or yarn dev # or pnpm dev
- Search Existing Issues: Check if the issue has already been reported
- Use Templates: Use the appropriate issue template
- Provide Details: Include steps to reproduce, expected vs actual behavior
- Add Screenshots: Include screenshots for UI issues
- Environment Info: Include OS, browser, and Node.js version
-
Create a Branch
git checkout -b feature/your-feature-name # or git checkout -b fix/your-bug-fix -
Make Your Changes
- Follow the code style guidelines
- Write clean, readable code
- Add tests for new functionality
- Update documentation if needed
-
Test Your Changes
# Run tests npm test # Run type checking npm run type-check # Run linting npm run lint # Build the project npm run build
-
Commit Your Changes
git add . git commit -m "feat: add your feature description"
-
Push to Your Fork
git push origin feature/your-feature-name
-
Create Pull Request
- Use descriptive title and description
- Link related issues
- Add screenshots for UI changes
- Request review from maintainers
We welcome contributions in the following areas:
- Property browsing and search functionality
- Wallet connection and Web3 integration
- Smart contract interactions
- Portfolio management
- Transaction history
- Component library enhancements
- Responsive design fixes
- Accessibility improvements
- Performance optimizations
- Design system updates
- Code refactoring and optimization
- Testing coverage improvements
- Documentation updates
- Build process enhancements
- Security improvements
- API documentation
- Component documentation
- Tutorial creation
- Translation contributions
- README improvements
We use the following tools to maintain code quality:
- ESLint: JavaScript/TypeScript linting
- Prettier: Code formatting
- TypeScript: Type safety
- Husky: Git hooks for pre-commit checks
Auto-format before committing:
npm run lint -- --fix # auto-fix ESLint issuesPrettier config (.prettierrc or prettier.config.js):
- Single quotes for strings
- 2-space indentation
- Trailing commas in multi-line structures
- 100-character line length limit
TypeScript rules:
- Prefer
interfaceovertypefor object shapes - Always type function return values explicitly for exported functions
- Avoid
anyβ useunknownand narrow with type guards instead - Use
constassertions (as const) for literal tuples and objects
React-specific rules:
- One component per file
- Prefer named exports over default exports for components
- Use
React.FC<Props>or explicit return type annotations - Extract complex logic into custom hooks rather than inline in components
- Components: PascalCase (
PropertyCard.tsx) - Files: kebab-case for utilities (
property-utils.ts) - Variables: camelCase (
propertyData) - Constants: UPPER_SNAKE_CASE (
API_BASE_URL) - Types: PascalCase (
PropertyType)
// Good component example
interface PropertyCardProps {
property: Property;
onPurchase?: (property: Property) => void;
}
export const PropertyCard: React.FC<PropertyCardProps> = ({
property,
onPurchase,
}) => {
return (
<div className="property-card">
{/* Component content */}
</div>
);
};
export default PropertyCard;We follow Conventional Commits specification:
feat:New featuresfix:Bug fixesdocs:Documentation changesstyle:Code style changes (formatting, etc.)refactor:Code refactoringtest:Adding or updating testschore:Build process or dependency changes
Examples:
feat: add property search functionality
fix: resolve wallet connection issue
docs: update API documentation
test: add unit tests for property service
- Unit Tests: Test individual functions and components
- Integration Tests: Test component interactions
- E2E Tests: Test user workflows
- Visual Tests: Test UI consistency
// Example unit test
import { render, screen } from '@testing-library/react';
import { PropertyCard } from './PropertyCard';
describe('PropertyCard', () => {
const mockProperty = {
id: '1',
name: 'Test Property',
price: '100000',
// ... other properties
};
it('renders property information correctly', () => {
render(<PropertyCard property={mockProperty} />);
expect(screen.getByText('Test Property')).toBeInTheDocument();
expect(screen.getByText('$100,000')).toBeInTheDocument();
});
});# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Run tests with coverage
npm run test:coverage
# Run E2E tests
npm run test:e2eBefore opening a PR, run the full test suite locally to catch issues early:
# 1. Unit and integration tests (Jest)
npm test
# 2. Type checking (no emitted output)
npm run type-check
# 3. Linting
npm run lint
# 4. End-to-end tests (Playwright) β requires a running dev server
npm run dev & # start dev server in background
npm run test:e2e # run Playwright tests
kill %1 # stop dev server
# 5. Build check β ensures the production bundle compiles cleanly
npm run buildCoverage requirements: PRs must not decrease overall coverage below the current threshold. Check the current threshold in jest.config.js under coverageThreshold.
Running a single test file:
npx jest src/hooks/useTransaction.test.tsDebugging a failing test:
npx jest --verbose --no-coverage src/path/to/test.tsWe use a consistent design system based on:
- Tailwind CSS for styling
- Headless UI for accessible components
- Lucide React for icons
- Custom design tokens for consistency
- Follow the established color palette
- Use consistent spacing and typography
- Ensure accessibility (WCAG 2.1 AA)
- Test on multiple screen sizes
- Use semantic HTML elements
When working with Web3 features:
- Test with multiple wallet providers
- Handle connection errors gracefully
- Provide clear user feedback
- Support multiple networks
- Implement proper error boundaries
- Use type-safe contract interfaces
- Handle transaction states properly
- Provide gas estimates
- Implement transaction monitoring
- Handle network switching
Before adding new dependencies:
- Check if existing dependencies can solve the problem
- Prefer smaller, focused packages
- Check for security vulnerabilities
- Update documentation if needed
# Install production dependency
npm install package-name
# Install development dependency
npm install --save-dev package-name
# Install exact version
npm install package-name@1.2.3- All tests pass
- Build completes successfully
- Environment variables are configured
- Performance budgets are met
- Accessibility checks pass
- Security scans are clean
# Build for production
npm run build
# Analyze bundle size
npm run analyze
# Start production server
npm startWe are committed to providing a welcoming and inclusive environment. Please read our Code of Conduct and follow it in all interactions.
- GitHub Issues: For bug reports and feature requests
- Discussions: For general questions and ideas
- Email: frontend@propchain.io for private matters
Contributors are recognized in:
- README.md contributors section
- Release notes
- Annual contributor highlights
- Special contributor badges
All PRs go through the following review process:
- Automated Checks: CI/CD pipeline validation
- Code Review: Maintainer review for code quality
- Design Review: UI/UX review for frontend changes
- Testing Review: Test coverage and quality check
- Documentation Review: Documentation updates
When reviewing a PR, maintainers check:
- Code follows the project's style guide and naming conventions
- New logic is covered by unit or integration tests
- No
console.logor debug statements left in production code - Accessibility requirements are met (WCAG 2.1 AA)
- No new
anytypes introduced without justification - Breaking changes are documented and versioned appropriately
- Environment variables are documented in
.env.example - PR description links to the relevant issue(s)
- Address each comment with either a code change or a reply explaining why no change is needed
- Mark resolved threads as resolved after addressing them
- Request a re-review once all feedback has been addressed
- Avoid force-pushing after a review has started β use new commits instead
- All tests must pass
- Code coverage must not decrease
- No breaking changes without proper version bump
- Documentation must be updated
- At least one maintainer approval
PropChain Frontend uses Release Please for automated releases based on Conventional Commits.
- Commits to
mainfollowing the Conventional Commits spec are automatically parsed - Release Please opens a release PR that bumps the version and updates
CHANGELOG.md - Merging the release PR triggers a GitHub Actions workflow that:
- Creates a Git tag (e.g.
v1.2.0) - Publishes a GitHub Release with auto-generated release notes
- Deploys to the production environment
- Creates a Git tag (e.g.
| Commit type | Version bump |
|---|---|
fix: |
Patch (1.0.x) |
feat: |
Minor (1.x.0) |
feat!: or BREAKING CHANGE: footer |
Major (x.0.0) |
For urgent production fixes:
# 1. Branch from the latest release tag
git checkout -b hotfix/v1.2.1 v1.2.0
# 2. Apply the fix and commit with conventional format
git commit -m "fix: resolve critical wallet connection crash"
# 3. Open a PR targeting main (and cherry-pick to release branch if needed)- GitHub Contributors recognition
- Early access to new features
- Special Discord role and channel access
- PropChain merchandise for significant contributions
- Speaking opportunities at community events
- Contributor: 1+ merged PRs
- Active Contributor: 5+ merged PRs
- Core Contributor: 20+ merged PRs
- Maintainer: Trusted team member with merge access
- GitHub Issues: Create an issue
- GitHub Discussions: Start a discussion
- Email: frontend@propchain.io
- Discord: Join our community
Join our weekly contributor office hours:
- When: Every Thursday, 2:00 PM - 4:00 PM UTC
- Where: Discord voice channel
- What: Get help with contributions, ask questions, meet the team
Thank you for contributing to PropChain Frontend! Your contributions help make decentralized real estate accessible to everyone.
Every contribution, no matter how small, makes a difference. We appreciate your time and effort in improving our platform.
Happy coding! π
Made with β€οΈ by the PropChain Team