# kpaul-create/ace---ai_contextual_editor architecture

> Architecture diagram of the GitHub repository kpaul-create/ace---ai_contextual_editor, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kpaul-create/ace---ai_contextual_editor
- Repository: https://github.com/kpaul-create/ace---ai_contextual_editor

## Overview

ACE is a contextual coding-workspace product: users configure a workspace, open a project, edit its files, inspect workspace context, and optionally sync files to a cloud endpoint. The documented backend also exposes streamed editor updates and supports Gemini or Grok/xAI, though the sampled frontend excerpts do not show a call to that endpoint. The graph follows the evidenced frontend composition and state flow; backend internals and auth protection details are limited to README documentation.

Main entry points: [`components/editor/editor-shell.tsx`](https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/components/editor/editor-shell.tsx) (Editor shell), [`components/editor/monaco-editor.tsx`](https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/components/editor/monaco-editor.tsx) (Code editor), [`components/onboarding/onboarding-wizard.tsx`](https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/components/onboarding/onboarding-wizard.tsx) (Preferences wizard), [`app/(editor)/workspace/[projectId]/page.tsx`](https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/app/(editor)/workspace/%5BprojectId%5D/page.tsx) (Project route)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and onboarding"]
  node_auth["Sign-in and sign-up<br/>[page.tsx]"]
  node_onboarding_page["Onboarding route<br/>[page.tsx]"]
  node_wizard["Preferences wizard"]
  node_workspace_route["Project route<br/>[page.tsx]"]
end

subgraph group_workspace["Editor workspace"]
  node_shell["Editor shell<br/>[editor-shell.tsx]"]
  node_explorer["File explorer<br/>[file-explorer.tsx]"]
  node_monaco["Code editor<br/>[monaco-editor.tsx]"]
  node_header["Workspace header"]
  node_context["Context rail<br/>[context-rail.tsx]"]
  node_status["Editor status"]
  node_cursor_hook["Cursor tracking"]
  node_language["Language support<br/>[languages.ts]"]
end

subgraph group_state["Workspace state"]
  node_preferences[("Workspace preferences<br/>[workspace-store.ts]")]
  node_file_state[("File tree state<br/>[file-tree-store.ts]")]
  node_cursor_state[("Cursor state<br/>[editor-store.ts]")]
end

subgraph group_services["Backend and sync"]
  node_sync_hook["Cloud sync hook<br/>[use-cloud-sync.ts]"]
  node_sync_client["Cloud sync client<br/>[client.ts]"]
  node_cloud[("Cloud sync endpoint")]
  node_backend["Edit-stream backend<br/>[main.py]"]
  node_model{{"Gemini or Grok/xAI"}}
end

node_user(("User"))

node_user -->|"signs in"| node_auth
node_onboarding_page -->|"renders"| node_wizard
node_wizard -->|"updates"| node_preferences
node_wizard -->|"navigates to"| node_workspace_route
node_user -.->|"opens project"| node_workspace_route
node_workspace_route -->|"renders"| node_shell
node_shell -->|"renders"| node_explorer
node_shell -->|"renders"| node_monaco
node_shell -->|"renders"| node_header
node_shell -->|"renders"| node_context
node_shell -->|"renders"| node_status
node_explorer -->|"reads and updates"| node_file_state
node_monaco -->|"reads and updates"| node_file_state
node_context -->|"reads"| node_file_state
node_monaco -->|"tracks cursor"| node_cursor_hook
node_cursor_hook -->|"updates"| node_cursor_state
node_status -->|"reads"| node_cursor_hook
node_monaco -->|"configures language"| node_language
node_shell -->|"requests sync"| node_sync_hook
node_sync_hook -->|"calls"| node_sync_client
node_sync_client -->|"uploads files"| node_cloud
node_user -.->|"requests streamed edits"| node_backend
node_backend -.->|"uses model provider"| node_model

