|
1 | 1 | # Contributing to Talk Timer |
2 | 2 |
|
3 | | -Thank you for considering contributing to Talk Timer! Your help is greatly appreciated. |
| 3 | +Thank you for considering contributing to Talk Timer! Your help is greatly appreciated. This guide will help you get started with contributing to the project. |
| 4 | + |
| 5 | +## Table of Contents |
| 6 | + |
| 7 | +- [Getting Started](#getting-started) |
| 8 | +- [Development Workflow](#development-workflow) |
| 9 | +- [Code Style](#code-style) |
| 10 | +- [Technology Stack](#technology-stack) |
| 11 | +- [Project Structure](#project-structure) |
| 12 | +- [Testing Your Changes](#testing-your-changes) |
| 13 | +- [Submitting Your Contribution](#submitting-your-contribution) |
4 | 14 |
|
5 | 15 | ## Getting Started |
6 | 16 |
|
7 | 17 | To get started with development, follow these steps: |
8 | 18 |
|
9 | 19 | 1. **Fork the repository**: Click the "Fork" button at the top right of the repository page. |
| 20 | + |
10 | 21 | 2. **Clone your fork**: Clone your forked repository to your local machine. |
11 | 22 | ```bash |
12 | 23 | git clone https://github.com/your-username/talk-timer.git |
| 24 | + cd talk-timer |
13 | 25 | ``` |
14 | | -3. **Install dependencies**: Navigate to the project directory and install the dependencies. We use `npm` in this example, but you can use `yarn`, `pnpm`, or `bun` as well. |
| 26 | + |
| 27 | +3. **Install dependencies**: Install the project dependencies. We use `npm` in this example, but you can use `yarn`, `pnpm`, or `bun` as well. |
15 | 28 | ```bash |
16 | | - cd talk-timer |
17 | 29 | npm install |
18 | 30 | ``` |
| 31 | + |
19 | 32 | 4. **Run the development server**: Start the development server to see your changes live. |
20 | 33 | ```bash |
21 | 34 | npm run dev |
22 | 35 | ``` |
| 36 | + |
| 37 | + Open [http://localhost:3000](http://localhost:3000) in your browser to view the application. |
23 | 38 |
|
24 | 39 | ## Development Workflow |
25 | 40 |
|
26 | 41 | 1. **Create a branch**: Create a new branch for your feature or bugfix. |
27 | 42 | ```bash |
28 | 43 | git checkout -b feature/your-feature-name |
| 44 | + # or |
| 45 | + git checkout -b fix/your-bugfix-name |
29 | 46 | ``` |
30 | | -2. **Make changes**: Make your changes to the codebase. |
31 | | -3. **Test your changes**: Ensure that your changes work as expected and do not break existing functionality. |
32 | | -4. **Commit your changes**: Commit your changes with a clear and descriptive commit message. |
| 47 | + |
| 48 | +2. **Make changes**: Make your changes to the codebase. Follow the [Code Style](#code-style) guidelines. |
| 49 | + |
| 50 | +3. **Test your changes**: Ensure that your changes work as expected and do not break existing functionality. See [Testing Your Changes](#testing-your-changes) for details. |
| 51 | + |
| 52 | +4. **Format your code**: Run the formatter to ensure consistent code style. |
| 53 | + ```bash |
| 54 | + npm run format |
| 55 | + ``` |
| 56 | + |
| 57 | +5. **Commit your changes**: Commit your changes with a clear and descriptive commit message. |
33 | 58 | ```bash |
| 59 | + git add . |
34 | 60 | git commit -m "Add feature: description of your feature" |
| 61 | + # or |
| 62 | + git commit -m "Fix: description of the bug fix" |
35 | 63 | ``` |
36 | | -5. **Push your changes**: Push your changes to your forked repository. |
| 64 | + |
| 65 | +6. **Push your changes**: Push your changes to your forked repository. |
37 | 66 | ```bash |
38 | 67 | git push origin feature/your-feature-name |
39 | 68 | ``` |
40 | | -6. **Create a pull request**: Create a pull request from your forked repository to the main repository. |
41 | | -7. **Review and merge**: Wait for your pull request to be reviewed and merged. Make any necessary changes if requested. |
| 69 | + |
| 70 | +7. **Create a pull request**: Create a pull request from your forked repository to the main repository. Provide a clear description of your changes and any relevant context. |
| 71 | + |
| 72 | +8. **Review and merge**: Wait for your pull request to be reviewed and merged. Make any necessary changes if requested by maintainers. |
42 | 73 |
|
43 | 74 | ## Code Style |
44 | 75 |
|
45 | | -Please follow the existing code style and use the provided linters. Run the following command to check for linting errors: |
| 76 | +This project follows specific code style guidelines to maintain consistency: |
| 77 | + |
| 78 | +### TypeScript |
| 79 | + |
| 80 | +- **Strict mode enabled**: The project uses TypeScript with strict compiler options |
| 81 | +- Use type inference where possible |
| 82 | +- Use `interface` for component props |
| 83 | +- Use descriptive variable and function names |
| 84 | + |
| 85 | +### React Patterns |
| 86 | + |
| 87 | +- Use **functional components** with hooks |
| 88 | +- Mark client components with `'use client'` directive at the top of the file |
| 89 | +- Use `useCallback` for memoized callbacks |
| 90 | +- Use `useEffect` for side effects (timers, event listeners) |
| 91 | + |
| 92 | +### Formatting |
| 93 | + |
| 94 | +- **Indentation**: 2 spaces (no tabs) |
| 95 | +- **Quotes**: Single quotes for strings |
| 96 | +- **Semicolons**: No semicolons |
| 97 | +- **Line width**: Keep lines reasonably short |
| 98 | + |
| 99 | +### Styling |
| 100 | + |
| 101 | +- Use **Tailwind CSS** utility classes |
| 102 | +- Use the `cn()` utility from `lib/utils.ts` for conditional className merging |
| 103 | +- Follow the existing color scheme (green → yellow → red gradients) |
| 104 | + |
| 105 | +### Linting and Formatting |
| 106 | + |
| 107 | +Please follow the existing code style and use the provided linters. Run the following commands before committing: |
46 | 108 |
|
47 | 109 | ```bash |
| 110 | +# Check for linting and formatting errors |
48 | 111 | npm run lint |
| 112 | + |
| 113 | +# Auto-format code |
| 114 | +npm run format |
49 | 115 | ``` |
50 | 116 |
|
51 | | -## Check for Build and Start |
| 117 | +## Technology Stack |
52 | 118 |
|
53 | | -Please check if the project builds and starts correctly before creating a pull request. Run the following command to build and start the project: |
| 119 | +- **Framework**: Next.js 14 (App Router) |
| 120 | +- **Language**: TypeScript (strict mode enabled) |
| 121 | +- **UI Library**: React 18 |
| 122 | +- **Styling**: Tailwind CSS with shadcn/ui components |
| 123 | +- **Icons**: Radix UI Icons and Lucide React |
| 124 | +- **Build Tool**: Next.js built-in bundler |
54 | 125 |
|
55 | | -```bash |
56 | | -npm run build |
57 | | -npm start |
| 126 | +## Project Structure |
| 127 | + |
| 128 | +``` |
| 129 | +/ |
| 130 | +├── app/ # Next.js App Router pages |
| 131 | +│ ├── layout.tsx # Root layout |
| 132 | +│ └── page.tsx # Home page |
| 133 | +├── components/ # React components |
| 134 | +│ ├── ui/ # shadcn/ui components (button, input, dialog, label) |
| 135 | +│ ├── talk-timer.tsx # Main timer component |
| 136 | +│ ├── timer-display.tsx # Timer display component |
| 137 | +│ ├── footer.tsx # Footer with controls |
| 138 | +│ └── progress-bar.tsx # Progress bar component |
| 139 | +├── lib/ # Utility functions |
| 140 | +│ └── utils.ts # cn() utility for className merging |
| 141 | +└── .github/ # GitHub configuration |
58 | 142 | ``` |
| 143 | + |
| 144 | +### Key Components |
| 145 | + |
| 146 | +- **TalkTimer** (`components/talk-timer.tsx`): Main component that manages timer state and logic |
| 147 | +- **TimerDisplay** (`components/timer-display.tsx`): Displays the timer and talk title |
| 148 | +- **Footer** (`components/footer.tsx`): Contains control buttons and settings dialog |
| 149 | +- **ProgressBar** (`components/progress-bar.tsx`): Shows progress at the top of the screen |
| 150 | + |
| 151 | +## Testing Your Changes |
| 152 | + |
| 153 | +Before creating a pull request, please ensure: |
| 154 | + |
| 155 | +1. **The project builds successfully**: |
| 156 | + ```bash |
| 157 | + npm run build |
| 158 | + ``` |
| 159 | + |
| 160 | +2. **There are no linting errors**: |
| 161 | + ```bash |
| 162 | + npm run lint |
| 163 | + ``` |
| 164 | + |
| 165 | +3. **The application runs correctly**: |
| 166 | + ```bash |
| 167 | + npm run dev |
| 168 | + ``` |
| 169 | + Then manually test the following: |
| 170 | + - Starting/stopping/resetting the timer |
| 171 | + - Fullscreen toggle (both button and keyboard shortcut) |
| 172 | + - Settings dialog (title and thresholds) |
| 173 | + - Color transitions at the configured thresholds |
| 174 | + - Progress bar functionality |
| 175 | + - Auto-hiding footer controls |
| 176 | + |
| 177 | +4. **Your changes don't break existing functionality**: Test the entire application to ensure your changes don't negatively impact other features. |
| 178 | + |
| 179 | +## Submitting Your Contribution |
| 180 | + |
| 181 | +When submitting a pull request: |
| 182 | + |
| 183 | +1. **Provide a clear title**: Use a descriptive title that summarizes your changes |
| 184 | +2. **Write a detailed description**: Explain what changes you made and why |
| 185 | +3. **Reference related issues**: If your PR addresses an issue, reference it (e.g., "Fixes #123") |
| 186 | +4. **Include screenshots**: If your changes affect the UI, include before/after screenshots |
| 187 | +5. **Be responsive**: Be prepared to respond to feedback and make requested changes |
| 188 | + |
| 189 | +## Questions? |
| 190 | + |
| 191 | +If you have any questions or need help, feel free to: |
| 192 | +- Open an issue for discussion |
| 193 | +- Comment on an existing issue |
| 194 | +- Reach out to the maintainers |
| 195 | + |
| 196 | +Thank you for contributing to Talk Timer! 🎉 |
0 commit comments