// CONTENTS Part 11 · Extending and contributing

// PART 11

Development setup

Chapter 45 / 56 3 min read English Part 11 of 14

A working development environment is: toolchain, clone, build, stack bootstrap, and a browser to test through. This page is the sequence with the commands that actually work.

1. Toolchain

# Rust + build prerequisites (see Build system for the full list)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
sudo apt install -y clang lld mold build-essential pkg-config libssl-dev libpq-dev cmake git
# Diesel CLI for migrations
cargo install diesel_cli --no-default-features --features postgres

2. Clone and build

git clone --recursive https://github.com/GeneralBots/gb.git
cd gb
cargo build -p botserver            # debug build — the documented dev default

The workspace sets jobs = 3 and the clang+mold linker; do not override unless the host cannot fit it (CARGO_BUILD_JOBS=1 is the documented low-memory exception).

3. First boot and the stack

cd botserver
./target/debug/botserver --noconsole > botserver.log 2>&1 &
tail -f botserver.log               # wait for "Bootstrap process completed!"
curl -s -o /dev/null -w '%{http_code}' http://localhost:8080/health   # 200

First boot provisions the stack (PostgreSQL, Valkey, Vault, drive, directory, optional local LLM) into botserver-stack/. Rules for .env: only VAULT_* variables belong there; every other credential is read from Vault at boot. Never restart the server for config.csv changes — the Drive monitor auto-reloads on ETag change (~10 s).

Useful reset (destroys local dev data):

killall -9 botserver vault postgres valkey otterio qdrant zitadel 2>/dev/null
rm -rf botserver-stack/ work/ .env botserver.log
# then start botserver again to re-provision

4. The UI sites

Surface URL Notes
Suite http://localhost:3000 chat, apps, desktop shell
Cloud http://localhost:4000 store, dashboard
Login http://localhost:5000/login the only login/signup surface
API http://localhost:8080/api Bearer token

Frontend changes in botui/ui/ need no rebuild — refresh. Rust changes in botui/src/ need cargo build -p botui.

5. Testing loop

# while a build runs in the background, keep working:
nohup cargo build -p botserver > /tmp/opencode/build.log 2>&1 &

# quick gates
rustfmt --emit stdout <changed-file> > /dev/null
cargo test -p <crate>
cargo clippy --workspace            # 0 warnings

# browser verification is mandatory for user-facing changes (Chrome CDP)

6. Chrome for UAT

export DISPLAY=:1
google-chrome --no-sandbox --disable-gpu --remote-debugging-port=9222 \
  --remote-allow-origins=* --user-data-dir=/tmp/chrome-persistent-profile &

One tab per active issue; screenshots to /tmp/; never close the browser itself; never test chat via raw WebSocket scripts.

7. Book and docs

If user-facing behavior changed, update botbook/ (the guards: python3 scripts/botbook_guards.py --check). Documentation describes what the product does today — plans go to GitHub issues, never into docs.

Common first-day failures

Symptom Fix
Bootstrap hangs at “Waiting for BotServer” directory not ready in 60 s; check botserver.log, services still start
text file busy replacing a binary stop the service before overwriting the binary
Vault sealed → “connection refused” unseal (3 keys, one SSH session to keep the nonce)
Port 3000 busy a stale static server holds it; kill it before cargo tauri dev or the suite
Tests fail with “no library targets found” use cargo test -p botserver --bin botserver

Found a mistake? Open an issue · All books

// SEARCH ESC
Pagefind · 236 pages · 4 books Enter to open ↑ ↓ to move