Skip to main content

Welcome Contributors!

Thank you for your interest in contributing to BeeHex! This guide will help you get started with contributing code, reporting issues, and improving documentation.

Getting Started

1

Set Up Development Environment

Follow the Development Setup guide to get BeeHex running locally.
2

Explore the Codebase

Familiarize yourself with:
  • Project structure in src/app/ and src/components/
  • TypeScript interfaces in src/app/definitions.ts
  • WebSocket handling in src/app/game_mode/WebsocketHandler.ts
3

Find an Issue

Look for issues labeled:
  • good first issue - Great for newcomers
  • help wanted - Need community assistance
  • bug - Bug fixes needed
  • enhancement - New features
4

Start Contributing

Follow the workflow below to make your contribution.

Development Workflow

1. Fork and Clone

1

Fork the Repository

Click the Fork button on GitHub to create your copy of BeeHex.
2

Clone Your Fork

3

Add Upstream Remote

2. Create a Branch

Create a descriptive branch name:

3. Make Changes

Write clean, well-documented code:

4. Follow Code Standards

TypeScript Style Guide

BeeHex uses TypeScript with strict mode. Always define proper types!

React Component Best Practices

Code Organization

  • Components: One component per file in src/components/
  • Pages: Use Next.js App Router structure in src/app/
  • Types: Define shared types in src/app/definitions.ts
  • Utilities: Helper functions in separate utility files

5. Test Your Changes

1

Run the Development Server

Test your changes at http://localhost:3000
2

Check TypeScript

3

Run Linter

Fix any linting errors:
4

Test Different Scenarios

  • Test on different browsers (Chrome, Firefox, Safari)
  • Test different board sizes (5x5, 7x7, 9x9)
  • Test online and offline modes
  • Verify WebSocket reconnection handling
5

Build for Production

Ensure the build completes without errors.

6. Commit Your Changes

Commit Message Format

Follow conventional commit standards:

Commit Message Guidelines

  • Type: feat, fix, docs, style, refactor, test, chore
  • Subject: Short description (max 72 characters)
  • Body (optional): Detailed explanation
  • Footer (optional): Breaking changes, issue references
Example:

7. Push and Create Pull Request

1

Push Your Branch

2

Create Pull Request

  1. Go to your fork on GitHub
  2. Click “Compare & pull request”
  3. Fill out the PR template (see below)
  4. Click “Create pull request”

Pull Request Template

Code Review Process

After submitting your PR:
  1. Automated Checks: CI/CD runs linter and builds
  2. Code Review: Maintainers review your code
  3. Feedback: Address any requested changes
  4. Approval: PR is approved by maintainers
  5. Merge: Your contribution is merged!
Be patient and responsive to feedback. Reviews may take a few days.

Contribution Areas

🐛 Bug Fixes

Found a bug? Great!
1

Check Existing Issues

Search GitHub issues to see if it’s already reported.
2

Create Bug Report

If not reported, create a detailed issue:
  • Title: Clear, descriptive title
  • Description: What happened vs. what should happen
  • Steps to Reproduce: Detailed steps
  • Environment: Browser, OS, Node.js version
  • Screenshots: Visual evidence if applicable
3

Fix the Bug

Follow the workflow above to create a fix.

✨ New Features

Want to add a feature?
  1. Discuss First: Open an issue to discuss the feature before implementing
  2. Get Approval: Wait for maintainer feedback
  3. Implement: Follow the development workflow
  4. Document: Update documentation for your feature

📚 Documentation

Improve or add documentation:
  • Fix typos and grammatical errors
  • Add code examples
  • Improve existing explanations
  • Add new guides or tutorials
  • Update outdated information

🎨 UI/UX Improvements

  • Improve component styling
  • Enhance responsive design
  • Add animations and transitions
  • Improve accessibility (WCAG compliance)
  • Better color contrast and themes

🚀 Performance Optimization

  • Reduce bundle size
  • Optimize component rendering
  • Improve WebSocket efficiency
  • Add caching strategies
  • Optimize images and assets

Project Architecture

Key Files and Directories

definitions.ts

src/app/definitions.tsCore TypeScript interfaces and enums for game logic, packets, and state management.

WebsocketHandler.ts

src/app/game_mode/WebsocketHandler.tsWebSocket client for real-time communication with game server.

layout.tsx

src/app/layout.tsxRoot layout component with metadata and global styles.

env.ts

src/env/env.tsEnvironment configuration (gitignored).

Technology Stack

WebSocket Protocol

BeeHex uses custom WebSocket packets defined in definitions.ts:

Client-Bound Packets (Server → Client)

Server-Bound Packets (Client → Server)

Game State Management

Common Tasks

Adding a New Component

1

Create Component Directory

2

Create Component Files

src/components/my_component/my_component.tsx
src/components/my_component/my_component.module.css
3

Use Component

src/app/page.tsx

Adding a New Page Route

1

Create Route Directory

2

Create Page Component

src/app/new_page/page.tsx
3

Add Styling

src/app/new_page/page.module.css

Handling WebSocket Events

Style Guide

Component Structure

Naming Conventions

  • Components: PascalCase (GameBoard, PlayerCard)
  • Files: snake_case for directories, PascalCase for React components
  • Functions: camelCase (handleMove, validateInput)
  • Constants: UPPER_SNAKE_CASE (BOARD_SIZES, TIME_LIMITS)
  • Types/Interfaces: PascalCase (GameState, PlayerInfo)

Getting Help

Need assistance?
  • GitHub Issues: Ask questions in issues
  • Discussions: Use GitHub Discussions for general questions
  • Documentation: Check technical documentation
  • Code Examples: Look at existing components for patterns

Recognition

Contributors are recognized in:
  • GitHub contributors page
  • Project README
  • Release notes for significant contributions
Thank you for contributing to BeeHex! 🐝

Next Steps

Setup Guide

Set up your development environment

Architecture Overview

Understand the system architecture

Deployment

Learn about deployment processes

WebSocket Protocol

Explore the WebSocket communication protocol