Thank you for your interest in contributing to the Ajo decentralized savings platform. This guide outlines the standards and processes to follow when contributing to the project.
This project is a monorepo consisting of:
- Smart contracts written in Rust (Soroban)
- Backend API built with Node.js and Express
- Frontend application built with Next.js and TypeScript
Contributions should maintain consistency, security, and code quality across all parts of the system.
- Node.js 20+
- Rust 1.70+
- Stellar CLI
- Git
# Fork the repository and clone your fork
git clone https://github.com/<your-username>/soroban-ajo.git
cd soroban-ajo
# Install dependencies
npm run install:all
# Set up environment variables
cp backend/.env.example backend/.env
cp frontend/.env.example frontend/.env.local- Create a new branch from
master:
git checkout -b feat/<short-description>-
Make your changes following the project standards
-
Run all checks locally:
npm run lint
npm run type-check
npm run test:contracts-
Commit your changes using clear commit messages
-
Push your branch and open a Pull Request
- Use clear and descriptive variable and function names
- Keep functions small and focused
- Avoid unnecessary complexity
- Write self-documenting code where possible
-
Use TypeScript for all components and logic
-
Follow React best practices:
- Functional components only
- Use hooks appropriately
-
Keep components modular and reusable
-
Use consistent file and folder naming
cd frontend
npm run lint- Use TypeScript for all backend code
- Validate inputs using Zod
- Use async/await instead of callbacks
- Keep controllers thin and move logic into services
- Handle errors consistently
cd backend
npm run lint
npm run type-check- Follow Rust best practices
- Avoid panics in production logic
- Use explicit error handling
- Validate all inputs
cd contracts/ajo
# Format code
cargo fmt
# Run tests
cargo testAll contributions must include appropriate tests.
- Unit tests are required for all contract logic
- Cover edge cases and invalid inputs
- Ensure no unexpected panics
npm run test:contracts- Ensure type safety
- Validate all inputs
- Add tests where applicable
cd backend
npm run type-check
npm run lint- Ensure components render correctly
- Avoid breaking UI or state flows
- Maintain type safety
cd frontend
npm run type-check
npm run lintEnsure that:
- Code passes all lint checks
- Type checks pass
- Contract tests pass
- No sensitive data is included
- Code follows project structure and conventions
-
Use clear and descriptive titles:
feat: add dispute voting UIfix: handle invalid contribution inputdocs: add security best practices guide
-
Provide a detailed description:
- What was changed
- Why it was changed
- Any relevant context or screenshots
-
Keep PRs focused and small where possible
- Maintainers will review your PR
- You may be asked to make changes
- Once approved, your PR will be merged
Use the following formats:
feat/<feature-name>fix/<bug-description>docs/<documentation-update>chore/<maintenance-task>
Follow a simple conventional format:
type: short description
Examples:
feat: implement arbitration voting systemfix: prevent double withdrawaldocs: update contributing guide
- Do not expose secrets or private keys
- Validate all user inputs
- Follow the security best practices guide
- Report vulnerabilities responsibly
- Update documentation when introducing new features
- Keep README and relevant docs in sync with changes
- Write clear and concise explanations
If you have questions:
- Open an issue for discussion
- Ask for clarification in your Pull Request
To contribute successfully:
- Follow coding standards
- Write tests
- Keep changes focused
- Document your work clearly
Consistent, high-quality contributions help keep the project reliable and maintainable.