Storage Brain Architecture
Multi-tenant file storage with workspace isolation and signed URLs.
Components
| Component | Description |
|---|---|
| Auth Middleware | API key validation via Brain Core (createAuthMiddleware) |
| Upload Handler | Receives files, stores in R2, records metadata in D1 |
| Signed URL Generator | Creates time-limited pre-signed URLs for file access |
| Workspace Manager | CRUD for workspace isolation within a tenant |
| R2 Object Storage | Cloudflare R2 for file blobs |
| D1 Metadata DB | Cloudflare D1 for file metadata, tenants, workspaces |