Skip to main content

Contributing to OpenChat

Thanks for your interest in contributing to OpenChat! This guide will help you get started.

Before You Start

1

Install Prerequisites

  • Bun 1.3+ - Package manager and runtime
  • Node.js 20+ - Required for some tooling
  • Git - Version control
  • Docker (optional) - For container-based development
2

Read the Codebase

Familiarize yourself with:
3

Set Up Development Environment

Follow the Quickstart to get OpenChat running locally.

Development Workflow

1. Create a Branch

Branch naming conventions:
  • feat/ - New features
  • fix/ - Bug fixes
  • docs/ - Documentation changes
  • refactor/ - Code refactoring
  • chore/ - Maintenance tasks

2. Make Changes

Follow our coding standards:

3. Verify Your Changes

Run these before pushing:

4. Commit with Conventional Commits

Use Conventional Commits format:
Scopes: web, server, docs, extension, or omit for cross-cutting changes.

5. Open a Pull Request

Include in your PR:
  • Summary - What changed and why
  • Scope - Which apps affected (web/server/both)
  • Testing notes - How to verify the change
  • Screenshots/GIFs - For UI changes
Link related issues with Fixes #123 or Closes #123 to auto-close them on merge.

Coding Standards

TypeScript

React Components

Convex Functions

Testing

Running Tests

Writing Tests

Colocate tests with source files:
Example test:

Convex Tests

Use convex-test for Convex function tests:

Documentation

Update docs when:
  • Adding user-facing features
  • Changing configuration options
  • Modifying API behavior
  • Updating deployment steps

Docs Structure

Local Docs Preview

Pull Request Review

What We Look For

  • Code follows project conventions
  • Tests added/updated for changes
  • Documentation updated if needed
  • No breaking changes (or clearly documented)
  • Commits are clean and well-described
  • CI checks pass

Automated Checks

PRs trigger:
  • Lint - oxlint
  • Type check - TypeScript
  • Tests - Vitest
  • Build - Production build verification
  • CodeQL - Security scanning

Getting Reviews

  1. Self-review first - Check your own PR before requesting review
  2. Respond to feedback - Address comments or explain why you disagree
  3. Keep it small - Smaller PRs get faster, better reviews

Common Tasks

Adding a New Page

  1. Create route file in apps/web/src/routes/
  2. Use auth guard pattern if needed
  3. Add navigation link to sidebar

Adding a Convex Function

  1. Add to appropriate file in apps/server/convex/
  2. Update schema if adding new table
  3. Run bun x convex codegen to update types

Adding UI Components

  1. Use shadcn/ui primitives when possible
  2. Add to apps/web/src/components/
  3. Follow existing patterns in the codebase

Getting Help

GitHub Discussions

Ask questions and share ideas

GitHub Issues

Report bugs or check existing issues

Code of Conduct

We follow the Contributor Covenant. Be respectful, inclusive, and constructive. For security issues, please email the maintainers directly rather than opening a public issue.
Thank you for contributing to OpenChat! Every contribution helps make the project better.