diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..b85509b --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,213 @@ +# ๐Ÿค Contributing to Ell-ena + +Thank you for your interest in contributing to Ell-ena! This guide will help you get set up quickly and contribute effectively. + +--- +## Table of Contents + +- [Quick Start](#-quick-start) +- [Prerequisites](#-prerequisites) +- [Setup Instructions](#-setup-instructions) +- [Project Structure](#-project-structure) +- [Development Workflow](#-development-workflow) +- [Code Style](#-code-style) +- [Reporting Issues](#-reporting-issues) +- [Pull Request Guidelines](#-pull-request-guidelines) +- [Common Issues & Fixes](#common-issues--fixes) +--- + +## โšก Quick Start +```bash +git clone https://github.com/AOSSIE-Org/Ell-ena.git +cd Ell-ena +flutter pub get +cp .env.example .env # then fill in your credentials +flutter run +``` +> โš ๏ธ If `.env.example` is missing, create `.env` manually using the variables below. +--- +## ๐Ÿ“‹ Prerequisites + +Ensure the following are installed before you begin: + +| Tool | Notes | +|------|-------| +| Flutter | Latest stable โ€” run `flutter --version` to check | +| Dart | Bundled with Flutter | +| Git | Any recent version | +| IDE | Android Studio or VS Code (with Flutter extension) | +| Device | Emulator or physical device | + +--- + +## ๐Ÿš€ Setup Instructions + +### 1. Fork and Clone + +Fork the repo on GitHub, then clone your fork: + +```bash +git clone https://github.com//Ell-ena.git +cd Ell-ena +``` + +### 2. Install Dependencies + +```bash +flutter pub get +``` + +### 3. Configure Environment + +Copy the example env file and fill in your credentials: + +```bash +cp .env.example .env +``` + +```env +SUPABASE_URL=your_supabase_url +SUPABASE_ANON_KEY=your_supabase_anon_key +``` + +> โš ๏ธ Use your own Supabase project credentials. +> ๐Ÿšซ Never commit `.env` โ€” it is already listed in `.gitignore`. + +### 4. Run the App + +```bash +flutter run +``` + +--- + +## ๐Ÿ“ Project Structure +```text +Ell-ena/ +โ”œโ”€โ”€ lib/ +โ”‚ โ”œโ”€โ”€ main.dart # Entry point +โ”‚ โ”œโ”€โ”€ screens/ # UI screens +โ”‚ โ”œโ”€โ”€ widgets/ # Reusable widgets +โ”‚ โ”œโ”€โ”€ services/ # Supabase & API logic +โ”‚ โ””โ”€โ”€ models/ # Data models +โ”œโ”€โ”€ test/ # Unit & widget tests +โ”œโ”€โ”€ .env.example # Environment variable template +โ””โ”€โ”€ pubspec.yaml # Dependencies +``` + +> Adjust this structure to match the actual project layout if it differs. + +--- + +## ๐Ÿ”„ Development Workflow + +1. Sync your fork with the upstream `main` branch before starting: + ```bash + git remote add upstream https://github.com/AOSSIE-Org/Ell-ena.git + git fetch upstream + git checkout main && git merge upstream/main + ``` +2. Create a focused branch for your change: + ```bash + git checkout -b feature/your-feature-name + # or + git checkout -b fix/your-bug-name + ``` +3. Make your changes, keeping commits small and descriptive. +4. Push and open a Pull Request. + +--- + +## ๐Ÿงช Code Style + +Run both commands before every commit: + +```bash +flutter analyze # catch errors & lint warnings +flutter format . # auto-format all Dart files +``` + +**Additional conventions:** + +- Follow the [Effective Dart](https://dart.dev/guides/language/effective-dart) guidelines. +- Keep widgets small and composable. +- Add comments for non-obvious logic. +- Always guard async calls with `mounted` checks: + ```dart + if (!mounted) return; + ``` + +--- + +## ๐Ÿ› Reporting Issues + +Before opening an issue: + +- Search [existing issues](https://github.com/AOSSIE-Org/Ell-ena/issues) to avoid duplicates. +- Try reproducing on the latest `main` branch. + +When filing a bug report, include: + +- Flutter version (`flutter --version`) +- Steps to reproduce +- Expected vs. actual behavior +- Screenshots or logs if relevant + +Use the `bug` label for bugs and `enhancement` for feature requests. + +--- + +## ๐Ÿ“ฌ Pull Request Guidelines + +- **One concern per PR** โ€” keep it focused. +- **Link the related issue** in the PR description (e.g., `Closes #42`). +- **Pass CI** โ€” ensure `flutter analyze` and `flutter format .` produce no errors. +- **Write a clear description** โ€” what changed and why. +- **Be responsive** โ€” address review feedback promptly. + +PR title format: + +``` +feat: add dark mode toggle +fix: resolve login crash on Android 12 +docs: update setup instructions +``` + +--- + +## โš ๏ธ Common Issues & Fixes + +### App not compiling + +```bash +flutter clean +flutter pub get +``` + +### Missing `.env` file + +Make sure `.env` exists in the root directory with valid values. See [Setup Instructions](#3-configure-environment). + +### Flutter version mismatch + +```bash +flutter upgrade +``` + +### Supabase errors + +- Verify `.env` values match your Supabase project dashboard. +- Ensure your Supabase project is not paused (free tier pauses after inactivity). + +### Async context warnings + +```dart +if (!mounted) return; +``` + +--- + +## ๐Ÿ™ Thank You + +Every contribution โ€” bug reports, docs, code, or feedback โ€” makes Ell-ena better. +If you have questions, open a [GitHub Discussion](https://github.com/AOSSIE-Org/Ell-ena/discussions) or comment on the relevant issue.