Thank you for your interest in contributing to Familiarise Mobile. This document provides guidelines and instructions for contributing to the project.
- Prerequisites
- Development Setup
- Branch Naming Conventions
- Commit Message Format
- Pull Request Process
- Code Style
- Testing Requirements
- Review Process
Before contributing, ensure you have:
- Flutter SDK 3.24.x or higher installed
- Dart SDK 3.5.x (bundled with Flutter)
- A working development environment (see README.md for setup)
- Familiarity with the project architecture (see CLAUDE.md)
-
Fork the repository to your GitHub account
-
Clone your fork:
git clone https://github.com/YOUR_USERNAME/familiarise_mobile.git cd familiarise_mobile -
Add upstream remote:
git remote add upstream https://github.com/your-org/familiarise_mobile.git
-
Install dependencies and generate code:
flutter pub get dart run build_runner build --delete-conflicting-outputs
-
Create a feature branch:
git checkout -b feature/your-feature-name
Use the following prefixes for branch names:
| Prefix | Purpose | Example |
|---|---|---|
feature/ |
New features | feature/add-dark-mode |
bugfix/ |
Bug fixes | bugfix/fix-login-crash |
hotfix/ |
Urgent production fixes | hotfix/critical-payment-error |
refactor/ |
Code refactoring | refactor/simplify-auth-flow |
docs/ |
Documentation updates | docs/update-readme |
test/ |
Test additions/updates | test/add-booking-tests |
chore/ |
Maintenance tasks | chore/update-dependencies |
Rules:
- Use lowercase letters
- Use hyphens to separate words
- Keep names concise but descriptive
- Include ticket/issue number if applicable:
feature/123-add-notifications
Follow the Conventional Commits specification:
<type>(<scope>): <description>
[optional body]
[optional footer(s)]
| Type | Description |
|---|---|
feat |
New feature |
fix |
Bug fix |
docs |
Documentation changes |
style |
Code style changes (formatting, semicolons, etc.) |
refactor |
Code refactoring (no feature or bug fix) |
perf |
Performance improvements |
test |
Adding or updating tests |
chore |
Maintenance tasks (dependencies, build, etc.) |
Use feature module names or general areas:
auth,onboarding,booking,checkout,dashboard,explore,meetings,chat,profilecore,data,domain,sharedbackend,ci,deps
feat(onboarding): add profile image picker
fix(auth): resolve Google Sign-In crash on Android
refactor(booking): simplify slot selection logic
docs(readme): update installation instructions
chore(deps): upgrade riverpod to 2.5.1
- Use imperative mood ("add" not "added" or "adds")
- Don't capitalize the first letter of the description
- No period at the end of the description
- Keep the first line under 72 characters
- Use the body for additional context when needed
-
Sync with upstream:
git fetch upstream git rebase upstream/dev
-
Run static analysis:
flutter analyze
Ensure there are no warnings or errors.
-
Run tests:
flutter testAll tests must pass.
-
Format code:
dart format lib test -
Regenerate code if needed:
dart run build_runner build --delete-conflicting-outputs
-
Push your branch:
git push origin feature/your-feature-name
-
Create a Pull Request:
- Target branch:
dev(notmain) - Use a clear, descriptive title
- Fill out the PR template completely
- Link related issues
- Target branch:
-
PR Description should include:
- Summary of changes
- Screenshots/recordings for UI changes
- Testing steps
- Breaking changes (if any)
## Summary
Brief description of changes
## Changes
- Change 1
- Change 2
## Screenshots (if applicable)
[Add screenshots here]
## Testing
- [ ] Unit tests added/updated
- [ ] Manual testing completed
- [ ] No regressions introduced
## Checklist
- [ ] Code follows project style guidelines
- [ ] Self-review completed
- [ ] Documentation updated (if needed)
- [ ] No new warnings from `flutter analyze`Follow the project's coding standards documented in docs/flutter-best-practices.md.
-
Use Riverpod with code generation:
@riverpod Future<List<User>> users(UsersRef ref) async { return ref.watch(userRepositoryProvider).getUsers(); }
-
Use Freezed for immutable state:
@freezed class UserState with _$UserState { const factory UserState.initial() = _Initial; const factory UserState.loading() = _Loading; const factory UserState.loaded(User user) = _Loaded; const factory UserState.error(String message) = _Error; }
-
Follow the repository pattern:
- Define interfaces in
domain/repositories/ - Implement in
data/repositories/
- Define interfaces in
-
Use
Result<T>(Either pattern) for error handling:Future<Result<User>> getUser(String id);
-
File organization within features:
features/ └── feature_name/ ├── providers/ # Riverpod providers ├── screens/ # Screen widgets ├── widgets/ # Feature-specific widgets └── utils/ # Feature utilities
The project uses strict analysis options. Run before committing:
flutter analyzeFix any issues before submitting your PR.
- Add unit tests for business logic
- Add widget tests for UI components
- Aim for meaningful test coverage
- Add a test that reproduces the bug
- Ensure the test passes with your fix
# All tests
flutter test
# Specific test file
flutter test test/features/auth/auth_provider_test.dart
# With coverage
flutter test --coveragetest/
├── features/
│ └── auth/
│ ├── auth_provider_test.dart
│ └── screens/
│ └── sign_in_screen_test.dart
├── data/
│ └── repositories/
│ └── auth_repository_test.dart
└── mocks/
└── mock_providers.dart
- Automated checks must pass (CI/CD pipeline)
- Code review by at least one maintainer
- Feedback will be provided via GitHub comments
- Address feedback by pushing additional commits
- Approval and merge by maintainer
- Code quality and readability
- Adherence to architecture patterns
- Test coverage
- Performance considerations
- Security implications
- Documentation completeness
If you have questions about contributing:
- Check existing documentation
- Search existing issues
- Open a new issue with the
questionlabel
Thank you for contributing to Familiarise Mobile!