Skip to main content

Overview

We welcome contributions to the Go React Scaffold project! This guide covers the contribution process, branching strategy, and pull request workflow.

Getting Started

Fork the Repository

  1. Navigate to the Go React Scaffold repository
  2. Click the Fork button in the top right
  3. Clone your fork locally:
git clone <your-fork-url>
cd go-react-scaffold

Set Up Development Environment

Follow the quick start guide to set up your local development environment:
  1. Install prerequisites:
    • Frontend: Node.js 18+, npm
    • Backend: Go 1.21+, Docker
  2. Set up the backend:
    cd backend
    cp .env.example .env
    make docker-run  # Start MongoDB
    make run         # Start backend server
    
  3. Set up the frontend:
    cd frontend
    npm install
    npm run dev
    

Branching Strategy

Branch Naming Convention

Create a descriptive feature branch from main:
git checkout -b feature/your-feature-name
Branch name patterns:
  • feature/ - New features (e.g., feature/user-profiles)
  • fix/ - Bug fixes (e.g., fix/login-error)
  • docs/ - Documentation updates (e.g., docs/api-reference)
  • refactor/ - Code refactoring (e.g., refactor/auth-module)
  • test/ - Adding or updating tests (e.g., test/auth-handlers)

Working on Your Branch

  1. Make your changes in focused, logical commits
  2. Follow the coding standards (see Coding Standards)
  3. Write or update tests for your changes
  4. Keep your branch up to date with main:
git fetch origin
git rebase origin/main

Before Committing

Run Tests and Linters

Always run tests and linters before committing to ensure code quality.
Backend:
cd backend
make test
Frontend:
cd frontend
npm run lint

Commit Message Guidelines

Write clear, descriptive commit messages: Preferred format (Conventional Commits):
type(scope): brief description

Optional longer description explaining the changes
and why they were made.
Examples:
feat(auth): add password reset functionality

fix(api): resolve JWT token expiration issue

docs(readme): update installation instructions

refactor(users): simplify user model validation
Commit types:
  • feat: New feature
  • fix: Bug fix
  • docs: Documentation changes
  • style: Code style changes (formatting, no logic changes)
  • refactor: Code refactoring
  • test: Adding or updating tests
  • chore: Maintenance tasks
Keep commits focused and atomic - each commit should represent a single logical change.

Pull Request Process

Creating a Pull Request

  1. Push your branch to your fork:
    git push origin feature/your-feature-name
    
  2. Navigate to the original repository on GitHub
  3. Click Compare & pull request
  4. Fill out the pull request template:
PR Title: Use the same format as commit messages:
feat(auth): add password reset functionality
PR Description: Include:
  • Summary of changes
  • Motivation and context
  • Testing performed
  • Screenshots (if UI changes)
  • Breaking changes (if any)
Example PR description:
## Summary
Adds password reset functionality with email verification.

## Changes
- Added password reset endpoint
- Implemented email notification
- Updated user model with reset token
- Added frontend reset password form

## Testing
- Tested reset flow with valid email
- Tested with expired tokens
- Tested with invalid tokens
- Verified email delivery

## Screenshots
[If applicable]

PR Review Process

  1. Automated Checks: Ensure all CI checks pass
  2. Code Review: Address reviewer feedback promptly
  3. Testing: Reviewers will verify functionality
  4. Approval: At least one maintainer approval required
  5. Merge: Maintainers will merge approved PRs

Responding to Feedback

  • Address all review comments
  • Make requested changes in new commits
  • Push updates to your branch
  • Reply to comments to confirm changes
  • Mark conversations as resolved when addressed

Code Review Guidelines

What Reviewers Look For

  • Functionality: Does the code work as intended?
  • Tests: Are there adequate tests?
  • Code Quality: Is the code clean and maintainable?
  • Standards: Does it follow project coding standards?
  • Security: Are there any security concerns?
  • Performance: Are there performance implications?
  • Documentation: Is documentation updated?

As a Reviewer

  • Be constructive and respectful
  • Explain the reasoning behind suggestions
  • Approve PRs that meet quality standards
  • Request changes when necessary

Git Workflow

Complete Workflow Example

# 1. Fork and clone
git clone <your-fork-url>
cd go-react-scaffold

# 2. Create feature branch
git checkout -b feature/add-user-search

# 3. Make changes and commit
git add .
git commit -m "feat(users): add user search functionality"

# 4. Keep branch updated
git fetch origin
git rebase origin/main

# 5. Run tests
cd backend && make test
cd ../frontend && npm run lint

# 6. Push to your fork
git push origin feature/add-user-search

# 7. Create pull request on GitHub

What Not to Commit

Never commit sensitive data:
  • .env files with secrets
  • API keys or credentials
  • Database passwords
  • Session keys
  • Personal access tokens
  • node_modules/ (frontend)
  • Build artifacts (main binary, dist/)
These are already in .gitignore, but always verify before committing.

Getting Help

If you need assistance:
  1. Documentation: Check the documentation first
  2. Issues: Search existing issues for similar problems
  3. New Issue: Open a new issue if you can’t find a solution
  4. Discussions: Use GitHub Discussions for general questions

Code of Conduct

Be respectful and professional in all interactions:
  • Be welcoming and inclusive
  • Respect differing viewpoints
  • Accept constructive criticism gracefully
  • Focus on what’s best for the community
  • Show empathy towards others

Recognition

All contributors will be recognized in:
  • GitHub contributors list
  • Project documentation
  • Release notes
Thank you for contributing to the Go React Scaffold project!

Next Steps

Coding Standards

Review the code style guidelines and best practices

Project Structure

Understand the project organization

Build docs developers (and LLMs) love