Contributing Guide
Thank you for your interest in contributing to OpenCodeHub! We welcome contributions from everyone.
🛠 Local Development Setup
Section titled “🛠 Local Development Setup”To contribute code, you need to set up the project locally.
Prerequisites
Section titled “Prerequisites”- Node.js: v18 or v20 (LTS).
- Bun: v1.0+ (Our package manager/runner).
- Docker: For running the database locally.
Step 1: Clone & Install
Section titled “Step 1: Clone & Install”git clone https://github.com/swadhinbiswas/OpencodeHub.gitcd OpencodeHub
# Install dependencies (fast!)bun installStep 2: Database Setup
Section titled “Step 2: Database Setup”Start a local Postgres and Redis instance using Docker:
docker-compose up -d postgres redisCopy the environment config:
cp .env.example .envNote: The default .env.example is pre-configured to work with the docker-compose services.
Push the schema to the database:
bun db:pushStep 3: Run the App
Section titled “Step 3: Run the App”Start the development server:
bun devVisit http://localhost:3000.
🧪 Running Tests
Section titled “🧪 Running Tests”We use Vitest for unit tests. Use TDD!
# Run all testsbun test
# Run specific test filebun test user.test.ts
# Watch modebun test --watch🎨 Code Style
Section titled “🎨 Code Style”We use ESLint and Prettier to enforce code style.
- Lint:
bun lint - Format:
bun format
Commit Messages
Section titled “Commit Messages”We follow the Conventional Commits specification.
feat: add new login pagefix: resolve crash on startupdocs: update troubleshooting guide
🚀 Submitting a Pull Request
Section titled “🚀 Submitting a Pull Request”- Fork the repository.
- Create a feature branch:
git checkout -b feat/my-feature. - Commit your changes.
- Push to your fork.
- Open a Pull Request.
- Wait for CI checks to pass.
- A team member will review your code!
Thank you for helping build OpenCodeHub! ❤️