API Server
REST API serving the web UI and CLI. Handles search requests, repository management, and job coordination.
Code Search is built with a modular architecture designed for scalability and extensibility.
┌─────────────────────────────────────────────────────────────────┐│ Web UI / CLI │└─────────────────────────────────────────────────────────────────┘ │ ▼┌─────────────────────────────────────────────────────────────────┐│ API Server ││ ││ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────────────┐ ││ │ Search │ │ Repos │ │ Jobs │ │ Connections │ ││ │ Handler │ │ Handler │ │ Handler │ │ Handler │ ││ └──────────┘ └──────────┘ └──────────┘ └──────────────────┘ │└─────────────────────────────────────────────────────────────────┘ │ │ │ ▼ ▼ ▼┌──────────────┐ ┌──────────────┐ ┌──────────────┐│ Zoekt │ │PostgreSQL/ │ │ Redis ││ (Search Index)│ │MySQL (Data) │ │ (Queue) │└──────────────┘ └──────────────┘ └──────────────┘ ▲ ▲ │ │┌─────────────────────────────────────────────────────────────────┐│ Indexer Service ││ ││ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────────────┐ ││ │Scheduler │ │ Worker │ │ Cloner │ │ Index Builder │ ││ └──────────┘ └──────────┘ └──────────┘ └──────────────────┘ │└─────────────────────────────────────────────────────────────────┘ │ ▼┌─────────────────────────────────────────────────────────────────┐│ Code Hosts ││ ││ ┌──────────┐ ┌──────────────────┐ ┌────────────────────────┐ ││ │ GitHub │ │ GitHub │ │ GitLab │ ││ │ │ │ Enterprise │ │ │ ││ └──────────┘ └──────────────────┘ └────────────────────────┘ │└─────────────────────────────────────────────────────────────────┘API Server
REST API serving the web UI and CLI. Handles search requests, repository management, and job coordination.
Indexer Service
Background service that discovers, clones, and indexes repositories from configured code hosts.
Zoekt
Fast trigram-based code search engine. Provides millisecond search across large codebases.
PostgreSQL / MySQL
Stores metadata about connections, repositories, jobs, and configuration.
Redis
Job queue and distributed locking for coordinating indexer workers.
Web UI
Next.js frontend providing search interface and management dashboard.
Each component has a single responsibility:
Components can be scaled independently:
One indexer with Zoekt sidecar, handling search, file browsing, and replace jobs.
Multiple indexer workers sharing the same PersistentVolume:
Each shard handles a subset of repositories:
┌─────────────────────────────────────────────────────────────────┐│ API Server ││ ││ ┌──────────┐ ┌──────────────────┐ ┌──────────────────────┐ ││ │ Search │ │ Federated Files │ │ Federated Replace │ ││ │(parallel)│ │ (proxy) │ │ (fan-out) │ ││ └──────────┘ └──────────────────┘ └──────────────────────┘ │└─────────────────────────────────────────────────────────────────┘ │ │ │ ▼ ▼ ▼┌──────────────┐ ┌──────────────┐ ┌──────────────┐│ Indexer-0 │ │ Indexer-1 │ │ Indexer-2 ││ + Zoekt │ │ + Zoekt │ │ + Zoekt ││ (shard 0) │ │ (shard 1) │ │ (shard 2) │└──────────────┘ └──────────────┘ └──────────────┘See Sharding Configuration for details.
| Layer | Technology |
|---|---|
| Frontend | Next.js, React, TailwindCSS |
| API | Go, Chi router |
| Database | PostgreSQL / MySQL |
| Queue | Redis |
| Search | Zoekt (trigram index) |
| Container | Docker |
| Orchestration | Kubernetes (optional) |