Files
peertube-mobile/CONTRIBUTING.md

91 lines
3.9 KiB
Markdown

# Contribute to the PeerTube mobile app
Thank you for your interest in contributing to the PeerTube mobile app! We welcome all kinds of contributions - whether it's code, documentation, translations, bug reports, suggestions or ideas for improving the app.
## Table of Contents
- [💬 Translate the app](#-translate-the-app)
- [🐛 Reporting bugs](#-reporting-bugs)
- [🛠️ How to contribute to the code](#-how-to-contribute-to-the-code)
- [🧹 Code style guide](#-code-style-guide)
- [🚀 Running the app locally](#-running-the-app-locally)
- [🧱 Code architecture](#-code-architecture)
- [🌼 Flavors](#-flavors)
## 💬 Translate the app
You can help translate the PeerTube mobile interface into different languages.
Please refer to [the official translation guide](https://docs.joinpeertube.org/support/doc/translation) for instructions on how to get started.
## 🐛 Reporting bugs
Before opening a new issue:
- Check to see if the problem has already been reported.
- If not, open a new [issue](https://framagit.org/framasoft/peertube/mobile-application/-/issues) using the appropriate template.
- Provide a clear, concise title and include as much relevant detail as possible to help us understand and reproduce the problem.
- Ensure you use the provided template for reporting bugs.
## 🛠️ How to contribute to the code
1. Fork the repository.
2. Create a new branch and name it as clearly as possible:
- For a feature: `git checkout -b feature/your-feature-name`
- For a bugfix: `git checkout -b fix/your-bug-name`
3. Make your changes.
4. Write or update tests if necessary.
5. Commit and push your changes.
6. Open a merge request (MR) and describe your contribution.
## 🧹 Code style guide
Please follow the official [Flutter Style Guide](https://docs.flutter.dev/development/tools/formatting).
- Run `dart format .` to format your code.
- Run `flutter analyze` to check for issues.
- Use [Riverpod](https://riverpod.dev) as the state management solution.
- Write unit and widget tests when applicable.
## 🚀 Running the app locally
To run the app on your machine:
Install Flutter first so your local SDK matches the version declared in [pubspec.yaml](pubspec.yaml).
```bash
git clone your-fork-url
cd your-repo
flutter pub get
dart run build_runner build --delete-conflicting-outputs
flutter run
```
## 🧱 Code architecture
We follow a **feature-first** architecture to keep things modular and scalable.
```bash
lib/
├── features/ # Domain-specific logic grouped by feature
├── l10n/ # Localization files
├── routes/ # Screens and navigation
├── shared/ # Reusable utilities, models, services, and helpers
└── main.dart # App entry point
```
Each folder in `lib/features/` (e.g., `account`, `video`, `platform`, `filters`) contains its models, providers, services, widgets, and screens organized in a logical and consistent way.
Shared functionality (e.g., authentication, filters, configuration, theming) is placed under `lib/shared/`, and is used across multiple features.
Routing-related screens and helpers are stored in `lib/routes/`.
Localization files can be found in `lib/l10n/`, using the standard ARB format supported by Flutter. Translations are managed via [Weblate](https://docs.joinpeertube.org/support/doc/translation), where contributors can help translate the app directly online.
## 🌼 Flavors
The project defines two main build flavors:
- `nightly`: Used for builds on the develop branch and generates [an APK file](https://builds.joinpeertube.org/mobile/peertube_nightly.apk).
- `stable`: Used for production-ready, stable releases.
Environment-specific variables are defined in separate JSON files:
- `env-nightly.json` for the `nightly` flavor
- `env-stable.json` for the `stable` flavor
---
Feel free to open an issue if anything is unclear or if you have any questions before contributing.