# Contributing to newzy First off, thank you for considering contributing to **newzy**! It's people like you that make this project great. ## Table of Contents - [Code of Conduct](#code-of-conduct) - [Getting Started](#getting-started) - [How to Contribute](#how-to-contribute) - [Branch Strategy](#branch-strategy) - [Git Workflow](#git-workflow) - [Commit Message Guidelines](#commit-message-guidelines) - [Pull Request Process](#pull-request-process) - [Reporting Bugs](#reporting-bugs) - [Adding Features](#adding-features) ## Code of Conduct Please be respectful and constructive. We aim to maintain a welcoming environment for all contributors. ## Getting Started ### Prerequisites Before contributing, ensure you have: - Node.js v18+ installed - npm or yarn installed - Git configured with your email and name: ```bash git config --global user.email "you@example.com" git config --global user.name "Your Name" ``` ### Setup Development Environment ```bash git clone cd newzy npm install cp .env.example .env # Update .env with your configuration npm run dev ``` ## How to Contribute ### 1. Find or Create an Issue - Check existing issues for similar problems/features - If no issue exists, create one describing the problem/feature clearly - Reference relevant documentation or examples if applicable ### 2. Fork and Clone the Repository ```bash git clone https://github.com//newzy.git cd newzy git remote add upstream https://github.com//newzy.git ``` ### 3. Create a Branch Follow our [branch strategy](#branch-strategy) below. ### 4. Make Your Changes - Follow the existing code style - Write tests for new features/bug fixes - Update documentation as needed ### 5. Test Locally Ensure your changes work correctly before submitting. ### 6. Commit Your Changes Use [commit message guidelines](#commit-message-guidelines) below. ### 7. Create a Pull Request Fill out the PR template, reference issues, and ensure all CI checks pass. ## Branch Strategy Our repository uses a standard Git flow with the following branches: ### `main` (Production) - **Purpose**: Production-ready, stable releases only - **Branch protection**: Enabled - **Access**: Requires approval for merges - **Content**: Merged, tested, and approved code ### `develop` (Integration) - **Purpose**: Integration branch for feature development - **Branch protection**: Enabled with checks required - **Access**: Open for contributors - **Content**: Completed features ready for next release ### Feature Branches (`feature/*`) - **Pattern**: `feature/` or `feature/issue-number/` - **Example**: `feature/42/article-search` or `feature/article-search` - **Usage**: Create from `develop`, merge back to `develop` when complete ### Bugfix Branches (`bugfix/*`) - **Pattern**: `bugfix/` or `bugfix/issue-number/` - **Example**: `bugfix/43/image-upload-crash` - **Usage**: Create from `develop`, merge back to both `develop` and `main` if critical ### Hotfix Branches (`hotfix/*`) - **Pattern**: `hotfix/-` - **Example**: `hotfix/50-critical-login-fix` - **Usage**: Create from `main`, merge back to both `main` and `develop` ## Git Workflow ### Pre-push Hooks We use pre-push hooks to enforce code quality. These automatically: - Run linting checks - Build the project (if applicable) - Ensure no sensitive files are committed To see hook output, run with verbose flags or check the `.github/hooks/pre-push.sh` script. ### Merge Conflict Resolution Strategy 1. **First responder owns**: The person who first modifies conflicting code takes responsibility 2. **Communicate early**: Notify team members immediately of conflicts 3. **Use git merge tools**: Visual diff tools help resolve conflicts cleanly 4. **Test thoroughly**: All merged code must pass tests 5. **Update documentation**: Document any workflow changes Recommended merge tool: [VSCode Merge Conflict Resolution](https://marketplace.visualstudio.com/items?itemName=rogalmi.bash-merge-tool) or [KDiff3](https://kdiff3.org/) ## Commit Message Guidelines We follow the [Conventional Commits](https://www.conventionalcommits.org/) format: ``` ():