click node_auth "https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/app/(auth)/sign-in/%5B%5B...sign-in%5D%5D/page.tsx"
click node_onboarding_page "https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/app/(dashboard)/onboarding/page.tsx"
click node_wizard "https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/components/onboarding/onboarding-wizard.tsx"
click node_preferences "https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/stores/workspace-store.ts"
click node_workspace_route "https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/app/(editor)/workspace/%5BprojectId%5D/page.tsx"
click node_shell "https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/components/editor/editor-shell.tsx"
click node_explorer "https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/components/editor/file-explorer.tsx"
click node_monaco "https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/components/editor/monaco-editor.tsx"
click node_header "https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/components/editor/workspace-header.tsx"
click node_context "https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/components/editor/context-rail.tsx"
click node_status "https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/components/editor/editor-status-bar.tsx"
click node_file_state "https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/stores/file-tree-store.ts"
click node_cursor_state "https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/stores/editor-store.ts"
click node_cursor_hook "https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/hooks/use-editor-cursor.ts"
click node_language "https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/lib/editor/languages.ts"
click node_sync_hook "https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/hooks/use-cloud-sync.ts"
click node_sync_client "https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/lib/cloud-sync/client.ts"
click node_backend "https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/backend/main.py"

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_auth,node_onboarding_page,node_wizard,node_workspace_route,node_user toneBlue
class node_shell,node_explorer,node_monaco,node_header,node_context,node_status,node_cursor_hook,node_language toneAmber
class node_preferences,node_file_state,node_cursor_state toneMint
class node_sync_hook,node_sync_client,node_cloud,node_backend,node_model toneRose
```

## Components

### Entry and onboarding

- [Sign-in and sign-up](https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/app/(auth)/sign-in/%5B%5B...sign-in%5D%5D/page.tsx): `app/(auth)/sign-in/[[...sign-in]]/page.tsx`
- [Onboarding route](https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/app/(dashboard)/onboarding/page.tsx): `app/(dashboard)/onboarding/page.tsx`
- [Preferences wizard](https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/components/onboarding/onboarding-wizard.tsx): `components/onboarding/onboarding-wizard.tsx`
- [Project route](https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/app/(editor)/workspace/%5BprojectId%5D/page.tsx): `app/(editor)/workspace/[projectId]/page.tsx`

### Editor workspace

- [Editor shell](https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/components/editor/editor-shell.tsx): `components/editor/editor-shell.tsx`
- [File explorer](https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/components/editor/file-explorer.tsx): `components/editor/file-explorer.tsx`
- [Code editor](https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/components/editor/monaco-editor.tsx): `components/editor/monaco-editor.tsx`
- [Workspace header](https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/components/editor/workspace-header.tsx): `components/editor/workspace-header.tsx`
- [Context rail](https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/components/editor/context-rail.tsx): `components/editor/context-rail.tsx`
- [Editor status](https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/components/editor/editor-status-bar.tsx): `components/editor/editor-status-bar.tsx`
- [Cursor tracking](https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/hooks/use-editor-cursor.ts): `hooks/use-editor-cursor.ts`
- [Language support](https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/lib/editor/languages.ts): `lib/editor/languages.ts`

### Workspace state

- [Workspace preferences](https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/stores/workspace-store.ts): `stores/workspace-store.ts`
- [File tree state](https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/stores/file-tree-store.ts): `stores/file-tree-store.ts`
- [Cursor state](https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/stores/editor-store.ts): `stores/editor-store.ts`

### Backend and sync

- [Cloud sync hook](https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/hooks/use-cloud-sync.ts): `hooks/use-cloud-sync.ts`
- [Cloud sync client](https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/lib/cloud-sync/client.ts): `lib/cloud-sync/client.ts`
- **Cloud sync endpoint**
- [Edit-stream backend](https://github.com/kpaul-create/ace---ai_contextual_editor/blob/kanish/backend/main.py): `backend/main.py`
- **Gemini or Grok/xAI**

### Other components

- **User**

## Connections

- User → Sign-in and sign-up: signs in (evidence: `README.md`)
- Onboarding route → Preferences wizard: renders (evidence: `app/(dashboard)/onboarding/page.tsx`)
- Preferences wizard → Workspace preferences: updates (evidence: `components/onboarding/onboarding-wizard.tsx`)
- Preferences wizard → Project route: navigates to (evidence: `components/onboarding/onboarding-wizard.tsx`)
- User → Project route: opens project
- Project route → Editor shell: renders (evidence: `app/(editor)/workspace/[projectId]/page.tsx`)
- Editor shell → File explorer: renders (evidence: `components/editor/editor-shell.tsx`)
- Editor shell → Code editor: renders (evidence: `components/editor/editor-shell.tsx`)
- Editor shell → Workspace header: renders (evidence: `components/editor/editor-shell.tsx`)
- Editor shell → Context rail: renders (evidence: `components/editor/editor-shell.tsx`)
- Editor shell → Editor status: renders (evidence: `components/editor/editor-shell.tsx`)
- File explorer → File tree state: reads and updates (evidence: `components/editor/file-explorer.tsx`)
- Code editor → File tree state: reads and updates (evidence: `components/editor/monaco-editor.tsx`)
- Context rail → File tree state: reads (evidence: `components/editor/context-rail.tsx`)
- Code editor → Cursor tracking: tracks cursor (evidence: `components/editor/monaco-editor.tsx`)
- Cursor tracking → Cursor state: updates (evidence: `hooks/use-editor-cursor.ts`)
- Editor status → Cursor tracking: reads (evidence: `components/editor/editor-status-bar.tsx`)
- Code editor → Language support: configures language (evidence: `components/editor/monaco-editor.tsx`)
- Editor shell → Cloud sync hook: requests sync (evidence: `components/editor/editor-shell.tsx`)
- Cloud sync hook → Cloud sync client: calls (evidence: `hooks/use-cloud-sync.ts`)
- Cloud sync client → Cloud sync endpoint: uploads files (evidence: `lib/cloud-sync/client.ts`)
- User → Edit-stream backend: requests streamed edits
- Edit-stream backend → Gemini or Grok/xAI: uses model provider (evidence: `README.md`)
