Development Setup π‘ BETA
A development setup is a debug build, a local stack started by reset.sh, and health checks on the canonical ports.
Prerequisites
A Linux host with Incus, Rust from the workspace toolchain, local fonts and binaries from the repository, and the pinned components in botserver/3rdparty.toml.
Required Software
| Requirement | Source |
|---|---|
| Rust toolchain | Workspace Cargo.toml |
| Incus | Root AGENTS.md (Containers) |
| PostgreSQL client libraries | Pinned in botserver/3rdparty.toml |
| Chrome with CDP port 9222 | Root AGENTS.md (Mandatory Browser Testing) |
Optional Components
Qdrant, InfluxDB, LiveKit and Stalwart are pinned but not needed for every workflow; the gblite desktop product turns cache, vector database and directory services off.
Getting Started
- Clone the repository.
- Create
.envwith onlyVAULT_*variables. - Run
./reset.shand wait for bootstrap. - Check
/healthon port 8080. - Open the desktop route in the browser.
1. Clone the Repository
Do not change branches without explicit approval.
2. Environment Setup
Secrets come from Vault; the token is read from /tmp/vault-token-gb or the environment. No secret file belongs in the repository.
3. Install Rust Dependencies
Build with the debug profile; release builds are reserved for the desktop packaging pipeline.
4. Run Bootstrap
Bootstrap takes several minutes. Watch botserver.log for "Bootstrap process completed!"; a delayed directory can defer admin creation.
Development Workflow
| Task | Command form |
|---|---|
| Build | cargo build in the background |
| Unit test | cargo test -p <crate> --lib |
| Binary test | cargo test -p botserver --bin botserver |
| Integration | cargo test -p bottest --features integration |
| Format | cargo fmt |
Building the Project
Start builds in the background with output under /tmp; never run a second cargo build while one is running.
Running Tests
Run one crate at a time; the workspace graph does not fit the 4.5 GiB development container.
Code Formatting
cargo fmt --check is the non-mutating form.
Linting
Clippy must pass with zero warnings; fix the code instead of adding #[allow].
Project Structure
Crates live under botserver/crates/, the server under botserver/src/, the UI under botui/ui/, the schema under botschema/ and tests under bottest/.
Database Setup
Migrations live in botserver/migrations/ and the single schema source in botschema.
Manual Database Creation
Only needed when bootstrapping without the stack; credentials come from Vault.
Running Migrations
cd botserver && diesel migration run, then diesel print-schema and update botschema before committing.
Common Development Tasks
- New keyword: register in a
botbasic_*crate or local keywords. - New endpoint: add the route and register it; the generated reference is authoritative.
- Schema change: migration β
botschemaβ commit both.
Adding a New Keyword
Search for the keyword first; an unregistered keyword is not a feature.
Adding an API Endpoint
Register the route, add it to the command catalog when chat must reach it, and update the generated reference.
Modifying Database Schema
Never copy a table! into a feature crate; re-export from botschema.
Remote Development Setup
Keep a stable shell, run long tasks in the background, and read logs with short commands.
Debugging
Read botserver.log and botui.log; stop and fix root causes instead of restarting to hide an error.
Debug Mode
Use the debug binary from botserver/; a production swap is CI-only.
Using VS Code
An external editor may open files, but suite HTML fragments still need the desktop shell.
Performance Profiling
Measure a single crate; do not profile a full workspace build in the dev container.
Testing with Different Features
Features are declared in the root and crate manifests; enable only what the workflow needs.
Feature Flags
| Feature | Effect |
|---|---|
saas |
Seeding, cloud API, subscriptions (includes billing) |
billing |
Product CRUD routes |
people |
CRM |
desktop-local |
Desktop bundle feature set |
Troubleshooting
Use /health and the canonical port table; see Troubleshooting.
Common Issues
A sealed Vault blocks bootstrap; a full disk blocks Vibe VMs; a directly opened suite HTML file is a broken fragment.
Incus Development
Everything runs in Incus containers; never document lxc or lxd as the container layer.
Contributing Guidelines
Open an issue with scope and measured numbers; agents edit disjoint files and leave changes in the working tree.
Getting Help
Search issues first, then open one with reproduction steps and evidence.
Next Steps
Read the Code Standards and Pull Requests pages before the first change.
Limits
- Never build in release mode locally; only the desktop packaging pipeline does.
- Never run boteval locally; CI owns paid model calls.
- No secret file or backup belongs in the repository β use
/tmp. - One build at a time,
jobs = 3from.cargo/config.toml.