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/andsrc/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 newcomershelp wanted- Need community assistancebug- Bug fixes neededenhancement- 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
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
2
Check TypeScript
3
Run Linter
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
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
7. Push and Create Pull Request
1
Push Your Branch
2
Create Pull Request
- Go to your fork on GitHub
- Click “Compare & pull request”
- Fill out the PR template (see below)
- Click “Create pull request”
Pull Request Template
Code Review Process
After submitting your PR:- Automated Checks: CI/CD runs linter and builds
- Code Review: Maintainers review your code
- Feedback: Address any requested changes
- Approval: PR is approved by maintainers
- 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?- Discuss First: Open an issue to discuss the feature before implementing
- Get Approval: Wait for maintainer feedback
- Implement: Follow the development workflow
- 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 indefinitions.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
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