Skip to content

Latest commit

 

History

History
218 lines (160 loc) · 4.58 KB

File metadata and controls

218 lines (160 loc) · 4.58 KB

Contributing to CodeSync

Thank you for your interest in contributing to CodeSync! This document provides guidelines and information for contributors.

🚀 Getting Started

Prerequisites

  • Node.js 18+
  • PostgreSQL 15+
  • Redis 7+
  • Docker and Docker Compose
  • Git

Development Setup

  1. Fork and clone the repository

    git clone https://github.com/your-username/CodeSync.git
    cd CodeSync
  2. Install dependencies

    npm install
  3. Set up environment variables

    cp .env.example .env
    cp client/.env.example client/.env
  4. Start development environment

    docker-compose up -d
    cd server && npm run db:migrate && npm run db:seed
    cd .. && npm run dev

📋 Development Guidelines

Code Style

  • Use TypeScript for all new code
  • Follow ESLint and Prettier configurations
  • Write meaningful commit messages
  • Add tests for new features
  • Update documentation as needed

Commit Message Format

type(scope): description

[optional body]

[optional footer]

Types:

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation changes
  • style: Code style changes
  • refactor: Code refactoring
  • test: Adding or updating tests
  • chore: Maintenance tasks

Branch Naming

  • feature/description - New features
  • fix/description - Bug fixes
  • docs/description - Documentation updates
  • refactor/description - Code refactoring

🧪 Testing

Running Tests

# Backend tests
cd server && npm test

# Frontend tests
cd client && npm test

# Load tests
cd server && npm run load-test

Test Requirements

  • All new features must include tests
  • Maintain or improve test coverage
  • Tests should be meaningful and test actual functionality
  • Include both positive and negative test cases

📝 Pull Request Process

  1. Create a feature branch

    git checkout -b feature/your-feature-name
  2. Make your changes

    • Write clean, documented code
    • Add tests for new functionality
    • Update documentation if needed
  3. Test your changes

    npm test
    npm run lint
  4. Commit your changes

    git add .
    git commit -m "feat: add new feature description"
  5. Push to your fork

    git push origin feature/your-feature-name
  6. Create a Pull Request

    • Use a clear title and description
    • Reference any related issues
    • Include screenshots for UI changes
    • Ensure all checks pass

Pull Request Checklist

  • Code follows project style guidelines
  • Tests pass locally
  • New tests added for new functionality
  • Documentation updated if needed
  • No breaking changes (or clearly documented)
  • Commit messages follow convention

🐛 Bug Reports

When reporting bugs, please include:

  • Clear description of the issue
  • Steps to reproduce
  • Expected vs actual behavior
  • Environment details (OS, Node version, etc.)
  • Screenshots or logs if applicable

Use the bug report template when creating issues.

💡 Feature Requests

For feature requests, please:

  • Check if the feature already exists
  • Provide clear use case and rationale
  • Consider implementation complexity
  • Be open to discussion and feedback

🏗️ Architecture Guidelines

Backend (Server)

  • Follow RESTful API conventions
  • Use proper HTTP status codes
  • Implement proper error handling
  • Add input validation
  • Write comprehensive tests

Frontend (Client)

  • Use React functional components with hooks
  • Implement proper state management with Zustand
  • Follow responsive design principles
  • Add proper error boundaries
  • Write component tests

Real-time Features

  • Use Socket.IO for WebSocket communication
  • Implement proper event handling
  • Add connection state management
  • Handle network failures gracefully

📚 Resources

🤝 Code of Conduct

  • Be respectful and inclusive
  • Provide constructive feedback
  • Help others learn and grow
  • Follow project guidelines
  • Report inappropriate behavior

📞 Getting Help

  • Create an issue for bugs or questions
  • Join discussions in existing issues
  • Check documentation first
  • Be patient and respectful

🎉 Recognition

Contributors will be recognized in:

  • README.md contributors section
  • Release notes for significant contributions
  • Project documentation

Thank you for contributing to CodeSync! 🚀