|
| 1 | +# Contributing to iCAD Dispatch |
| 2 | + |
| 3 | +Thank you for your interest in contributing to iCAD Dispatch! |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## Code of Conduct |
| 8 | + |
| 9 | +By participating in this project, you agree to abide by our [Code of Conduct](CODE_OF_CONDUCT.md). Please be respectful and constructive. |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +## How to Contribute |
| 14 | + |
| 15 | +### Reporting Bugs |
| 16 | + |
| 17 | +1. **Search existing issues** - Check if the bug has already been reported |
| 18 | +2. **Create a new issue** - Use the Bug Report template |
| 19 | +3. **Include**: |
| 20 | + - Clear description of the problem |
| 21 | + - Steps to reproduce |
| 22 | + - Expected vs actual behavior |
| 23 | + - iCAD Dispatch version |
| 24 | + - Browser/OS information |
| 25 | + - Relevant logs (if applicable) |
| 26 | + |
| 27 | +### Suggesting Features |
| 28 | + |
| 29 | +1. **Search existing feature requests** - Avoid duplicates |
| 30 | +2. **Create a new issue** - Use the Feature Request template |
| 31 | +3. **Describe**: |
| 32 | + - The problem you're trying to solve |
| 33 | + - Proposed solution |
| 34 | + - Alternative solutions considered |
| 35 | + - Use case (who benefits?) |
| 36 | + |
| 37 | +### Pull Requests |
| 38 | + |
| 39 | +1. **Fork the repository** |
| 40 | +2. **Create a feature branch**: `git checkout -b feature/my-feature` |
| 41 | +3. **Make your changes** - Follow the coding standards |
| 42 | +4. **Add tests** - If applicable |
| 43 | +5. **Update documentation** - If needed |
| 44 | +6. **Commit with clear messages**: `git commit -m "Add feature: ..."` |
| 45 | +7. **Push to your fork**: `git push origin feature/my-feature` |
| 46 | +8. **Submit a Pull Request** - Fill out the template |
| 47 | + |
| 48 | +--- |
| 49 | + |
| 50 | +## Development Setup |
| 51 | + |
| 52 | +### Prerequisites |
| 53 | + |
| 54 | +- Docker and Docker Compose |
| 55 | +- Python 3.12+ (for local development without Docker) |
| 56 | +- SQLite |
| 57 | + |
| 58 | +### Local Development |
| 59 | + |
| 60 | +```bash |
| 61 | +# Clone the repository |
| 62 | +git clone https://github.com/renfrewcountyscanner/icad_dispatch_v2.git |
| 63 | +cd icad_dispatch_v2 |
| 64 | + |
| 65 | +# Copy environment file |
| 66 | +cp .env_example .env |
| 67 | + |
| 68 | +# Edit .env with your settings |
| 69 | +nano .env |
| 70 | + |
| 71 | +# Start with local build (development) |
| 72 | +docker compose -f docker-compose.production.yml up -d |
| 73 | + |
| 74 | +# View logs |
| 75 | +docker logs -f icad_dispatch |
| 76 | + |
| 77 | +# Run migrations (if needed) |
| 78 | +# The app runs migrations automatically on startup |
| 79 | +``` |
| 80 | + |
| 81 | +### Running Tests |
| 82 | + |
| 83 | +```bash |
| 84 | +# Run the container in development mode |
| 85 | +docker compose -f docker-compose.production.yml up -d --build |
| 86 | + |
| 87 | +# Check logs for errors |
| 88 | +docker logs icad_dispatch |
| 89 | +``` |
| 90 | + |
| 91 | +--- |
| 92 | + |
| 93 | +## Coding Standards |
| 94 | + |
| 95 | +### Python |
| 96 | + |
| 97 | +- Follow [PEP 8](https://www.python.org/dev/peps/pep-0008/) |
| 98 | +- Use type hints where appropriate |
| 99 | +- Add docstrings for new functions |
| 100 | +- Keep functions focused and modular |
| 101 | + |
| 102 | +### JavaScript |
| 103 | + |
| 104 | +- Use ES6+ features |
| 105 | +- Add JSDoc comments for functions |
| 106 | +- Keep code consistent with existing style |
| 107 | + |
| 108 | +### Templates (Jinja2) |
| 109 | + |
| 110 | +- Indent with 4 spaces |
| 111 | +- Keep templates clean and readable |
| 112 | +- Use appropriate Bootstrap classes |
| 113 | + |
| 114 | +### Git Commit Messages |
| 115 | + |
| 116 | +- Use present tense: "Add feature" not "Added feature" |
| 117 | +- Keep first line under 72 characters |
| 118 | +- Reference issues where applicable |
| 119 | + |
| 120 | +**Example**: |
| 121 | +``` |
| 122 | +Add user system permissions |
| 123 | +
|
| 124 | +- Add is_admin and is_active columns to users table |
| 125 | +- Create user_systems table for per-system permissions |
| 126 | +- Add admin_required and permission_required decorators |
| 127 | +- Update session handling to store user permissions |
| 128 | +``` |
| 129 | + |
| 130 | +--- |
| 131 | + |
| 132 | +## Pull Request Checklist |
| 133 | + |
| 134 | +- [ ] Tests pass (if applicable) |
| 135 | +- [ ] Code follows coding standards |
| 136 | +- [ ] Documentation updated (if needed) |
| 137 | +- [ ] Commit messages are clear |
| 138 | +- [ ] PR description explains the changes |
| 139 | + |
| 140 | +--- |
| 141 | + |
| 142 | +## Getting Help |
| 143 | + |
| 144 | +- **GitHub Issues**: For bug reports and feature requests |
| 145 | +- **Discussions**: For questions and general help |
| 146 | + |
| 147 | +--- |
| 148 | + |
| 149 | +## Recognition |
| 150 | + |
| 151 | +Contributors will be listed in the README and/or CHANGELOG. |
| 152 | + |
| 153 | +--- |
| 154 | + |
| 155 | +Thank you for contributing! |
0 commit comments