Development Workflow¶
This guide covers the day-to-day development workflow for contributing to Bedrud.
Repository Layout¶
bedrud/
├── server/ # Go backend
├── apps/
│ ├── web/ # SvelteKit frontend
│ ├── android/ # Android app
│ └── ios/ # iOS app
├── agents/ # Python bot agents
├── packages/ # Shared TypeScript types
├── tools/cli/ # Deployment CLI
├── docs/ # Documentation (MkDocs)
├── 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 |
| Python 3.10+ | Bot agents |
| FFmpeg | Radio and video agents |
Initial Setup¶
Full-Stack Development¶
To run the entire stack locally:
This starts LiveKit, the Go server, and the Svelte dev server concurrently. Press Ctrl+C to stop all processes.
Running Services Individually¶
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:
Web Frontend Development¶
The frontend is at apps/web/ and uses SvelteKit with Svelte 5.
Adding a Page¶
Create a new directory under src/routes/ with a +page.svelte file. SvelteKit uses file-based routing.
Adding an API Client Function¶
- Add the function in
src/lib/api/usingauthFetch - Define TypeScript types in
src/lib/models/ - Use the function from your page or component
Type Checking¶
Android Development¶
Key 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 device
iOS Development¶
Key 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:
Building¶
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 |
| iOS | Build, test (simulator) |
Release builds are triggered by version tags (v*).
Code Style¶
- Go: Standard
gofmtformatting - TypeScript/Svelte: Prettier (configured in the web project)
- Kotlin: Android Studio default formatting
- Swift: Xcode default formatting