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 configuration -
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
- 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:e2eWe 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
- 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
- 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