> ## Documentation Index
> Fetch the complete documentation index at: https://sourcebot-whoisthey-pin-citation-commit-sha.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Architecture

Sourcebot is shipped as a single docker container that runs a collection of services using [supervisord](https://supervisord.org/):

<img src="https://mintcdn.com/sourcebot-whoisthey-pin-citation-commit-sha/957auaeBl6dzRmSg/images/architecture_diagram.png?fit=max&auto=format&n=957auaeBl6dzRmSg&q=85&s=c80d028efa278e6e8099fdf20d29de5c" alt="architecture diagram" width="5777" height="3534" data-path="images/architecture_diagram.png" />

Sourcebot consists of the following components:

* **Web Server** : main Next.js web application serving the Sourcebot UI.
* **Backend Worker** : Node.js process that incrementally syncs with code hosts (e.g., GitHub, GitLab etc.) and asynchronously indexes configured repositories.
* **Zoekt** : the [open-source](https://github.com/sourcegraph/zoekt), trigram indexing code search engine that powers Sourcebot under the hood.
* **Postgres** : transactional database for storing business-logic data.
* **Redis Job Queue** : fast in-memory store. Used with [BullMQ](https://docs.bullmq.io/) for queuing asynchronous work.
* **`.sourcebot/` cache** : file-system cache where persistent data is written.

You can use managed Redis / Postgres services that run outside of the Sourcebot container by providing the `REDIS_URL` and `DATABASE_URL` environment variables, respectively. See the [environment variables](/docs/configuration/environment-variables) doc for more configuration options.
