Thank you for your interest in contributing to Pacto P2P! This document provides guidelines and instructions for contributing to our project.
- Code of Conduct
- Getting Started
- Development Workflow
- Coding Standards
- Pull Request Process
- Reporting Issues
- Feature Requests
We are committed to providing a welcoming and inclusive environment for all contributors, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
- Be respectful: Treat everyone with respect and kindness
- Be inclusive: Welcome newcomers and help them get started
- Be constructive: Provide helpful feedback and suggestions
- Be patient: Understand that everyone has different levels of experience
- Be collaborative: Work together to build something great
- Harassment, discrimination, or offensive comments
- Personal attacks or trolling
- Publishing others' private information without permission
- Other conduct that could reasonably be considered inappropriate in a professional setting
Project maintainers are responsible for clarifying and enforcing our standards of acceptable behavior. They may remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned with this Code of Conduct.
- Node.js 18+ and npm 9+
- Git
- A code editor (VS Code recommended)
- Basic knowledge of TypeScript, React, and Next.js
- Fork the repository on GitHub
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/pacto-p2p.git cd pacto-p2p - Add upstream remote:
git remote add upstream https://github.com/ORIGINAL_OWNER/pacto-p2p.git
- Install dependencies:
npm install
- Build all packages:
npm run build
- Start development server:
npm run dev
For more detailed setup instructions, see docs/DEVELOPMENT.md.
Use descriptive branch names that indicate the type of change:
feature/description- New featuresfix/description- Bug fixesdocs/description- Documentation changesrefactor/description- Code refactoringtest/description- Test additions or changeschore/description- Maintenance tasks
Examples:
feature/add-payment-methodfix/escrow-status-displaydocs/update-api-documentation
-
Create a new branch from
main:git checkout -b feature/your-feature-name
-
Make your changes following our coding standards
-
Test your changes:
npm run type-check npm run biome:check npm run build
-
Commit your changes using Conventional Commits:
git add . git commit -m "feat: add new payment method selector"
-
Keep your branch updated:
git fetch upstream git rebase upstream/main
-
Push to your fork:
git push origin feature/your-feature-name
- Use TypeScript strictly: Avoid
anytypes - Define types explicitly: Import types from
@pacto-p2p/typeswhen available - Use proper type definitions: Define types in
packages/typesfor shared types - Follow existing patterns: Maintain consistency with the codebase
- Use functional components: Prefer arrow functions with explicit type annotations
- Follow Next.js patterns: Use App Router conventions (see docs/nextjs-patterns.mdc)
- Component organization: Split large components into smaller, reusable ones
- Event handlers: Name them with
handleprefix (e.g.,handleClick,handleSubmit)
- Use Biome: Follow Biome formatting and linting rules
- Run formatter: Always run
npm run biome:formatbefore committing - Naming conventions:
camelCasefor variables and functionsPascalCasefor components and typesUPPER_SNAKE_CASEfor constants
- Keep related code together: Group by feature or functionality
- Use index.ts files: For clean exports
- Follow monorepo structure: Place code in appropriate packages (see docs/DEVELOPMENT.md)
// ✅ Good
import { Button } from '@pacto-p2p/ui';
import type { Escrow } from '@pacto-p2p/types';
export const EscrowCard: React.FC<EscrowCardProps> = ({ escrow }) => {
const handleClick = () => {
// Handle click
};
return (
<Card>
<Button onClick={handleClick}>View Details</Button>
</Card>
);
};
// ❌ Bad
import { Button } from '@pacto-p2p/ui';
export function EscrowCard(props: any) {
function click() {
// Handle click
}
return (
<Card>
<Button onClick={click}>View Details</Button>
</Card>
);
}- Ensure your code works: Test thoroughly
- Run quality checks:
npm run type-check npm run biome:check npm run biome:format npm run build
- Update documentation: If you've changed APIs or added features
- Write clear commit messages: Follow Conventional Commits
-
Push your branch to your fork
-
Create a PR on GitHub with:
- Clear title: Use conventional commit format (e.g.,
feat: add payment method selector) - Description: Explain what changes you made and why
- Related issues: Link any related issues
- Screenshots: If applicable, include screenshots or GIFs
- Clear title: Use conventional commit format (e.g.,
-
PR Template: Fill out all sections of the PR template
- Automated checks: All CI checks must pass
- Code review: At least one maintainer must approve
- Address feedback: Make requested changes and push updates
- Keep PR updated: Rebase on
mainif conflicts arise
- Maintainers will merge your PR
- Your changes will be included in the next release
- Thank you for contributing! 🎉
When reporting bugs, please include:
- Clear description: What happened vs. what you expected
- Steps to reproduce: Detailed steps to reproduce the issue
- Environment:
- Node.js version
- npm version
- Operating system
- Browser (if applicable)
- Screenshots: If applicable
- Error messages: Full error messages and stack traces
- Minimal reproduction: If possible, provide a minimal code example
Do not open public issues for security vulnerabilities. Instead, email security concerns to the maintainers privately.
When requesting features:
- Check existing issues: Make sure the feature hasn't been requested
- Describe the problem: What problem does this feature solve?
- Propose a solution: How should this feature work?
- Consider alternatives: Are there other ways to solve this?
- Provide examples: Show how the feature would be used
We follow Conventional Commits:
<type>(<scope>): <subject>
<body>
<footer>
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changes (formatting, etc.)refactor: Code refactoringtest: Adding or updating testschore: Maintenance tasks
feat(escrow): add payment method selector component
Adds a new component for selecting payment methods in the escrow flow.
Includes validation and error handling.
Closes #123
fix(wallet): resolve connection timeout issue
Fixes an issue where wallet connections would timeout after 30 seconds.
Now properly handles connection retries.
Fixes #456
# Run all tests
npm test
# Run tests in watch mode
npm test -- --watch
# Run tests for specific package
npm test --workspace=@pacto-p2p/shared- Write tests for new features
- Ensure existing tests pass
- Aim for good test coverage
- Test edge cases and error scenarios
- Update relevant docs when making changes
- Add JSDoc comments for public APIs
- Update examples if APIs change
- Keep documentation clear and concise
README.md: Project overview and quick startdocs/DEVELOPMENT.md: Development guidedocs/DATABASE_SCHEMA.md: Database schema documentation.cursor/rules/: Code patterns and conventions
- Documentation: Check docs/DEVELOPMENT.md
- Issues: Search existing issues or create a new one
- Discussions: Use GitHub Discussions for questions
Your contributions make Pacto P2P better for everyone. We appreciate your time and effort!
Remember: Be respectful, be patient, and have fun contributing! 🚀