|
| 1 | +# Contributing to Digital Clock |
| 2 | + |
| 3 | +Thank you for your interest in contributing to the Digital Clock project! We welcome contributions from the community and appreciate your time and effort in helping improve this project. |
| 4 | + |
| 5 | +## Table Of Contents |
| 6 | + |
| 7 | +- [Contributing to Digital Clock](#contributing-to-digital-clock) |
| 8 | + - [Getting Started](#getting-started) |
| 9 | + - [Branching Strategy](#branching-strategy) |
| 10 | + - [Branch Types](#branch-types) |
| 11 | + - [Branch Naming Conventions](#branch-naming-conventions) |
| 12 | + - [Contribution Workflow](#contribution-workflow) |
| 13 | + - [Commit Message Guidelines](#commit-message-guidelines) |
| 14 | + - [Format](#format) |
| 15 | + - [Types](#types) |
| 16 | + - [Examples](#examples) |
| 17 | + - [Pull Request Process](#pull-request-process) |
| 18 | + - [PR Description Template](#pr-description-template) |
| 19 | + - [Review Process](#review-process) |
| 20 | + - [Code of Conduct](#code-of-conduct) |
| 21 | + - [Questions?](#questions) |
| 22 | + |
| 23 | +## Getting Started |
| 24 | + |
| 25 | +Before you begin contributing, please ensure you have: |
| 26 | + |
| 27 | +- A GitHub account |
| 28 | +- Git installed on your local machine |
| 29 | +- Docker installed (for testing containerized builds) |
| 30 | +- Familiarity with HTML5, CSS3, and JavaScript (ES6) |
| 31 | + |
| 32 | +## Branching Strategy |
| 33 | + |
| 34 | +We follow a structured branching strategy to maintain code quality and organization: |
| 35 | + |
| 36 | +### Branch Types |
| 37 | + |
| 38 | +- `main`: Production branch containing stable releases only |
| 39 | +- `develop`: Development branch for integrating features before release |
| 40 | +- `feature/*`: New features (e.g., `feature/new-time-format`) |
| 41 | +- `bugfix/*`: Bug fixes (e.g., `bugfix/fix-timezone-issue`) |
| 42 | +- `refactor/*`: Code improvements (e.g., `refactor/optimize-update-logic`) |
| 43 | +- `docs/*`: Documentation updates (e.g., `docs/update-readme`) |
| 44 | +- `release/*`: Release preparation (e.g., `release/v1.2.0`) |
| 45 | + |
| 46 | +### Branch Naming Conventions |
| 47 | + |
| 48 | +Use descriptive, kebab-case names that clearly indicate the purpose. examples: |
| 49 | + |
| 50 | +- `feature/add-24-hour-format` |
| 51 | +- `bugfix/fix-mobile-display` |
| 52 | +- `refactor/improve-logging` |
| 53 | +- `docs/update-installation-guide` |
| 54 | + |
| 55 | +## Contribution Workflow |
| 56 | + |
| 57 | +1. **Fork the Repository**\ |
| 58 | + Start by forking the Digital Clock repository to your own GitHub account. |
| 59 | +2. **Clone Your Fork** |
| 60 | + ```bash |
| 61 | + git clone https://github.com/YOUR_USERNAME/Digital-Clock-Program.git |
| 62 | + cd Digital-Clock-Program |
| 63 | + ``` |
| 64 | +3. **Create the Develop Branch**\ |
| 65 | + If it doesn't already exist in your fork: |
| 66 | + ```bash |
| 67 | + git checkout -b develop main |
| 68 | + ``` |
| 69 | +4. **Create Your Feature Branch**\ |
| 70 | + Create a new branch from `develop`: |
| 71 | + ```bash |
| 72 | + git checkout develop |
| 73 | + git pull origin develop |
| 74 | + git checkout -b feature/your-feature-name |
| 75 | + ``` |
| 76 | +5. **Make Your Changes**\ |
| 77 | + Implement your feature or fix following the project's coding standards: |
| 78 | + - Write clean, readable code with appropriate comments |
| 79 | + - Follow existing code formatting and structure |
| 80 | + - Test your changes thoroughly |
| 81 | + - Ensure the application works as expected |
| 82 | +6. **Test Your Changes**\ |
| 83 | + Build and test the Docker container locally: |
| 84 | + ```bash |
| 85 | + docker build -t digital-clock-test . |
| 86 | + docker run --rm -p 8080:80 digital-clock-test |
| 87 | + ``` |
| 88 | + Access `http://localhost:8080` to verify your changes. |
| 89 | +7. **Commit Your Changes**\ |
| 90 | + Use clear, descriptive commit messages: |
| 91 | + ```bash |
| 92 | + git add . |
| 93 | + git commit -m "feat: add 24-hour time format option" |
| 94 | + ``` |
| 95 | +8. **Merge to Your Develop Branch** |
| 96 | + ```bash |
| 97 | + git checkout develop |
| 98 | + git merge feature/your-feature-name |
| 99 | + ``` |
| 100 | +9. **Add Acknowledgement**\ |
| 101 | + To receive credit for your contribution: |
| 102 | + ```bash |
| 103 | + git checkout develop |
| 104 | + git checkout -b docs/acknowledgement |
| 105 | + ``` |
| 106 | + Edit the `README.md` file and add your information under the Acknowledgement section: |
| 107 | + ```markdown |
| 108 | + * **Contributors:** |
| 109 | + - [Your Name](https://github.com/your-username) |
| 110 | + ``` |
| 111 | + Commit and merge: |
| 112 | + ```bash |
| 113 | + git add README.md |
| 114 | + git commit -m "docs: add contributor acknowledgement" |
| 115 | + git checkout develop |
| 116 | + git merge docs/acknowledgement |
| 117 | + ``` |
| 118 | +10. **Create a Release Branch**\ |
| 119 | + Once all changes are ready in `develop`: |
| 120 | + ```bash |
| 121 | + git checkout -b release/v1.2.3 develop |
| 122 | + ``` |
| 123 | + The version number should follow Semantic Versioning: |
| 124 | + - MAJOR: Breaking changes |
| 125 | + - MINOR: New features (backward compatible) |
| 126 | + - PATCH: Bug fixes (backward compatible) |
| 127 | +11. **Push to Your Fork** |
| 128 | + ```bash |
| 129 | + git push origin release/v1.2.3 |
| 130 | + ``` |
| 131 | +12. **Create a Pull Request**\ |
| 132 | + 1. Go to the original Digital Clock repository on GitHub |
| 133 | + 2. Click "New Pull Request" |
| 134 | + 3. Select your fork's `release/v1.2.3` branch to merge into the original repository's `main` branch |
| 135 | + 4. Fill out the pull request template with: |
| 136 | + - **Summary:** Brief description of your changes |
| 137 | + - **Files Changed:** List of modified files |
| 138 | + - **Key Changes:** Detailed explanation of what changed |
| 139 | + - **What To Verify:** Testing instructions for reviewers |
| 140 | +13. **Wait for Review**\ |
| 141 | + The project owner will: |
| 142 | + - Review your code |
| 143 | + - Provide feedback or request changes |
| 144 | + - Merge your contribution once approved |
| 145 | + |
| 146 | +## Commit Message Guidelines |
| 147 | + |
| 148 | +Use conventional commit messages for clarity: |
| 149 | + |
| 150 | +### Format |
| 151 | + |
| 152 | +``` |
| 153 | +<type>: <description> |
| 154 | + |
| 155 | +[optional body] |
| 156 | + |
| 157 | +[optional footer] |
| 158 | +``` |
| 159 | +
|
| 160 | +### Types |
| 161 | +
|
| 162 | +- `feat`: New feature |
| 163 | +- `fix`: Bug fix |
| 164 | +- `refactor`: Code restructuring without feature changes |
| 165 | +- `docs`: Documentation updates |
| 166 | +- `style`: Code formatting (no functional changes) |
| 167 | +- `test`: Adding or updating tests |
| 168 | +- `chore`: Maintenance tasks |
| 169 | +- `perf`: Performance improvements |
| 170 | +
|
| 171 | +### Examples |
| 172 | +
|
| 173 | +```bash |
| 174 | +feat: add dark mode toggle |
| 175 | +fix: correct AM/PM display for midnight |
| 176 | +refactor: extract logging into separate module |
| 177 | +docs: update installation instructions |
| 178 | +``` |
| 179 | + |
| 180 | +## Pull Request Process |
| 181 | + |
| 182 | +### PR Description Template |
| 183 | + |
| 184 | +Your pull request should include these four sections: |
| 185 | + |
| 186 | +- **Summary**\ |
| 187 | + Provide a concise overview of what your PR accomplishes and why it's needed. |
| 188 | +- **Files Changed**\ |
| 189 | + List all files that were modified, added, or removed. |
| 190 | +- **Key Changes**\ |
| 191 | + Detail the specific changes made in each file and explain the reasoning behind them. |
| 192 | +- **What To Verify**\ |
| 193 | + Provide clear testing instructions for reviewers to validate your changes. |
| 194 | + |
| 195 | +### Review Process |
| 196 | + |
| 197 | +1. All PRs require review by the project owner |
| 198 | +2. Address any feedback or requested changes promptly |
| 199 | +3. Keep discussions professional and constructive |
| 200 | +4. Once approved, your PR will be merged into `main` |
| 201 | + |
| 202 | +## Code of Conduct |
| 203 | + |
| 204 | +We are committed to providing a welcoming and inclusive environment for all contributors. By participating in this project, you agree to: |
| 205 | + |
| 206 | +- Be respectful and considerate in all interactions |
| 207 | +- Welcome newcomers and help them get started |
| 208 | +- Accept constructive criticism gracefully |
| 209 | +- Focus on what is best for the community and project |
| 210 | +- Show empathy towards other community members |
| 211 | + |
| 212 | +Unacceptable behavior includes harassment, discriminatory language, or any form of disrespectful conduct. If you experience or witness such behavior, please report it to the project maintainer. |
| 213 | + |
| 214 | +## Questions? |
| 215 | + |
| 216 | +If you have any questions about contributing, feel free to: |
| 217 | + |
| 218 | +- Open an issue with the `question` label |
| 219 | +- Reach out to the project maintainer: [Amnoor Brar](https://github.com/Amnoor/) |
| 220 | + |
| 221 | +Thank you for contributing to Digital Clock! |
0 commit comments