Getting Started
Thank you for considering contributing to ZeroLimit! This guide will help you get started with the development workflow.Prerequisites
Before contributing, ensure you have:- Read the Building from Source guide
- Set up your development environment
- Familiarized yourself with the Project Structure
- Read this contributing guide thoroughly
Development Workflow
1. Fork and Clone
2. Create a Feature Branch
feature/- New featuresfix/- Bug fixesdocs/- Documentation changesrefactor/- Code refactoringchore/- Maintenance tasks
3. Make Your Changes
Write Code
Follow the coding style and naming conventions outlined below.
4. Commit Your Changes
ZeroLimit uses Conventional Commits for clear, standardized commit messages.Commit Message Format
Commit Types
feat- New featurefix- Bug fixdocs- Documentation changesrefactor- Code refactoring (no functional changes)style- Code style/formatting changestest- Add or update testschore- Maintenance tasks (dependencies, build, etc.)perf- Performance improvements
Scope Examples
feat(providers)- Provider-related featurefix(auth)- Authentication bug fixdocs(README)- README updaterefactor(dashboard)- Dashboard code refactoringchore(deps)- Dependency update
Real Examples from ZeroLimit History
Commit Best Practices
- Keep commits focused: One logical change per commit
- Write descriptive messages: Explain why, not just what
- Use imperative mood: “add feature” not “added feature”
- Reference issues: Include issue numbers when applicable (e.g.,
fixes #123) - Prefer multiple small commits over one large commit
5. Push and Create Pull Request
PR Title
PR Title
Use the same format as commit messages:
PR Description
PR Description
Include:
- Summary: Brief overview of changes (1-3 bullet points)
- Motivation: Why this change is needed
- Testing: How you tested the changes
- Screenshots: For UI changes (before/after)
- Related Issues: Link to any related issues
Example PR Description
Coding Style
General Principles
- Clarity over cleverness: Write code that’s easy to understand
- Consistency: Follow existing patterns in the codebase
- Type safety: Leverage TypeScript’s type system
- Documentation: Add comments for complex logic
Formatting
Automated formatting with Prettier:- Indentation: 2 spaces (not tabs)
- Line endings: LF (Unix-style)
- Encoding: UTF-8
- Semicolons: No (except where required)
- Quotes: Single quotes for strings
- Trailing whitespace: Trimmed automatically
- Final newline: Required
.editorconfig- Editor settings.prettierrc- Prettier rules.prettierignore- Files to skip
Naming Conventions
| Element | Convention | Example |
|---|---|---|
| React Components | PascalCase | DashboardPage, QuotaCard |
| Hooks | camelCase with use prefix | useQuotaStore, useDashboardPresenter |
| Functions | camelCase | fetchQuota, calculateUsage |
| Variables | camelCase | quotaData, isLoading |
| Constants | UPPER_SNAKE_CASE | API_BASE_URL, MAX_RETRIES |
| Types/Interfaces | PascalCase | QuotaData, ProviderConfig |
| Files | Match export | DashboardPage.tsx, quota.store.ts |
| Rust modules | snake_case | cli_proxy, file_utils |
TypeScript Guidelines
- Prefer interfaces over type aliases for object shapes
- Use explicit types for function parameters and return values
- Avoid
any: Useunknownor proper types - Enable strict mode: Already configured in
tsconfig.json
React Best Practices
- Functional components with hooks (no class components)
- Custom hooks for reusable logic
- Presenter pattern for complex business logic (see
useDashboardPresenter) - Zustand stores for global state, not prop drilling
- Meaningful component names: Descriptive and specific
Rust Guidelines
- Follow Rust conventions:
cargo fmtandcargo clippy - Error handling: Use
Resultand?operator - Async functions: Use
async fnwith Tokio runtime - Tauri commands: Document parameters and return types
Testing
Manual Testing
Currently, ZeroLimit relies on manual testing:- Build check: Run
pnpm run build- must succeed without errors - Development smoke test: Run
pnpm run tauri devand verify:- Application launches successfully
- UI renders correctly
- Features work as expected
- No console errors
- Cross-platform: Test on Windows, macOS, and Linux if possible
Future: Automated Tests
If you add automated tests:- Co-locate tests with the code:
ComponentName.test.tsx - Naming: Use
.test.ts(x)or.spec.ts(x)suffix - Coverage: Focus on critical business logic
Pull Request Review Process
What to Expect
- Automated checks: CI/CD workflows will run (if configured)
- Code review: Maintainers will review your code
- Feedback: You may be asked to make changes
- Approval: Once approved, your PR will be merged
Review Criteria
- Code quality: Follows style guidelines and best practices
- Functionality: Works as intended, no regressions
- Testing: Properly tested (manual or automated)
- Documentation: Code is well-documented, user docs updated if needed
- Commit history: Clean, logical commits with good messages
Addressing Feedback
Security Considerations
- Review OAuth flows: Test on all platforms when modifying authentication
- Updater changes: Ensure auto-update mechanism remains secure
- File operations: Validate paths and permissions when touching filesystem code
- Dependency updates: Check for known vulnerabilities
Communication
Reporting Issues
Use GitHub Issues with the provided templates:- Bug reports: Include steps to reproduce, expected vs actual behavior, screenshots
- Feature requests: Describe the use case and proposed solution
Questions and Discussion
- GitHub Discussions: For general questions and ideas
- Pull Request comments: For code-specific discussions
License
By contributing, you agree that your contributions will be licensed under the MIT License.Quick Reference
Common Commands
Commit Template
Before Submitting PR
- Code follows style guidelines
- Ran
pnpm run buildsuccessfully - Tested in
pnpm run tauri dev - Commit messages follow Conventional Commits
- PR description includes summary and testing notes
- Screenshots included (for UI changes)
- No sensitive data committed
Need Help?
Open an issue or discussion on GitHub if you have questions!