# Contributing to Charon Thank you for your interest in contributing to CaddyProxyManager+! This document provides guidelines and instructions for contributing to the project. ## Table of Contents - [Code of Conduct](#code-of-conduct) - [Getting Started](#getting-started) - [Development Workflow](#development-workflow) - [Coding Standards](#coding-standards) - [Testing Guidelines](#testing-guidelines) - [Pull Request Process](#pull-request-process) - [Issue Guidelines](#issue-guidelines) - [Documentation](#documentation) ## Code of Conduct This project follows a Code of Conduct that all contributors are expected to adhere to: - Be respectful and inclusive - Welcome newcomers and help them get started - Focus on what's best for the community - Show empathy towards other community members ## Getting Started -### Prerequisites - **Go 1.25.6+** for backend development - **Node.js 20+** and npm for frontend development - Git for version control - A GitHub account ### Development Tools Install golangci-lint for pre-commit hooks (required for Go development): ```bash # Option 1: Homebrew (macOS/Linux) brew install golangci-lint # Option 2: Go install (any platform) go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest # Option 3: Binary installation (see https://golangci-lint.run/usage/install/) curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin ``` Ensure `$GOPATH/bin` is in your `PATH`: ```bash export PATH="$PATH:$(go env GOPATH)/bin" ``` Verify installation: ```bash golangci-lint --version # Should output: golangci-lint has version 1.xx.x ... ``` **Note:** Pre-commit hooks will **BLOCK commits** if golangci-lint finds issues. This is intentional - fix the issues before committing. ### CI/CD Go Version Management GitHub Actions workflows automatically use Go 1.25.6 via `GOTOOLCHAIN: auto`, which allows the `setup-go` action to download and use the correct Go version even if the CI environment has an older version installed. This ensures consistent builds across all workflows. For local development, install Go 1.25.6+ from [go.dev/dl](https://go.dev/dl/). ### Fork and Clone 1. Fork the repository on GitHub 2. Clone your fork locally: ```bash git clone https://github.com/YOUR_USERNAME/charon.git cd charon ``` 1. Add the upstream remote: ```bash git remote add upstream https://github.com/Wikid82/charon.git ``` ### Set Up Development Environment **Backend:** ```bash cd backend go mod download go run ./cmd/seed/main.go # Seed test data go run ./cmd/api/main.go # Start backend ``` **Frontend:** ```bash cd frontend npm install npm run dev # Start frontend dev server ``` ## Development Workflow ### Branching Strategy - **main** - Production-ready code (stable releases) - **nightly** - Pre-release testing branch (automated daily builds at 02:00 UTC) - **development** - Main development branch (default for contributions) - **feature/** - Feature branches (e.g., `feature/add-ssl-support`) - **bugfix/** - Bug fix branches (e.g., `bugfix/fix-import-crash`) - **hotfix/** - Urgent production fixes ### Branch Flow The project uses a three-tier branching model: ``` development → nightly → main (unstable) (testing) (stable) ``` **Flow details:** 1. **development → nightly**: Automated daily merge at 02:00 UTC 2. **nightly → main**: Manual PR after validation and testing 3. **Contributors always branch from `development`** **Why nightly?** - Provides a testing ground for features before production - Automated daily builds catch integration issues - Users can test pre-release features via `nightly` Docker tag - Maintainers validate stability before merging to `main` ### Creating a Feature Branch Always branch from `development`: ```bash git checkout development git pull upstream development git checkout -b feature/your-feature-name ``` **Note:** Never branch from `nightly` or `main`. The `nightly` branch is managed by automation and receives daily merges from `development`. ### Commit Message Guidelines Follow the [Conventional Commits](https://www.conventionalcommits.org/) specification: ``` ():