|
| 1 | +# Contributing to Repowise |
| 2 | + |
| 3 | +Thanks for your interest in contributing to Repowise! This guide will help you get started. |
| 4 | + |
| 5 | +## Getting Started |
| 6 | + |
| 7 | +### Prerequisites |
| 8 | + |
| 9 | +- Python 3.11+ |
| 10 | +- Node.js 20+ |
| 11 | +- [uv](https://docs.astral.sh/uv/) (Python package manager) |
| 12 | +- Git |
| 13 | + |
| 14 | +### Local Setup |
| 15 | + |
| 16 | +```bash |
| 17 | +# Clone the repo |
| 18 | +git clone https://github.com/RaghavChamadiya/repowise.git |
| 19 | +cd repowise |
| 20 | + |
| 21 | +# Install Python dependencies |
| 22 | +uv sync --all-extras |
| 23 | + |
| 24 | +# Install web frontend dependencies |
| 25 | +npm install |
| 26 | + |
| 27 | +# Build the web frontend |
| 28 | +npm run build |
| 29 | + |
| 30 | +# Run tests |
| 31 | +pytest |
| 32 | +``` |
| 33 | + |
| 34 | +## Development Workflow |
| 35 | + |
| 36 | +1. **Fork** the repository |
| 37 | +2. **Create a branch** from `main`: |
| 38 | + ```bash |
| 39 | + git checkout -b feat/your-feature |
| 40 | + ``` |
| 41 | +3. **Make your changes** — keep commits focused and well-described |
| 42 | +4. **Run tests** before pushing: |
| 43 | + ```bash |
| 44 | + pytest |
| 45 | + npm run lint |
| 46 | + npm run type-check |
| 47 | + ``` |
| 48 | +5. **Push** to your fork and open a **Pull Request** against `main` |
| 49 | + |
| 50 | +## Branch Naming |
| 51 | + |
| 52 | +Use descriptive prefixes: |
| 53 | + |
| 54 | +| Prefix | Purpose | |
| 55 | +|--------|---------| |
| 56 | +| `feat/` | New features | |
| 57 | +| `fix/` | Bug fixes | |
| 58 | +| `chore/` | Maintenance, CI, docs | |
| 59 | +| `refactor/` | Code restructuring | |
| 60 | + |
| 61 | +## Project Structure |
| 62 | + |
| 63 | +``` |
| 64 | +repowise/ |
| 65 | + packages/ |
| 66 | + core/ # Ingestion pipeline, analysis, generation engine |
| 67 | + cli/ # CLI commands (click-based) |
| 68 | + server/ # FastAPI API + MCP server |
| 69 | + web/ # Next.js frontend |
| 70 | + tests/ # Unit and integration tests |
| 71 | + docs/ # Documentation |
| 72 | +``` |
| 73 | + |
| 74 | +## Code Style |
| 75 | + |
| 76 | +- **Python**: Formatted with [ruff](https://docs.astral.sh/ruff/) (`ruff format .`, `ruff check .`) |
| 77 | +- **TypeScript**: Linted with ESLint (`npm run lint`) |
| 78 | +- Keep functions small and focused |
| 79 | +- Write docstrings for public APIs |
| 80 | + |
| 81 | +## Testing |
| 82 | + |
| 83 | +- Add tests for new features and bug fixes |
| 84 | +- Place tests in `tests/unit/` or `tests/integration/` |
| 85 | +- Run the full suite with `pytest` |
| 86 | + |
| 87 | +## Pull Request Guidelines |
| 88 | + |
| 89 | +- Keep PRs focused on a single change |
| 90 | +- Write a clear description of what and why |
| 91 | +- Reference any related issues |
| 92 | +- Ensure CI passes before requesting review |
| 93 | +- All PRs require at least one code owner approval |
| 94 | + |
| 95 | +## Reporting Issues |
| 96 | + |
| 97 | +- Use [GitHub Issues](https://github.com/RaghavChamadiya/repowise/issues) for bugs and feature requests |
| 98 | +- For security vulnerabilities, see [SECURITY.md](SECURITY.md) |
| 99 | + |
| 100 | +## License |
| 101 | + |
| 102 | +By contributing, you agree that your contributions will be licensed under the [AGPL-3.0](LICENSE) license. |
0 commit comments