Skip to main content

Contributing

Thank you for your interest in contributing to Answer Overflow! We welcome contributions of all kinds, from bug fixes to new features.
If you need any help, please reach out in our Discord community!

Before you start

1

Set up your development environment

Follow the Development setup guide to get Answer Overflow running locally.
2

Find something to work on

  • Check the GitHub Issues for open tasks
  • Look for issues labeled good first issue for beginner-friendly tasks
  • Join our Discord to discuss ideas for new features
3

Create a branch

git checkout -b feature/your-feature-name

Development workflow

VSCode workspace

VSCode users should open the answeroverflow.code-workspace file:
code answeroverflow.code-workspace
This workspace:
  • Configures all recommended settings
  • Hides unnecessary files (like node_modules)
  • Sets up the proper TypeScript configuration
The workspace hides some files by default. If you need to access node_modules or other hidden files, comment out the relevant lines in the workspace file.

Code quality

We use Biome for linting and formatting:
# Check for issues
bun lint

# Fix safe issues automatically
bun fix:safe

# Fix all issues (including unsafe fixes)
bun fix:unsafe

# Format code
bun format
Husky pre-commit hooks will automatically format your code before committing.

Type checking

Ensure your changes pass type checking:
bun typecheck

Testing

Running tests

1

Run all tests

bun run test
This runs tests for all packages except those explicitly filtered.
2

Test a specific package

cd packages/database
bun test:watch
3

Run E2E tests

cd apps/bot-e2e
bun test

Writing tests

We use Vitest for testing. Here’s a basic example:
import { describe, expect, test } from "vitest";

describe("My feature", () => {
  test("should do something", () => {
    const result = myFunction();
    expect(result).toBe(expectedValue);
  });
});
Add tests for any new features or bug fixes. Tests should be placed in the same directory as the code they test.

Pull request process

1

Ensure all checks pass

Before opening a PR, run:
bun run ci
This runs linting, type checking, and tests.
2

Commit your changes

Write clear, descriptive commit messages:
git add .
git commit -m "feat: add new feature for X"
Commit message prefixes:
  • feat: - New feature
  • fix: - Bug fix
  • docs: - Documentation changes
  • refactor: - Code refactoring
  • test: - Adding or updating tests
  • chore: - Maintenance tasks
3

Push to your fork

git push origin feature/your-feature-name
4

Create a pull request

  1. Go to the Answer Overflow repository
  2. Click “New Pull Request”
  3. Select your branch
  4. Fill out the PR template with:
    • Description of changes
    • Related issue numbers
    • Screenshots (if applicable)
    • Testing steps
5

Address review feedback

  • Respond to reviewer comments
  • Make requested changes
  • Push updates to your branch
  • Re-request review when ready

Code style guidelines

TypeScript

  • Use TypeScript strict mode
  • Prefer const over let
  • Use meaningful variable names
  • Add type annotations for function parameters and return types
  • Use Effect for functional programming patterns where appropriate
// Good
const processThread = (threadId: string): Promise<void> => {
  // ...
};

// Avoid
let x = (y) => {
  // ...
};

React

  • Use functional components
  • Prefer hooks over class components
  • Keep components small and focused
  • Use proper TypeScript types for props
interface Props {
  title: string;
  onClose: () => void;
}

export const MyComponent = ({ title, onClose }: Props) => {
  return (
    <div>
      <h1>{title}</h1>
      <button onClick={onClose}>Close</button>
    </div>
  );
};

Effect usage

When working with the Discord bot or database packages, follow Effect patterns:
import { Effect } from "effect";

const fetchData = Effect.tryPromise({
  try: () => api.getData(),
  catch: (error) => new FetchError({ cause: error }),
});

Package-specific guidelines

Database package

When modifying the database schema:
  1. Update the schema in packages/database/convex/schema.ts
  2. Run bun codegen to regenerate types
  3. Create a migration if needed
  4. Test thoroughly before committing

Discord bot

When adding new bot commands:
  1. Create a new file in apps/discord-bot/src/commands/
  2. Follow the existing command structure
  3. Register the command in the bot initialization
  4. Add tests for the command logic

Main site

When adding new pages:
  1. Use the Next.js App Router structure
  2. Implement proper SEO metadata
  3. Ensure responsive design
  4. Test with Convex real-time updates

Building

Build the entire monorepo:
bun run build
This will:
  1. Build all packages in dependency order
  2. Generate type definitions
  3. Compile TypeScript
  4. Build Next.js for production
The build uses Turbo’s caching to avoid rebuilding unchanged packages.

Getting help

Discord Community

Ask questions and get help from the community

GitHub Issues

Report bugs or request features

Architecture Guide

Learn about the system design

Development Setup

Set up your development environment

License

By contributing to Answer Overflow, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to Answer Overflow! Every contribution helps make Discord knowledge more discoverable.

Build docs developers (and LLMs) love