Thank you for considering contributing to Readily Reads! This document outlines the process for contributing to this Flutter/Dart mobile application.
- Code of Conduct
- Getting Started
- Development Workflow
- Pull Request Process
- Dart and Flutter Coding Standards
- Commit Message Guidelines
- Testing Guidelines
- Documentation Guidelines
- Issue Reporting Guidelines
This project adheres to a Code of Conduct that all contributors are expected to follow. By participating, you agree to uphold this code. Please be respectful and considerate of others.
Before you begin, ensure you have set up the project by following the Getting Started Guide.
- Look for issues labeled with
good first issuefor newcomers - Check the GitHub issues for existing bugs and feature requests
- Feel free to suggest new features or improvements
-
Fork the repository on GitHub
-
Clone your fork locally:
git clone https://github.com/[your-username]/readily_reads.git cd readily_reads -
Add the original repository as an upstream remote:
git remote add upstream https://github.com/[original-owner]/readily_reads.git
Create a new branch for your feature or bugfix:
git checkout -b feature/your-feature-name # for features
# or
git checkout -b bugfix/your-bugfix-name # for bugfixesUse a descriptive name for your branch that reflects the changes you're making.
-
Make sure your Flutter SDK is up to date:
flutter upgrade
-
Get all dependencies:
flutter pub get
-
Follow the Dart and Flutter Coding Standards outlined below
-
Maintain consistency with the existing code style
-
Update documentation if necessary
-
Run linters and formatters before committing:
flutter analyze flutter format .
Regularly update your branch with changes from the upstream main branch:
git fetch upstream
git rebase upstream/mainResolve any merge conflicts that arise.
-
Push your branch to your fork:
git push origin feature/your-feature-name
-
Go to the original repository on GitHub
-
Click "New Pull Request"
-
Select your branch and fill out the PR template
Ensure your PR meets these requirements:
- The code builds without errors
- All tests pass (
flutter test) - Code has been analyzed (
flutter analyze) - Documentation is updated if necessary
- Code follows project style guidelines
- Commit messages follow guidelines
- Maintainers will review your PR
- Address any requested changes
- Once approved, a maintainer will merge your PR
- Your contribution will be part of the project!
- Write clean, readable, and maintainable code
- Follow Dart best practices and conventions
- Keep functions and methods small and focused
- Use meaningful variable and function names
- Add comments when necessary to explain complex logic
- Follow the official Dart style guide
- Use
lowerCamelCasefor variables and methods - Use
UpperCamelCasefor classes, enums, and typedefs - Use
snake_casefor file names - Keep line length to a maximum of 80 characters
- Extract reusable widgets to separate classes
- Keep widget trees clean and manageable
- Use
constconstructors when possible for better performance - Follow the existing app architecture pattern
- Follow Material Design guidelines for UI consistency
Readily Reads follows a file-per-screen organization pattern:
lib/
├── main.dart # App entry point
├── splash_screen.dart # Splash screen
├── login_page.dart # Login and registration
├── book_list_page.dart # Book listing
├── book_management_page.dart # Advanced book management
├── add_book_page.dart # Add book form
├── edit_book_page.dart # Edit book form
├── currently_reading_page.dart # Currently reading books
├── book_model.dart # Book data model and database
├── user_model.dart # User data model
└── user_session.dart # Session management
When adding new features:
- Consider creating new Dart files for major screens
- Place utility functions in appropriate files
- Maintain the existing organizational pattern
We follow the Conventional Commits specification:
<type>[optional scope]: <description>
[optional body]
[optional footer(s)]Types include:
feat: A new featurefix: A bug fixdocs: Documentation changesstyle: Changes that don't affect code functionality (formatting, etc.)refactor: Code changes that neither fix bugs nor add featurestest: Adding or updating testschore: Changes to build process or auxiliary tools
Examples:
feat(books): add book rating feature
fix(ui): resolve overflow in book list page
docs: update installation instructions
- Unit Tests: Test individual functions and classes
- Widget Tests: Test UI components
- Integration Tests: Test complete features or workflows
-
Create test files with the
_test.dartsuffix -
Place tests in the
test/directory matching the structure oflib/ -
Test both normal cases and edge cases
-
Mock dependencies to isolate the code under test
-
Use descriptive test names:
test('should show error message when login fails', () { // Test code });
# Run all tests
flutter test
# Run a specific test file
flutter test test/path/to/test_file.dart
# Run with coverage
flutter test --coverage-
Update documentation for any feature, API change, or other significant modification
-
Write clear, concise, and comprehensive documentation
-
Use proper Markdown formatting
-
Include code examples where appropriate
-
Add dartdoc comments to public APIs:
/// Returns all books for the specified user. /// /// Takes a [userId] parameter to filter books by user. /// Throws a [DatabaseException] if the database operation fails. Future<List<Book>> getAllBooks(int userId) async { // Implementation }
-
Check spelling and grammar
When reporting bugs, please include:
- A clear, descriptive title
- Steps to reproduce the issue
- Expected behavior
- Actual behavior
- Screenshots (if applicable)
- Device information:
- Device model
- Operating system version
- Flutter version (
flutter --version)
- Any additional context that might be helpful
For feature suggestions:
- Describe the feature clearly
- Explain why this feature would be useful
- Provide examples of how the feature would work
- Consider including mockups if it's a visual feature
Thank you for contributing to Readily Reads!