This guide covers the day-to-day development workflow for contributing to Bedrud.
Repository Layout
bedrud/
├── server/ # Go backend
├── apps/
│ ├── web/ # React frontend (TanStack Start)
│ ├── android/ # Android app
│ ├── ios/ # iOS app
│ └── desktop/ # Desktop app (Rust + Slint)
├── agents/ # Python bot agents
├── packages/ # Shared TypeScript types
├── tools/cli/ # Deployment CLI
├── docs/ # Documentation (MkDocs)
├── Cargo.toml # Rust workspace root
├── Makefile # Build orchestration
└── Dockerfile # Container build
Prerequisites
| Tool | Required For |
|---|---|
| Go 1.24+ | Server |
| Bun | Web frontend |
| LiveKit Server | Local media server |
| Android Studio + JDK 17 | Android app |
| Xcode | iOS app |
| Rust (stable) | Desktop app |
| Python 3.10+ | Bot agents |
| FFmpeg | Radio and video agents |
Initial Setup
git clone https://github.com/bedrud-ir/bedrud.git
cd bedrud
make initFull-Stack Development
To run the entire stack locally:
make devThis starts LiveKit, the Go server, and the React dev server concurrently. Press Ctrl+C to stop all processes.
Running Services Individually
make dev-webRuns at http://localhost:3000 with hot module replacement.
make dev-serverRuns at http://localhost:8090. Restart manually after Go code changes.
make dev-livekitRuns at http://localhost:7880 with development credentials.
Server Development
The Go server entry point is server/cmd/server/main.go.
Adding an API Endpoint
- Define the handler in
server/internal/handlers/ - Add repository methods in
server/internal/repository/if new DB queries are needed - Register the route in the server setup (usually in
main.goor a routes file) - Add middleware if the endpoint needs auth or admin checks
Database Changes
Add or modify GORM model structs in server/internal/models/. GORM auto-migrates on startup.
Swagger Docs
API documentation annotations use swaggo format. After changes, regenerate:
cd server
swag init -g cmd/server/main.goSee Server Architecture for the full directory layout and layered design.
Web Frontend Development
The frontend is at apps/web/ and uses React 19 with TanStack Start.
Adding a Page
Create a new file under src/routes/ following TanStack Router’s file-based routing convention (e.g. src/routes/settings.tsx). Export a Route created with createFileRoute.
Adding an API Client Function
- Add the function in
src/lib/api.tsusingauthFetch - Define TypeScript types inline or in a shared types file
- Use the function from your route component, typically via a TanStack Query
useQueryhook
Type Checking
cd apps/web
bun run check # runs Biome lint + TypeScript type checkSee Web Frontend Architecture for the complete frontend structure and patterns.
Android Development
make dev-android # Opens in Android StudioKey Patterns
- All screens are Composable functions
- Dependencies come from
InstanceManagerviakoinInject() - Use
collectAsState().value ?: returnfor nullableStateFlowvalues - Navigation is handled in
MainActivity.kt
Building
make build-android-debug # Debug APK
make build-android # Release APK (needs keystore)
make release-android # Build + install on deviceSee Android App Architecture for detailed mobile app architecture.
iOS Development
make dev-ios # Opens in XcodeKey Patterns
- Views are SwiftUI structs
- Dependencies come from
InstanceManagervia@EnvironmentObject - Use optional binding for nullable published properties
- Navigation uses SwiftUI’s native navigation stack
Project Generation
If you modify project.yml, regenerate the Xcode project:
cd apps/ios
xcodegen generateBuilding
make build-ios # Release archive
make build-ios-sim # Simulator build
make export-ios # Export IPASee iOS App Architecture for detailed mobile app architecture.
Desktop Development
The desktop app lives in apps/desktop/ and is a Rust crate in the workspace.
Prerequisites (Linux)
sudo apt-get install -y \
libfontconfig1-dev libxkbcommon-dev libxkbcommon-x11-dev \
libwayland-dev libgles2-mesa-dev libegl1-mesa-dev \
libdbus-1-dev libsecret-1-dev \
libasound2-devWindows requires Visual Studio Build Tools with the C++ workload (MSVC).
Running
make dev-desktop # cargo run -p bedrud-desktopBuilding
make build-desktop # optimised binary for the current platformKey Patterns
- All UI is defined in
.slintfiles underapps/desktop/ui/; compiled to Rust at build time bybuild.rs apps/desktop/src/ui/bridge.rsis the only place where Slint callbacks are wired to Rust logic - keep business logic out of the.slintfiles- Use
Weak<AppWindow>when spawning background tasks that need to update the UI
See Desktop App Architecture for detailed desktop app architecture.
Bot Agent Development
Agents are in agents/ with one directory per agent.
cd agents/music_agent
pip install -r requirements.txt
python agent.py "http://localhost:8090/m/test-room"All agents need a running Bedrud server to authenticate against.
CI/CD
GitHub Actions runs on every push to main and on pull requests:
| Job | What it checks |
|---|---|
| Server | go vet, build, tests |
| Web | Type check, build |
| Android | Lint, unit tests, debug APK |
| iOS | Build + test (simulator, with coverage) |
| Desktop | cargo build, cargo test |
Release builds are triggered by version tags (v*).
Code Style
- Go: Standard
gofmtformatting - TypeScript/React: Biome (configured in
apps/web/biome.json) - Kotlin: Android Studio default formatting
- Swift: Xcode default formatting
Testing
cd server
go test ./...cd apps/web
bun run checkcd apps/android
./gradlew testmake build-ios-sim # Builds and runs testsSee also
- Makefile Reference - all build and dev commands
- Architecture Overview - how components fit together