Infrastructure Overview
This page provides a high-level summary of the StudioBrain service architecture.
Service Stack
StudioBrain is built as a Rust-backed API core with TypeScript edge services:
| Service | Technology | Purpose |
|---|---|---|
| Web Frontend | Next.js 15, React 19, TypeScript (Cloudflare Workers) | User interface, real-time collaboration |
| Desktop & Mobile Clients | Tauri 2.0 (Rust shell + embedded Rust backend) | Native apps with local-first editing and offline support |
| API Backend | Rust (sb-server, Axum) — Cloudflare Workers on the SaaS (api.studiobrain.ai), native binary when self-hosted or embedded in the desktop app | Entity CRUD, storage, sync, file server |
| Auth & Accounts | TypeScript Cloudflare Worker (sb-accounts-worker, auth.studiobrain.ai) | Sign-in, RS256 JWT issuance, teams, billing |
| AI Service | sb-ai-worker (Cloudflare Workers) + multi-provider adapters; local inference via studiobrain-model-manager (GGUF) | AI generation, RAG, embeddings |
Data Architecture
StudioBrain follows a markdown-first principle: all entity data is stored as markdown files with YAML frontmatter. The database is a cache that can be rebuilt from files at any time.
Deployment Modes
| Mode | Storage | Multi-tenant |
|---|---|---|
| Desktop | SQLite + local files | No (single user) |
| Self-Hosted | SQLite (Rust server; Litestream replication in the enterprise edition) | Optional (local accounts) |
| Cloud (SaaS) | Cloudflare Workers data plane: identity in the CONTROL_PLANE D1 (accounts worker), content in the ProjectStore Durable Object + R2 object storage, RAG in DO-SQLite; YugabyteDB is retained infrastructure, not the SaaS store | Yes |
AI Providers
The AI service supports multiple providers with automatic routing:
- OpenAI (GPT-4o, o1, etc.)
- Anthropic (Claude)
- Google (Gemini)
- Grok (xAI)
- Local models via the desktop
studiobrain-model-managergateway (GGUF), or any LAN endpoint (Ollama, LM Studio, and other OpenAI-compatible servers)
Provider selection is per-request based on model preference, BrainBits balance, and availability.
Cloud Storage Providers
| Provider | Tier | Use Case |
|---|---|---|
| Local filesystem | All | Default, desktop mode |
| Google Drive | Indie+ | Personal cloud backup and sync |
| S3 / Azure Blob | Team+ | Team storage, enterprise |
Internal infrastructure topology, network configuration, database schemas, and security hardening are documented in the internal architecture guide (requires authentication).
Related Guides
- Self-Hosting — Deploy StudioBrain on your own infrastructure
- Sync and Collaboration — Cloud sync and team workflows
- Developer Reference — REST API documentation