|
| 1 | +# Contributing to Dota Keeper |
| 2 | + |
| 3 | +Thank you for your interest in contributing to Dota Keeper! This document provides guidelines and instructions for contributing to the project. |
| 4 | + |
| 5 | +## Table of Contents |
| 6 | + |
| 7 | +- [Getting Started](#getting-started) |
| 8 | +- [Development Setup](#development-setup) |
| 9 | +- [Project Structure](#project-structure) |
| 10 | +- [Making Changes](#making-changes) |
| 11 | +- [Submitting Contributions](#submitting-contributions) |
| 12 | +- [Task Management](#task-management) |
| 13 | +- [Release Process](#release-process) |
| 14 | +- [Code Style](#code-style) |
| 15 | +- [Testing](#testing) |
| 16 | + |
| 17 | +## Getting Started |
| 18 | + |
| 19 | +Dota Keeper is a desktop application built with Tauri that tracks Dota 2 games and analyzes performance against personal goals. |
| 20 | + |
| 21 | +### Prerequisites |
| 22 | + |
| 23 | +- [Node.js](https://nodejs.org/) (v16 or higher) |
| 24 | +- [Rust](https://www.rust-lang.org/tools/install) (latest stable version) |
| 25 | +- [npm](https://www.npmjs.com/) or [yarn](https://yarnpkg.com/) |
| 26 | +- Git |
| 27 | + |
| 28 | +## Development Setup |
| 29 | + |
| 30 | +1. **Fork and Clone** |
| 31 | + ```bash |
| 32 | + git clone https://github.com/YOUR_USERNAME/dota-keeper.git |
| 33 | + cd dota-keeper |
| 34 | + ``` |
| 35 | + |
| 36 | +2. **Install Dependencies** |
| 37 | + ```bash |
| 38 | + npm install |
| 39 | + ``` |
| 40 | + |
| 41 | +3. **Run Development Server** |
| 42 | + ```bash |
| 43 | + npm run tauri dev |
| 44 | + ``` |
| 45 | + |
| 46 | +4. **Build for Production** |
| 47 | + ```bash |
| 48 | + npm run tauri build |
| 49 | + ``` |
| 50 | + |
| 51 | +## Project Structure |
| 52 | + |
| 53 | +``` |
| 54 | +dota-keeper/ |
| 55 | +โโโ src/ # Frontend source code |
| 56 | +โโโ src-tauri/ # Rust backend code |
| 57 | +โโโ docs/ # GitHub Pages documentation |
| 58 | +โโโ meta/ |
| 59 | +โ โโโ tasks/ # Task management |
| 60 | +โ โโโ upnext/ # Tasks ready to be worked on |
| 61 | +โ โโโ backlog/ # Future tasks |
| 62 | +โ โโโ done/ # Completed tasks |
| 63 | +โ โโโ to_test/ # Tasks awaiting manual testing |
| 64 | +โโโ CLAUDE.md # Project instructions and AI context |
| 65 | +โโโ CHANGELOG.md # Version history |
| 66 | +โโโ package.json # Project dependencies and scripts |
| 67 | +``` |
| 68 | + |
| 69 | +### Key Directories |
| 70 | + |
| 71 | +- **`src/`**: Frontend code (HTML, CSS, JavaScript/TypeScript) |
| 72 | +- **`src-tauri/`**: Rust backend, API integrations, database logic |
| 73 | +- **`meta/tasks/`**: Project task management system |
| 74 | +- **`docs/`**: Project website and documentation |
| 75 | + |
| 76 | +## Making Changes |
| 77 | + |
| 78 | +### Before You Start |
| 79 | + |
| 80 | +1. **Check existing issues** to see if someone is already working on it |
| 81 | +2. **Create an issue** if you're planning a significant change |
| 82 | +3. **Create a new branch** from `main`: |
| 83 | + ```bash |
| 84 | + git checkout -b feature/your-feature-name |
| 85 | + ``` |
| 86 | + |
| 87 | +### Development Guidelines |
| 88 | + |
| 89 | +1. **Follow the project architecture**: |
| 90 | + - Database storage in SQLite (located in `%LOCALAPPDATA%/DotaKeeper/`) |
| 91 | + - API calls via OpenDota or Steam API |
| 92 | + - Goal achievement should target ~75% success rate (see CLAUDE.md) |
| 93 | + |
| 94 | +2. **Write clear commit messages**: |
| 95 | + ``` |
| 96 | + feat: add match history pagination |
| 97 | + fix: correct KDA calculation |
| 98 | + docs: update API integration guide |
| 99 | + refactor: simplify goal evaluation logic |
| 100 | + ``` |
| 101 | + |
| 102 | +3. **Keep changes focused**: One feature or fix per pull request |
| 103 | + |
| 104 | +4. **Test your changes** thoroughly before submitting |
| 105 | + |
| 106 | +## Submitting Contributions |
| 107 | + |
| 108 | +### Pull Request Process |
| 109 | + |
| 110 | +1. **Update your branch** with the latest main: |
| 111 | + ```bash |
| 112 | + git fetch origin |
| 113 | + git rebase origin/main |
| 114 | + ``` |
| 115 | + |
| 116 | +2. **Push your changes**: |
| 117 | + ```bash |
| 118 | + git push origin feature/your-feature-name |
| 119 | + ``` |
| 120 | + |
| 121 | +3. **Create a Pull Request**: |
| 122 | + - Use a clear, descriptive title |
| 123 | + - Reference any related issues |
| 124 | + - Describe what changed and why |
| 125 | + - Include screenshots for UI changes |
| 126 | + - List any breaking changes |
| 127 | + |
| 128 | +4. **Respond to feedback**: Address review comments promptly |
| 129 | + |
| 130 | +### Pull Request Template |
| 131 | + |
| 132 | +```markdown |
| 133 | +## Description |
| 134 | +Brief description of changes |
| 135 | + |
| 136 | +## Related Issues |
| 137 | +Fixes #123 |
| 138 | + |
| 139 | +## Changes Made |
| 140 | +- Change 1 |
| 141 | +- Change 2 |
| 142 | + |
| 143 | +## Testing |
| 144 | +How was this tested? |
| 145 | + |
| 146 | +## Screenshots (if applicable) |
| 147 | +Add screenshots here |
| 148 | +``` |
| 149 | + |
| 150 | +## Task Management |
| 151 | + |
| 152 | +The project uses a file-based task management system in `meta/tasks/`: |
| 153 | + |
| 154 | +- **Creating tasks**: Add `.md` files to `backlog/` or `upnext/` |
| 155 | +- **Working on tasks**: Move from `upnext/` to track active work |
| 156 | +- **Completing tasks**: Move to `to_test/` if manual verification needed, or `done/` if fully complete |
| 157 | +- **Testing documentation**: Include testing steps when moving to `to_test/` |
| 158 | + |
| 159 | +## Release Process |
| 160 | + |
| 161 | +### For Maintainers |
| 162 | + |
| 163 | +When creating a new release, update version numbers in: |
| 164 | + |
| 165 | +1. **`package.json`**: Update the `version` field |
| 166 | +2. **`src-tauri/Cargo.toml`**: Update the `version` field |
| 167 | +3. **`src-tauri/tauri.conf.json`**: Update the `version` field |
| 168 | +4. **`CHANGELOG.md`**: Document all changes in the new version |
| 169 | + |
| 170 | +Example workflow: |
| 171 | +```bash |
| 172 | +# Update versions in all three files |
| 173 | +# Update CHANGELOG.md with new version and changes |
| 174 | +git add package.json src-tauri/Cargo.toml src-tauri/tauri.conf.json CHANGELOG.md |
| 175 | +git commit -m "chore: bump version to 1.2.0" |
| 176 | +git tag v1.2.0 |
| 177 | +git push origin main --tags |
| 178 | +``` |
| 179 | + |
| 180 | +## Code Style |
| 181 | + |
| 182 | +### Frontend (JavaScript/TypeScript) |
| 183 | +- Use 2 spaces for indentation |
| 184 | +- Use semicolons |
| 185 | +- Prefer `const` over `let`, avoid `var` |
| 186 | +- Use meaningful variable names |
| 187 | + |
| 188 | +### Backend (Rust) |
| 189 | +- Follow [Rust API Guidelines](https://rust-lang.github.io/api-guidelines/) |
| 190 | +- Run `cargo fmt` before committing |
| 191 | +- Run `cargo clippy` and address warnings |
| 192 | +- Write documentation comments for public APIs |
| 193 | + |
| 194 | +### General |
| 195 | +- Keep functions small and focused |
| 196 | +- Add comments for complex logic |
| 197 | +- Use descriptive names for variables and functions |
| 198 | + |
| 199 | +## Generating icons |
| 200 | + |
| 201 | +Run |
| 202 | +``` |
| 203 | +cargo tauri icon .\assets\dotakeeper-icon-black.png |
| 204 | +``` |
| 205 | + |
| 206 | + |
| 207 | +## Testing |
| 208 | + |
| 209 | +### Frontend Testing |
| 210 | +```bash |
| 211 | +npm test |
| 212 | +``` |
| 213 | + |
| 214 | +### Rust Testing |
| 215 | +```bash |
| 216 | +cd src-tauri |
| 217 | +cargo test |
| 218 | +``` |
| 219 | + |
| 220 | +### Manual Testing |
| 221 | +- Test on Windows (primary platform) |
| 222 | +- Verify database operations work correctly |
| 223 | +- Test API integrations with real Steam/OpenDota data |
| 224 | +- Verify UI changes across different screen sizes |
| 225 | + |
| 226 | +## Questions? |
| 227 | + |
| 228 | +If you have questions about contributing: |
| 229 | +- Check existing [Issues](https://github.com/YOUR_USERNAME/dota-keeper/issues) |
| 230 | +- Create a new issue with the `question` label |
| 231 | +- Reference the [CLAUDE.md](./CLAUDE.md) file for project context |
| 232 | + |
| 233 | +## License |
| 234 | + |
| 235 | +By contributing to Dota Keeper, you agree that your contributions will be licensed under the same license as the project. |
| 236 | + |
| 237 | +--- |
| 238 | + |
| 239 | +Thank you for contributing to Dota Keeper! ๐ฎ |
0 commit comments