This document outlines the contribution guidelines and Git workflow for the Book Tracking System project.
We follow a Git workflow based on GitFlow but simplified for this project's needs. It revolves around a main branch for releases, a dev branch for integration, and feature branches for development.
- The
mainbranch represents the official, production-ready release history. - It is protected. All merges into
mainmust be done via Pull Requests from thedevbranch and only during a release. - Direct commits to
mainare strictly forbidden. - Each merge to
mainshould be tagged with a version number (e.g.,v1.0.0).
- The
devbranch is the primary development branch where all feature branches are merged. - It contains the latest, integrated code that is being prepared for the next release.
- All feature branches must be created from
dev.
- All new features and bug fixes must be developed in separate branches.
- Branch names should be descriptive and follow this convention:
- For new features:
feature/<feature-name>(e.g.,feature/user-authentication) - For bug fixes:
fix/<bug-name>(e.g.,fix/heatmap-rendering-issue)
- For new features:
- Branches should be created from the latest version of the
devbranch.
- Create a branch: Start by creating a new feature or fix branch from
dev. - Develop: Make your code changes, following the project's coding standards.
- Commit: Use clear and conventional commit messages (see below).
- Push: Push your branch to the remote repository.
- Create a Pull Request: Open a Pull Request from your branch to the
devbranch. - Review: At least one other team member must review and approve the PR.
- Merge: Once approved, the PR can be merged into
dev.
We use the Conventional Commits specification. This helps in automating changelogs and makes the commit history more readable.
Each commit message should be in the format: <type>: <description>
feat: A new feature.fix: A bug fix.docs: Changes to documentation.style: Code style changes (formatting, etc.).refactor: A code change that neither fixes a bug nor adds a feature.test: Adding or correcting tests.chore: Changes to the build process or auxiliary tools.
Example:
feat: Add user login endpoint
fix: Correct calculation for average pages per day