Development Setup
This page is for contributors and anyone who wants to run kbarr from source.
Prerequisites
- Docker and Docker Compose
- Go (see
go.modfor the required version) - Node.js (LTS)
- air — live reload for Go services
- tmux
Setup
Clone the repository:
git clone https://github.com/kingbenny101/kbarr.git
cd kbarr
dev.env is included with sensible defaults. No changes are needed to get started.
Start all services in a tmux session:
make dev
This opens a tmux session called kbarr with each service in its own window:
| Window | What runs |
|---|---|
db | PostgreSQL + pgAdmin |
core | Main API + frontend |
metadata | AniDB metadata service |
indexer | Torrent search service |
downloader | Download queue service |
All Go services hot-reload on file changes via air. The frontend uses Vite's dev server.
To stop everything:
make dev-down
Running individual services
Start only the database:
make db # start
make db-down # stop
Run a specific service manually:
make run-core
make run-metadata
make run-indexer
make run-downloader
make run-frontend
pgAdmin is available at http://localhost:5050 — email: admin@local.dev, password: admin.
Tech stack
| Layer | Technology |
|---|---|
| Backend services | Go |
| Frontend | React, TypeScript, Mantine |
| Database | PostgreSQL (via bun ORM) |
| API | huma v2 (OpenAPI 3.0) |
| Metadata | AniDB UDP/HTTP API |
| Torrent search | Prowlarr API, kbdex API |
| Download client | qBittorrent Web API |
Generating the API spec
The OpenAPI spec is generated from the running server:
go run ./cmd/genspec
To regenerate the docs API pages after updating the spec:
npm run gen-api-docs # from the docs/ directory