Skip to main content
Answer Overflow uses a monorepo structure powered by Bun workspaces and Turbo for efficient builds and dependency management.

Architecture

The repository is organized into two main directories:
  • apps/* - Standalone applications (Discord bot, website, docs, E2E tests)
  • packages/* - Shared code and utilities used across applications

Build system

Bun workspaces

The monorepo uses Bun’s native workspace feature to manage dependencies across packages:
"workspaces": {
  "packages": [
    "apps/*",
    "packages/*"
  ]
}
All packages are linked together automatically, allowing apps to import from shared packages using workspace protocol (workspace:*).

Turbo

Turborepo orchestrates builds, tests, and development across the monorepo. It provides:
  • Parallel execution - Runs tasks across workspaces simultaneously
  • Caching - Skips unchanged packages to speed up builds
  • Task pipelines - Ensures dependencies are built in the correct order
Key tasks defined in turbo.json:
  • dev - Start development servers (persistent, no cache)
  • build - Build all applications and packages
  • typecheck - Type-check TypeScript across workspaces
  • test - Run test suites
  • lint - Lint code with Biome

Catalog pattern

Dependencies are managed using Bun’s catalog feature to ensure version consistency:
"catalog": {
  "react": "^19.1.1",
  "next": "^16.1.1-canary.5",
  "convex": "^1.31.2",
  "effect": "^3.19.8"
}
Packages reference catalog versions with "dependency": "catalog:".

Common commands

Install dependencies

bun install

Start development

bun run dev

Build all packages

bun run build

Type-check

bun run typecheck

Benefits

This monorepo structure provides:
  • Code sharing - Utilities and components are reused across apps
  • Consistent dependencies - The catalog ensures all packages use the same versions
  • Atomic changes - Update shared code and all consumers in a single commit
  • Faster CI - Turbo’s caching skips unchanged packages

Build docs developers (and LLMs) love