Contributing Guide
Welcome to contribute to the Evatar project! This document will help you quickly set up the development environment, understand code standards, and submission process.
Development Environment Setup
Fork and Clone
# 1. Fork the project repository on GitHub
# 2. Clone your fork
git clone https://github.com/<your-username>/evatar.git
cd evatar
# 3. Add upstream repository
git remote add upstream https://github.com/<original-owner>/evatar.git
# 4. Sync latest code from upstream
git fetch upstream
git rebase upstream/master
Code Standards
Python (Backend)
- Follow PEP 8 code style
- Use type hints for function parameters and return values
- Write docstrings explaining function purpose, especially for
services/modules - Use
loggingmodule, notprint()
Kotlin (Android)
- Follow Kotlin Coding Conventions
- UI layer uses Jetpack Compose declarative paradigm, ViewModel manages state
- Network requests use OkHttp + Gson
- Use Coroutines for async operations
TypeScript (Frontend)
- Use ESLint for code checking
- Functional style + Hooks for components
- Props defined via TypeScript
interface - Tailwind CSS atomic classes, no separate style files
Git Workflow
Branch Naming
| Prefix | Purpose | Example |
|---|---|---|
feat/ | New features | feat/push-notification |
fix/ | Bug fixes | fix/database-locked |
docs/ | Documentation | docs/deployment-guide |
refactor/ | Code refactoring | refactor/sync-service |
test/ | Testing | test/api-endpoints |
chore/ | Build/tools | chore/upgrade-deps |
Commit Messages
Use Conventional Commits format:
<type>(<scope>): <description>
Types: feat, fix, docs, style, refactor, test, chore
Scope suggestions: backend, frontend, android, wiki
Pull Request Process
- Ensure your branch is based on the latest
master - Ensure code passes checks:
- Backend:
cd backend && pytest tests/ -v - Frontend:
cd frontend && pnpm build - Android:
cd android && ./gradlew :app:assembleDebug
- Backend:
- Push branch to your Fork
- Create Pull Request on GitHub
First PR Suggestions
- Documentation improvements: Fix typos, add explanations, translate missing content
- Simple bug fixes: Check GitHub Issues for
good first issuelabels - Test coverage: Add test cases for existing API endpoints or service functions
- Internationalization: Supplement missing translations in
frontend/src/i18n/locales/