|
| 1 | +# Contributing to Google Task Desktop |
| 2 | + |
| 3 | +First off, thank you for considering contributing to Google Task Desktop! 🎉 |
| 4 | + |
| 5 | +## Table of Contents |
| 6 | + |
| 7 | +- [Code of Conduct](#code-of-conduct) |
| 8 | +- [Getting Started](#getting-started) |
| 9 | +- [Development Setup](#development-setup) |
| 10 | +- [Project Structure](#project-structure) |
| 11 | +- [Making Changes](#making-changes) |
| 12 | +- [Pull Request Process](#pull-request-process) |
| 13 | +- [Coding Guidelines](#coding-guidelines) |
| 14 | +- [Commit Messages](#commit-messages) |
| 15 | + |
| 16 | +## Code of Conduct |
| 17 | + |
| 18 | +This project adheres to a Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to the maintainers. |
| 19 | + |
| 20 | +## Getting Started |
| 21 | + |
| 22 | +1. **Fork the repository** on GitHub |
| 23 | +2. **Clone your fork** locally |
| 24 | +3. **Set up the development environment** (see below) |
| 25 | +4. **Create a branch** for your changes |
| 26 | +5. **Make your changes** and test them |
| 27 | +6. **Submit a pull request** |
| 28 | + |
| 29 | +## Development Setup |
| 30 | + |
| 31 | +### Prerequisites |
| 32 | + |
| 33 | +- [Rust](https://www.rust-lang.org/tools/install) (latest stable) |
| 34 | +- [Node.js](https://nodejs.org/) (v18 or later) |
| 35 | +- [Cargo](https://doc.rust-lang.org/cargo/) (comes with Rust) |
| 36 | + |
| 37 | +### Installation |
| 38 | + |
| 39 | +```bash |
| 40 | +# Clone your fork |
| 41 | +git clone https://github.com/YOUR_USERNAME/google-task-desktop.git |
| 42 | +cd google-task-desktop |
| 43 | + |
| 44 | +# Install dependencies |
| 45 | +npm install |
| 46 | + |
| 47 | +# Set up environment variables |
| 48 | +cp .env.example .env |
| 49 | +# Edit .env with your Google OAuth credentials |
| 50 | + |
| 51 | +# Start development server |
| 52 | +npm run launch:dev |
| 53 | +``` |
| 54 | + |
| 55 | +### Google OAuth Setup |
| 56 | + |
| 57 | +1. Go to [Google Cloud Console](https://console.cloud.google.com/) |
| 58 | +2. Create a new project or select an existing one |
| 59 | +3. Enable the **Google Tasks API** |
| 60 | +4. Create OAuth 2.0 credentials (Desktop application) |
| 61 | +5. Copy credentials to your `.env` file |
| 62 | + |
| 63 | +## Project Structure |
| 64 | + |
| 65 | +``` |
| 66 | +google-task-desktop/ |
| 67 | +├── src/ # React frontend |
| 68 | +│ ├── api/ # API client and endpoints |
| 69 | +│ ├── components/ # React components |
| 70 | +│ ├── hooks/ # Custom React hooks |
| 71 | +│ ├── repositories/ # Data access layer |
| 72 | +│ ├── services/ # Business logic layer |
| 73 | +│ ├── store/ # Recoil atoms |
| 74 | +│ └── types/ # TypeScript types |
| 75 | +├── src-tauri/ # Rust backend |
| 76 | +│ └── src/ |
| 77 | +│ └── libs/ # Rust modules |
| 78 | +└── docs/ # Documentation |
| 79 | +``` |
| 80 | + |
| 81 | +See [ARCHITECTURE.md](./ARCHITECTURE.md) for detailed architecture documentation. |
| 82 | + |
| 83 | +## Making Changes |
| 84 | + |
| 85 | +### Branch Naming |
| 86 | + |
| 87 | +- `feature/description` - New features |
| 88 | +- `fix/description` - Bug fixes |
| 89 | +- `docs/description` - Documentation changes |
| 90 | +- `refactor/description` - Code refactoring |
| 91 | + |
| 92 | +### Testing Your Changes |
| 93 | + |
| 94 | +1. Run the development server: `npm run launch:dev` |
| 95 | +2. Test the feature manually |
| 96 | +3. Ensure there are no TypeScript errors |
| 97 | +4. Check the console for runtime errors |
| 98 | + |
| 99 | +## Pull Request Process |
| 100 | + |
| 101 | +1. **Update documentation** if you're changing functionality |
| 102 | +2. **Update CHANGELOG.md** with your changes |
| 103 | +3. **Ensure the app builds** without errors |
| 104 | +4. **Write a clear PR description** explaining: |
| 105 | + - What changes you made |
| 106 | + - Why you made them |
| 107 | + - How to test them |
| 108 | +5. **Request review** from maintainers |
| 109 | + |
| 110 | +### PR Title Format |
| 111 | + |
| 112 | +``` |
| 113 | +type(scope): description |
| 114 | +
|
| 115 | +Examples: |
| 116 | +feat(tasks): add drag-and-drop reordering |
| 117 | +fix(auth): resolve token refresh issue |
| 118 | +docs(readme): update installation steps |
| 119 | +``` |
| 120 | + |
| 121 | +## Coding Guidelines |
| 122 | + |
| 123 | +### TypeScript |
| 124 | + |
| 125 | +- Use strict TypeScript types (avoid `any`) |
| 126 | +- Define interfaces for all data structures |
| 127 | +- Use meaningful variable and function names |
| 128 | + |
| 129 | +### React |
| 130 | + |
| 131 | +- Use functional components with hooks |
| 132 | +- Keep components small and focused |
| 133 | +- Use Recoil for shared state only (UI state) |
| 134 | + |
| 135 | +### Rust |
| 136 | + |
| 137 | +- Follow Rust idioms and best practices |
| 138 | +- Use descriptive error messages |
| 139 | +- Document public functions |
| 140 | + |
| 141 | +### File Organization |
| 142 | + |
| 143 | +- One component per file |
| 144 | +- Group related files in directories |
| 145 | +- Export from index files when appropriate |
| 146 | + |
| 147 | +## Commit Messages |
| 148 | + |
| 149 | +Follow the [Conventional Commits](https://www.conventionalcommits.org/) specification: |
| 150 | + |
| 151 | +``` |
| 152 | +<type>(<scope>): <description> |
| 153 | +
|
| 154 | +[optional body] |
| 155 | +
|
| 156 | +[optional footer] |
| 157 | +``` |
| 158 | + |
| 159 | +### Types |
| 160 | + |
| 161 | +- `feat`: New feature |
| 162 | +- `fix`: Bug fix |
| 163 | +- `docs`: Documentation only |
| 164 | +- `style`: Code style (formatting, etc.) |
| 165 | +- `refactor`: Code refactoring |
| 166 | +- `test`: Adding tests |
| 167 | +- `chore`: Maintenance tasks |
| 168 | + |
| 169 | +### Examples |
| 170 | + |
| 171 | +``` |
| 172 | +feat(notifications): add due date notifications |
| 173 | +
|
| 174 | +Implements OS notifications that trigger at 9 AM on task due dates. |
| 175 | +Uses Tauri notification API for cross-platform support. |
| 176 | +``` |
| 177 | + |
| 178 | +``` |
| 179 | +fix(auth): handle token expiration gracefully |
| 180 | +
|
| 181 | +- Added refresh token logic |
| 182 | +- Improved error messaging |
| 183 | +- Added automatic retry on 401 |
| 184 | +``` |
| 185 | + |
| 186 | +--- |
| 187 | + |
| 188 | +## Questions? |
| 189 | + |
| 190 | +Feel free to open an issue if you have questions about contributing. We're happy to help! |
| 191 | + |
| 192 | +**Thank you for contributing!** 🙏 |
0 commit comments