# beshoyromany/anubithic-studio architecture

> Architecture diagram of the GitHub repository beshoyromany/anubithic-studio, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/beshoyromany/anubithic-studio
- Repository: https://github.com/beshoyromany/anubithic-studio

## Overview

Anubithic Studio is a browser-based collaborative AI code studio. A user starts with a prompt or opens a project, works with an AI agent that explores and changes project files, edits files in the editor, runs the app in a WebContainer preview, and can publish it to GitHub. Separate capabilities cover team collaboration, AI-in-editor assistance, model/key setup, and GitHub import. The README documents product-level flows; excerpts show selected API, AI, and preview wiring, so some subsystem links are documented rather than source-verified.

Main entry points: [`src/features/editor/views/editor-view.tsx`](https://github.com/beshoyromany/anubithic-studio/blob/main/src/features/editor/views/editor-view.tsx) (Code Editor), [`src/app/api/messages/route.ts`](https://github.com/beshoyromany/anubithic-studio/blob/main/src/app/api/messages/route.ts) (Message API), [`src/features/conversations/inngest/process-message.ts`](https://github.com/beshoyromany/anubithic-studio/blob/main/src/features/conversations/inngest/process-message.ts) (Agent Processing), [`src/app/api/quick-edit/route.ts`](https://github.com/beshoyromany/anubithic-studio/blob/main/src/app/api/quick-edit/route.ts) (Editor AI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Project Workspace"]
  node_projects["Projects Home<br/>[projects-view.tsx]"]
  node_project_create["Prompt Creation<br/>[route.ts]"]
  node_file_ops["File Explorer<br/>[index.tsx]"]
  node_editor["Code Editor<br/>[editor-view.tsx]"]
end

subgraph group_agent["AI Building"]
  node_chat["Agent Chat"]
  node_message_api["Message API<br/>[route.ts]"]
  node_agent_job["Agent Processing<br/>[process-message.ts]"]
  node_agent_tools["Project Tools"]
  node_editor_ai["Editor AI<br/>[route.ts]"]
  node_suggestions["Autocomplete<br/>[route.ts]"]
  node_model_resolver["Model Selection<br/>[resolve-model.ts]"]
  node_model_catalog["Model Catalog<br/>[models.ts]"]
  node_key_setup["Key Management<br/>[route.ts]"]
  node_local_setup["Local Models<br/>[route.ts]"]
  node_provider_proxy["Provider Proxy<br/>[route.ts]"]
end

subgraph group_runtime["Run And Publish"]
  node_preview["Live Preview<br/>[preview-view.tsx]"]
  node_webcontainers["WebContainer Runtime"]
  node_github_import["GitHub Import"]
  node_github_export["GitHub Export"]
end

subgraph group_collab["Team Collaboration"]
  node_presence[("Presence<br/>[presence.ts]")]
  node_contributors[("Team Access<br/>[contributors.ts]")]
end

subgraph group_platform["Platform Services"]
  node_project_state[("Project Data<br/>[projects.ts]")]
  node_conversations[("Conversation Data<br/>[conversations.ts]")]
  node_credentials[("AI Credentials<br/>[aiKeys.ts]")]
  node_auth["Authentication<br/>[auth.ts]"]
end

node_user(("Studio User"))
node_ollama{{"User Ollama"}}
node_ai_provider{{"AI Provider"}}
node_github{{"GitHub"}}

node_user -->|"opens"| node_projects
node_user -->|"prompts"| node_project_create
node_project_create -.->|"creates"| node_project_state
node_projects -->|"loads projects"| node_project_state
node_user -->|"manages files"| node_file_ops
node_user -->|"edits code"| node_editor
node_user -->|"requests changes"| node_chat
node_chat -.->|"sends messages"| node_message_api
node_message_api -.->|"dispatches work"| node_agent_job
node_agent_job -.->|"uses tools"| node_agent_tools
node_agent_tools -.->|"changes files"| node_project_state
node_message_api -->|"accesses conversations"| node_conversations
node_editor -->|"requests quick edit"| node_editor_ai
node_editor -->|"requests completion"| node_suggestions
node_editor_ai -->|"resolves model"| node_model_resolver
node_suggestions -->|"resolves model"| node_model_resolver
node_editor_ai -.->|"generates edit"| node_ai_provider
node_suggestions -.->|"generates suggestion"| node_ai_provider
node_model_resolver -->|"selects definition"| node_model_catalog
node_user -->|"adds provider key"| node_key_setup
node_key_setup -->|"saves encrypted key"| node_credentials
node_user -->|"connects model"| node_local_setup
node_local_setup -->|"checks model"| node_ollama
node_local_setup -->|"saves settings"| node_credentials
node_agent_job -.->|"requests model"| node_provider_proxy
node_provider_proxy -->|"forwards request"| node_ai_provider
node_provider_proxy -->|"loads credentials"| node_credentials
node_user -->|"runs project"| node_preview
node_preview -->|"starts runtime"| node_webcontainers
node_user -->|"imports repository"| node_github_import
node_github_import -.->|"imports from"| node_github
node_user -->|"publishes project"| node_github_export
node_github_export -.->|"exports to"| node_github
node_user -->|"shares live status"| node_presence
node_user -->|"invites teammates"| node_contributors
node_user -->|"signs in"| node_auth

click node_projects "https://github.com/beshoyromany/anubithic-studio/blob/main/src/features/projects/components/projects-view.tsx"
click node_project_create "https://github.com/beshoyromany/anubithic-studio/blob/main/src/app/api/projects/create-with-prompt/route.ts"
click node_project_state "https://github.com/beshoyromany/anubithic-studio/blob/main/convex/projects.ts"
click node_file_ops "https://github.com/beshoyromany/anubithic-studio/blob/main/src/features/projects/components/file-explorer/index.tsx"
click node_editor "https://github.com/beshoyromany/anubithic-studio/blob/main/src/features/editor/views/editor-view.tsx"
click node_chat "https://github.com/beshoyromany/anubithic-studio/blob/main/src/features/conversations/components/conversation-sidebar.tsx"
click node_message_api "https://github.com/beshoyromany/anubithic-studio/blob/main/src/app/api/messages/route.ts"
click node_agent_job "https://github.com/beshoyromany/anubithic-studio/blob/main/src/features/conversations/inngest/process-message.ts"
click node_agent_tools "https://github.com/beshoyromany/anubithic-studio/tree/main/src/features/conversations/inngest/tools"
click node_conversations "https://github.com/beshoyromany/anubithic-studio/blob/main/convex/conversations.ts"
click node_editor_ai "https://github.com/beshoyromany/anubithic-studio/blob/main/src/app/api/quick-edit/route.ts"
click node_suggestions "https://github.com/beshoyromany/anubithic-studio/blob/main/src/app/api/suggestion/route.ts"
click node_model_resolver "https://github.com/beshoyromany/anubithic-studio/blob/main/src/features/ai/server/resolve-model.ts"
click node_model_catalog "https://github.com/beshoyromany/anubithic-studio/blob/main/src/features/ai/models.ts"
click node_key_setup "https://github.com/beshoyromany/anubithic-studio/blob/main/src/app/api/ai-keys/route.ts"
click node_local_setup "https://github.com/beshoyromany/anubithic-studio/blob/main/src/app/api/ai-local/route.ts"
click node_provider_proxy "https://github.com/beshoyromany/anubithic-studio/blob/main/src/app/api/ai-proxy/%5Bprovider%5D/%5B...path%5D/route.ts"
click node_credentials "https://github.com/beshoyromany/anubithic-studio/blob/main/convex/aiKeys.ts"
click node_preview "https://github.com/beshoyromany/anubithic-studio/blob/main/src/features/projects/components/preview-view.tsx"
click node_webcontainers "https://github.com/beshoyromany/anubithic-studio/blob/main/src/features/preview/hooks/use-webcontainers.ts"
click node_github_import "https://github.com/beshoyromany/anubithic-studio/blob/main/src/features/projects/inngest/import-github-repo.ts"
click node_github_export "https://github.com/beshoyromany/anubithic-studio/blob/main/src/features/projects/inngest/export-to-github.ts"
click node_presence "https://github.com/beshoyromany/anubithic-studio/blob/main/convex/presence.ts"
click node_contributors "https://github.com/beshoyromany/anubithic-studio/blob/main/convex/contributors.ts"
click node_auth "https://github.com/beshoyromany/anubithic-studio/blob/main/convex/auth.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_projects,node_project_create,node_file_ops,node_editor,node_user,node_ollama toneBlue
class node_chat,node_message_api,node_agent_job,node_agent_tools,node_editor_ai,node_suggestions,node_model_resolver,node_model_catalog,node_key_setup,node_local_setup,node_provider_proxy toneAmber
class node_preview,node_webcontainers,node_github_import,node_github_export toneMint
class node_presence,node_contributors toneRose
class node_project_state,node_conversations,node_credentials,node_auth,node_ai_provider,node_github toneIndigo
```

## Components

### Project Workspace

- [Projects Home](https://github.com/beshoyromany/anubithic-studio/blob/main/src/features/projects/components/projects-view.tsx): `src/features/projects/components/projects-view.tsx`
- [Prompt Creation](https://github.com/beshoyromany/anubithic-studio/blob/main/src/app/api/projects/create-with-prompt/route.ts): `src/app/api/projects/create-with-prompt/route.ts`
- [File Explorer](https://github.com/beshoyromany/anubithic-studio/blob/main/src/features/projects/components/file-explorer/index.tsx): `src/features/projects/components/file-explorer/index.tsx`
- [Code Editor](https://github.com/beshoyromany/anubithic-studio/blob/main/src/features/editor/views/editor-view.tsx): `src/features/editor/views/editor-view.tsx`

### AI Building

- [Agent Chat](https://github.com/beshoyromany/anubithic-studio/blob/main/src/features/conversations/components/conversation-sidebar.tsx): `src/features/conversations/components/conversation-sidebar.tsx`
- [Message API](https://github.com/beshoyromany/anubithic-studio/blob/main/src/app/api/messages/route.ts): `src/app/api/messages/route.ts`
- [Agent Processing](https://github.com/beshoyromany/anubithic-studio/blob/main/src/features/conversations/inngest/process-message.ts): `src/features/conversations/inngest/process-message.ts`
- [Project Tools](https://github.com/beshoyromany/anubithic-studio/tree/main/src/features/conversations/inngest/tools): `src/features/conversations/inngest/tools`
- [Editor AI](https://github.com/beshoyromany/anubithic-studio/blob/main/src/app/api/quick-edit/route.ts): `src/app/api/quick-edit/route.ts`
- [Autocomplete](https://github.com/beshoyromany/anubithic-studio/blob/main/src/app/api/suggestion/route.ts): `src/app/api/suggestion/route.ts`
- [Model Selection](https://github.com/beshoyromany/anubithic-studio/blob/main/src/features/ai/server/resolve-model.ts): `src/features/ai/server/resolve-model.ts`
- [Model Catalog](https://github.com/beshoyromany/anubithic-studio/blob/main/src/features/ai/models.ts): `src/features/ai/models.ts`
- [Key Management](https://github.com/beshoyromany/anubithic-studio/blob/main/src/app/api/ai-keys/route.ts): `src/app/api/ai-keys/route.ts`
- [Local Models](https://github.com/beshoyromany/anubithic-studio/blob/main/src/app/api/ai-local/route.ts): `src/app/api/ai-local/route.ts`
- [Provider Proxy](https://github.com/beshoyromany/anubithic-studio/blob/main/src/app/api/ai-proxy/%5Bprovider%5D/%5B...path%5D/route.ts): `src/app/api/ai-proxy/[provider]/[...path]/route.ts`

### Run And Publish

- [Live Preview](https://github.com/beshoyromany/anubithic-studio/blob/main/src/features/projects/components/preview-view.tsx): `src/features/projects/components/preview-view.tsx`
- [WebContainer Runtime](https://github.com/beshoyromany/anubithic-studio/blob/main/src/features/preview/hooks/use-webcontainers.ts): `src/features/preview/hooks/use-webcontainers.ts`
- [GitHub Import](https://github.com/beshoyromany/anubithic-studio/blob/main/src/features/projects/inngest/import-github-repo.ts): `src/features/projects/inngest/import-github-repo.ts`
- [GitHub Export](https://github.com/beshoyromany/anubithic-studio/blob/main/src/features/projects/inngest/export-to-github.ts): `src/features/projects/inngest/export-to-github.ts`

### Team Collaboration

- [Presence](https://github.com/beshoyromany/anubithic-studio/blob/main/convex/presence.ts): `convex/presence.ts`
- [Team Access](https://github.com/beshoyromany/anubithic-studio/blob/main/convex/contributors.ts): `convex/contributors.ts`

### Platform Services

- [Project Data](https://github.com/beshoyromany/anubithic-studio/blob/main/convex/projects.ts): `convex/projects.ts`
- [Conversation Data](https://github.com/beshoyromany/anubithic-studio/blob/main/convex/conversations.ts): `convex/conversations.ts`
- [AI Credentials](https://github.com/beshoyromany/anubithic-studio/blob/main/convex/aiKeys.ts): `convex/aiKeys.ts`
- [Authentication](https://github.com/beshoyromany/anubithic-studio/blob/main/convex/auth.ts): `convex/auth.ts`

### Other components

- **Studio User**
- **User Ollama**
- **AI Provider**
- **GitHub**

## Connections

- Studio User → Projects Home: opens (evidence: `README.md`)
- Studio User → Prompt Creation: prompts (evidence: `README.md`)
- Prompt Creation → Project Data: creates
- Projects Home → Project Data: loads projects
- Studio User → File Explorer: manages files (evidence: `README.md`)
- Studio User → Code Editor: edits code (evidence: `README.md`)
- Studio User → Agent Chat: requests changes (evidence: `README.md`)
- Agent Chat → Message API: sends messages
- Message API → Agent Processing: dispatches work
- Agent Processing → Project Tools: uses tools
- Project Tools → Project Data: changes files
- Message API → Conversation Data: accesses conversations (evidence: `src/app/api/messages/route.ts`)
- Code Editor → Editor AI: requests quick edit (evidence: `README.md`)
- Code Editor → Autocomplete: requests completion (evidence: `README.md`)
- Editor AI → Model Selection: resolves model (evidence: `src/app/api/quick-edit/route.ts`)
- Autocomplete → Model Selection: resolves model (evidence: `src/app/api/suggestion/route.ts`)
- Editor AI → AI Provider: generates edit
- Autocomplete → AI Provider: generates suggestion
- Model Selection → Model Catalog: selects definition (evidence: `src/features/ai/server/resolve-model.ts`)
- Studio User → Key Management: adds provider key (evidence: `README.md`)
- Key Management → AI Credentials: saves encrypted key (evidence: `src/app/api/ai-keys/route.ts`)
- Studio User → Local Models: connects model (evidence: `README.md`)
- Local Models → User Ollama: checks model (evidence: `src/app/api/ai-local/route.ts`)
- Local Models → AI Credentials: saves settings (evidence: `src/app/api/ai-local/route.ts`)
- Agent Processing → Provider Proxy: requests model
- Provider Proxy → AI Provider: forwards request (evidence: `src/app/api/ai-proxy/[provider]/[...path]/route.ts`)
- Provider Proxy → AI Credentials: loads credentials (evidence: `src/app/api/ai-proxy/[provider]/[...path]/route.ts`)
- Studio User → Live Preview: runs project (evidence: `README.md`)
- Live Preview → WebContainer Runtime: starts runtime (evidence: `src/features/projects/components/preview-view.tsx`)
- Studio User → GitHub Import: imports repository (evidence: `README.md`)
- GitHub Import → GitHub: imports from
- Studio User → GitHub Export: publishes project (evidence: `README.md`)
- GitHub Export → GitHub: exports to
- Studio User → Presence: shares live status (evidence: `README.md`)
- Studio User → Team Access: invites teammates (evidence: `README.md`)
- Studio User → Authentication: signs in (evidence: `README.md`)
