Skip to content

Latest commit

 

History

History
218 lines (156 loc) · 4.92 KB

File metadata and controls

218 lines (156 loc) · 4.92 KB

Contributing to BetaVersion.io

Thank you for your interest in contributing to our project! We appreciate your time and effort in making this project better.

Table of Contents

Code of Conduct

By participating in this project, you agree to maintain a respectful and inclusive environment for everyone.

Getting Started

  1. Fork the repository
  2. Clone your fork: git clone https://github.com/YOUR-USERNAME/website.git
  3. Add upstream remote: git remote add upstream https://github.com/ORIGINAL-OWNER/website.git
  4. Create a new branch: git checkout -b feature/your-feature-name

Development Setup

Prerequisites

  • Node.js 20.x or higher
  • pnpm 9.x (recommended)
  • Git

Installation

# Install dependencies
pnpm install

# Start development server
pnpm dev

# Run linting
pnpm lint

# Build for production
pnpm build

Docker Development

# Start development environment
docker-compose -f docker-compose.dev.yml up

# Build production image
docker build -t website .

# Run production container
docker-compose up

How to Contribute

Reporting Bugs

  • Use the GitHub issue tracker
  • Check if the issue already exists
  • Use the bug report template
  • Include as much detail as possible
  • Add screenshots or code samples if applicable

Suggesting Features

  • Use the feature request template
  • Clearly describe the feature and its benefits
  • Explain why this feature would be useful
  • Consider providing implementation suggestions

Submitting Changes

  1. Ensure your code follows our coding standards
  2. Write clear, concise commit messages
  3. Add tests for new functionality
  4. Update documentation as needed
  5. Ensure all tests pass
  6. Submit a pull request

Pull Request Process

  1. Update the README.md or relevant documentation with details of changes
  2. Follow the pull request template
  3. Link any related issues
  4. Request review from maintainers
  5. Address review feedback promptly
  6. Ensure CI/CD checks pass
  7. Squash commits if requested
  8. Wait for approval from at least one maintainer

Coding Standards

TypeScript/JavaScript

  • Use TypeScript for all new files
  • Follow the existing code style
  • Use meaningful variable and function names
  • Write self-documenting code with comments for complex logic
  • Avoid any types; use proper type definitions
  • Use functional components and hooks for React

React Best Practices

  • Use functional components
  • Leverage React hooks appropriately
  • Keep components small and focused
  • Extract reusable logic into custom hooks
  • Use proper prop types
  • Follow the component structure:
    1. Imports
    2. Types/Interfaces
    3. Component definition
    4. Hooks
    5. Event handlers
    6. Render logic

File Naming

  • React components: PascalCase (e.g., UserProfile.tsx)
  • Utilities and helpers: camelCase (e.g., formatDate.ts)
  • Constants: UPPER_SNAKE_CASE in a constants.ts file
  • Test files: ComponentName.test.tsx

CSS/Styling

  • Use Tailwind CSS utility classes
  • Follow mobile-first approach
  • Keep custom CSS minimal
  • Use CSS modules for component-specific styles if needed

Commit Message Guidelines

We follow the Conventional Commits specification.

Format

<type>(<scope>): <subject>

<body>

<footer>

Types

  • feat: A new feature
  • fix: A bug fix
  • docs: Documentation only changes
  • style: Changes that don't affect code meaning (formatting, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Performance improvements
  • test: Adding or correcting tests
  • chore: Changes to build process or auxiliary tools
  • ci: Changes to CI configuration files and scripts

Examples

feat(auth): add social login integration

Implemented OAuth login flow with Google and GitHub providers.
Added user profile synchronization after successful authentication.

Closes #123
fix(api): resolve race condition in data fetching

Fixed an issue where concurrent API calls could result in stale data.
Added proper request cancellation and cleanup.

Fixes #456

Testing

Running Tests

# Run all tests
pnpm test

# Run tests in watch mode
pnpm test:watch

# Run tests with coverage
pnpm test:coverage

Writing Tests

  • Write tests for all new features
  • Maintain test coverage above 80%
  • Use descriptive test names
  • Follow the AAA pattern: Arrange, Act, Assert
  • Mock external dependencies
  • Test edge cases and error conditions

Questions?

If you have questions, feel free to:

  • Open a discussion on GitHub
  • Reach out to maintainers
  • Check existing issues and PRs

Thank you for contributing!