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) | Account, sign-in and RS256 JWT issuance, teams, billing |
| AI Service | sb-ai-worker (Cloudflare Worker, reachable only through the API worker’s AI_ORIGIN binding) + multi-provider adapters; local inference via studiobrain-model-manager (GGUF) | AI generation, model catalog, BrainBits metering. Embeddings use EmbeddingGemma 2 on Workers AI |
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 sb-server). Enterprise/on-prem (sb-enterprise*) is a future offering | 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 | 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
The desktop app supports these storage providers (fs, gdrive, s3, dropbox, onedrive):
| Provider | Use Case |
|---|---|
| Local filesystem | Default, desktop mode |
| Google Drive | Personal cloud backup and sync |
| S3-compatible (your own bucket) | Own S3 or R2 bucket |
| Dropbox, OneDrive | Personal cloud backup and sync |
Bring-your-own cloud storage (cloud_storage) is included on Free.
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