sourcebot/CONTRIBUTING.md
Furbreeze 5f5690ec49
Some checks failed
Update Roadmap Released / update (push) Has been cancelled
Publish to ghcr / build (linux/amd64, blacksmith-4vcpu-ubuntu-2404) (push) Has been cancelled
Publish to ghcr / build (linux/arm64, blacksmith-8vcpu-ubuntu-2204-arm) (push) Has been cancelled
Publish to ghcr / merge (push) Has been cancelled
adding contribution step for generating database schema (#602)
2025-11-06 10:50:41 -08:00

2 KiB

Build from source

Note

Building from source is only required if you'd like to contribute. The recommended way to use Sourcebot is to use the pre-built docker image.

  1. Install go, docker, and NodeJS. Note that a NodeJS version of at least 21.1.0 is required.

  2. Install ctags (required by zoekt)

    // macOS:
    brew install universal-ctags
    
    // Linux:
    snap install universal-ctags
    
  3. Install yarn:

    npm install --global yarn
    
  4. Clone the repository with submodules:

    git clone --recurse-submodules https://github.com/sourcebot-dev/sourcebot.git
    
  5. Run make to build zoekt and install dependencies:

    cd sourcebot
    make
    

    The zoekt binaries and web dependencies are placed into bin and node_modules respectively.

  6. Start the development Docker containers for PostgreSQL and Redis.

    docker compose -f docker-compose-dev.yml up -d
    
  7. Generate the database schema.

    yarn dev:prisma:migrate:dev
    
  8. Create a copy of .env.development and name it .env.development.local. Update the required environment variables.

  9. If you're using a declarative configuration file, create a configuration file and update the CONFIG_PATH environment variable in your .env.development.local file.

  10. Start Sourcebot with the command:

    yarn dev
    

    A .sourcebot directory will be created and zoekt will begin to index the repositories found in the config.json file.

  11. Start searching at http://localhost:3000.