|
| 1 | +# Contributing to CollectorGO |
| 2 | + |
| 3 | +Thank you for your interest in contributing! This guide will help you get started. |
| 4 | + |
| 5 | +## 📋 Table of Contents |
| 6 | + |
| 7 | +- [Development Setup](#development-setup) |
| 8 | +- [Project Structure](#project-structure) |
| 9 | +- [Coding Standards](#coding-standards) |
| 10 | +- [Making Changes](#making-changes) |
| 11 | +- [Commit Messages](#commit-messages) |
| 12 | + |
| 13 | +--- |
| 14 | + |
| 15 | +## Development Setup |
| 16 | + |
| 17 | +### Prerequisites |
| 18 | + |
| 19 | +- **Node.js 20+** — for Dashboard & Mobile App |
| 20 | +- **Python 3.12+** — for Backend |
| 21 | +- **uv** — Python package manager ([install](https://docs.astral.sh/uv/)) |
| 22 | +- **PostgreSQL 16+** — database |
| 23 | +- **Expo CLI** — for mobile development |
| 24 | + |
| 25 | +### Backend |
| 26 | + |
| 27 | +```bash |
| 28 | +cd backend |
| 29 | +cp .env.example .env # configure your database URL |
| 30 | +uv sync --dev # install all dependencies |
| 31 | +uv run alembic upgrade head # run migrations |
| 32 | +uv run uvicorn app.main:app --reload |
| 33 | +``` |
| 34 | + |
| 35 | +### Dashboard |
| 36 | + |
| 37 | +```bash |
| 38 | +cd dashboard |
| 39 | +npm install |
| 40 | +npm run dev |
| 41 | +``` |
| 42 | + |
| 43 | +### Mobile App |
| 44 | + |
| 45 | +```bash |
| 46 | +cd app |
| 47 | +npm install |
| 48 | +npx expo start |
| 49 | +``` |
| 50 | + |
| 51 | +--- |
| 52 | + |
| 53 | +## Project Structure |
| 54 | + |
| 55 | +``` |
| 56 | +CollectorGO/ |
| 57 | +├── app/ # React Native (Expo) mobile app |
| 58 | +├── backend/ # FastAPI backend |
| 59 | +├── dashboard/ # Next.js web dashboard |
| 60 | +└── docs/ # Documentation |
| 61 | +``` |
| 62 | + |
| 63 | +--- |
| 64 | + |
| 65 | +## Coding Standards |
| 66 | + |
| 67 | +### Backend (Python) |
| 68 | + |
| 69 | +- **Formatter:** Ruff (`ruff format`) |
| 70 | +- **Linter:** Ruff (`ruff check`) |
| 71 | +- **Type checker:** Mypy |
| 72 | +- **Tests:** Pytest |
| 73 | + |
| 74 | +```bash |
| 75 | +cd backend |
| 76 | +uv run ruff check . |
| 77 | +uv run ruff format --check . |
| 78 | +uv run mypy app --ignore-missing-imports |
| 79 | +uv run pytest -v |
| 80 | +``` |
| 81 | + |
| 82 | +### Dashboard (TypeScript / Next.js) |
| 83 | + |
| 84 | +- **Linter:** ESLint |
| 85 | +- **Framework:** Next.js with App Router |
| 86 | +- **Styling:** Tailwind CSS |
| 87 | + |
| 88 | +```bash |
| 89 | +cd dashboard |
| 90 | +npm run lint |
| 91 | +npx tsc --noEmit |
| 92 | +npm run build |
| 93 | +``` |
| 94 | + |
| 95 | +### Mobile App (TypeScript / React Native) |
| 96 | + |
| 97 | +- **Framework:** Expo SDK 54 |
| 98 | +- **Navigation:** React Navigation |
| 99 | + |
| 100 | +```bash |
| 101 | +cd app |
| 102 | +npx tsc --noEmit |
| 103 | +``` |
| 104 | + |
| 105 | +--- |
| 106 | + |
| 107 | +## Making Changes |
| 108 | + |
| 109 | +1. **Fork** the repository and clone your fork |
| 110 | +2. **Create a branch** from `develop`: |
| 111 | + ```bash |
| 112 | + git checkout -b feature/your-feature develop |
| 113 | + ``` |
| 114 | +3. **Make your changes** — follow the coding standards above |
| 115 | +4. **Test** your changes locally |
| 116 | +5. **Commit** using conventional commits (see below) |
| 117 | +6. **Push** your branch and open a **Pull Request** against `develop` |
| 118 | + |
| 119 | +--- |
| 120 | + |
| 121 | +## Commit Messages |
| 122 | + |
| 123 | +We follow [Conventional Commits](https://www.conventionalcommits.org/): |
| 124 | + |
| 125 | +``` |
| 126 | +<type>(<scope>): <description> |
| 127 | +
|
| 128 | +[optional body] |
| 129 | +``` |
| 130 | + |
| 131 | +### Types |
| 132 | + |
| 133 | +| Type | Description | |
| 134 | +| ---------- | ------------------------------------ | |
| 135 | +| `feat` | A new feature | |
| 136 | +| `fix` | A bug fix | |
| 137 | +| `docs` | Documentation changes | |
| 138 | +| `style` | Code style (formatting, no logic) | |
| 139 | +| `refactor` | Code refactoring | |
| 140 | +| `test` | Adding or updating tests | |
| 141 | +| `chore` | Maintenance tasks | |
| 142 | +| `ci` | CI/CD configuration changes | |
| 143 | + |
| 144 | +### Scopes |
| 145 | + |
| 146 | +Use the component name: `backend`, `dashboard`, `app`, or `docs`. |
| 147 | + |
| 148 | +### Examples |
| 149 | + |
| 150 | +``` |
| 151 | +feat(backend): add user role assignment endpoint |
| 152 | +fix(dashboard): resolve chart rendering on mobile viewports |
| 153 | +ci(backend): add PostgreSQL service to test workflow |
| 154 | +``` |
| 155 | + |
| 156 | +--- |
| 157 | + |
| 158 | +Thank you for contributing! 🚀 |
0 commit comments