# manikbharadwaj/codescribe architecture

> Architecture diagram of the GitHub repository manikbharadwaj/codescribe, 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/manikbharadwaj/codescribe
- Repository: https://github.com/manikbharadwaj/codescribe

## Overview

CodeScribe is a browser-based secure code vault and static-analysis workbench. Users register or log in, organize code into owned workspaces, save or upload Python/C++ files, and request analysis whose metrics and hints appear in the workbench; raw snippets can also be scanned without saving. The README documents the main capabilities, while source excerpts confirm key routes, persistence models, analyzer dispatch, and client requests. The map omits unsampled route details and does not imply an unshown database engine or hosting service.

Main entry points: [`app.py`](https://github.com/manikbharadwaj/codescribe/blob/main/app.py) (Flask routes), [`static/script.js`](https://github.com/manikbharadwaj/codescribe/blob/main/static/script.js) (Browser workbench), [`analyzer.py`](https://github.com/manikbharadwaj/codescribe/blob/main/analyzer.py) (Python AST analysis), [`templates/index.html`](https://github.com/manikbharadwaj/codescribe/blob/main/templates/index.html) (Workbench interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Workbench"]
  node_spa["Browser workbench<br/>[script.js]"]
  node_ui["Workbench interface<br/>[index.html]"]
end

subgraph group_service["Application API"]
  node_server["Flask routes<br/>[app.py]"]
  node_auth["Authentication &amp; sessions<br/>[app.py]"]
  node_workspace["Workspace management<br/>[app.py]"]
  node_fileops["File management<br/>[app.py]"]
  node_analysisroute["Analysis endpoints<br/>[app.py]"]
end

subgraph group_analysis["Static Analysis"]
  node_python["Python AST analysis<br/>[analyzer.py]"]
  node_cpp["C++ structural analysis<br/>[analyzer.py]"]
  node_metrics["Metrics &amp; guidance<br/>[analyzer.py]"]
end

subgraph group_data["Vault Data"]
  node_user[("User accounts<br/>[models.py]")]
  node_workspaces[("Workspaces<br/>[models.py]")]
  node_codefiles[("Code files<br/>[models.py]")]
end

node_developer(("Developer"))

node_developer -->|"uses"| node_spa
node_spa -.->|"renders"| node_ui
node_spa -->|"requests"| node_server
node_server -->|"serves"| node_ui
node_server -->|"routes"| node_auth
node_server -.->|"routes"| node_workspace
node_server -->|"routes"| node_fileops
node_server -->|"routes"| node_analysisroute
node_auth -.->|"reads/writes"| node_user
node_workspace -.->|"reads/writes"| node_workspaces
node_fileops -->|"checks ownership"| node_workspaces
node_fileops -.->|"reads/writes"| node_codefiles
node_fileops -.->|"analyzes"| node_python
node_analysisroute -.->|"dispatches"| node_python
node_analysisroute -.->|"dispatches"| node_cpp
node_python -->|"produces"| node_metrics
node_cpp -->|"produces"| node_metrics

click node_spa "https://github.com/manikbharadwaj/codescribe/blob/main/static/script.js"
click node_ui "https://github.com/manikbharadwaj/codescribe/blob/main/templates/index.html"
click node_server "https://github.com/manikbharadwaj/codescribe/blob/main/app.py"
click node_auth "https://github.com/manikbharadwaj/codescribe/blob/main/app.py"
click node_workspace "https://github.com/manikbharadwaj/codescribe/blob/main/app.py"
click node_fileops "https://github.com/manikbharadwaj/codescribe/blob/main/app.py"
click node_analysisroute "https://github.com/manikbharadwaj/codescribe/blob/main/app.py"
click node_python "https://github.com/manikbharadwaj/codescribe/blob/main/analyzer.py"
click node_cpp "https://github.com/manikbharadwaj/codescribe/blob/main/analyzer.py"
click node_metrics "https://github.com/manikbharadwaj/codescribe/blob/main/analyzer.py"
click node_user "https://github.com/manikbharadwaj/codescribe/blob/main/models.py"
click node_workspaces "https://github.com/manikbharadwaj/codescribe/blob/main/models.py"
click node_codefiles "https://github.com/manikbharadwaj/codescribe/blob/main/models.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_spa,node_ui toneBlue
class node_server,node_auth,node_workspace,node_fileops,node_analysisroute toneAmber
class node_python,node_cpp,node_metrics toneMint
class node_user,node_workspaces,node_codefiles toneRose
class node_developer toneIndigo
```

## Components

### Workbench

- [Browser workbench](https://github.com/manikbharadwaj/codescribe/blob/main/static/script.js): `static/script.js`
- [Workbench interface](https://github.com/manikbharadwaj/codescribe/blob/main/templates/index.html): `templates/index.html`

### Application API

- [Flask routes](https://github.com/manikbharadwaj/codescribe/blob/main/app.py): `app.py`
- [Authentication & sessions](https://github.com/manikbharadwaj/codescribe/blob/main/app.py): `app.py`
- [Workspace management](https://github.com/manikbharadwaj/codescribe/blob/main/app.py): `app.py`
- [File management](https://github.com/manikbharadwaj/codescribe/blob/main/app.py): `app.py`
- [Analysis endpoints](https://github.com/manikbharadwaj/codescribe/blob/main/app.py): `app.py`

### Static Analysis

- [Python AST analysis](https://github.com/manikbharadwaj/codescribe/blob/main/analyzer.py): `analyzer.py`
- [C++ structural analysis](https://github.com/manikbharadwaj/codescribe/blob/main/analyzer.py): `analyzer.py`
- [Metrics & guidance](https://github.com/manikbharadwaj/codescribe/blob/main/analyzer.py): `analyzer.py`

### Vault Data

- [User accounts](https://github.com/manikbharadwaj/codescribe/blob/main/models.py): `models.py`
- [Workspaces](https://github.com/manikbharadwaj/codescribe/blob/main/models.py): `models.py`
- [Code files](https://github.com/manikbharadwaj/codescribe/blob/main/models.py): `models.py`

### Other components

- **Developer**

## Connections

- Developer → Browser workbench: uses (evidence: `README.md`)
- Browser workbench → Workbench interface: renders
- Browser workbench → Flask routes: requests (evidence: `static/script.js`)
- Flask routes → Workbench interface: serves (evidence: `app.py`)
- Flask routes → Authentication & sessions: routes (evidence: `app.py`)
- Flask routes → Workspace management: routes (evidence: `app.py`)
- Flask routes → File management: routes (evidence: `app.py`)
- Flask routes → Analysis endpoints: routes (evidence: `app.py`)
- Authentication & sessions → User accounts: reads/writes (evidence: `app.py`)
- Workspace management → Workspaces: reads/writes (evidence: `app.py`)
- File management → Workspaces: checks ownership (evidence: `app.py`)
- File management → Code files: reads/writes (evidence: `app.py`)
- File management → Python AST analysis: analyzes (evidence: `app.py`)
- Analysis endpoints → Python AST analysis: dispatches (evidence: `app.py`)
- Analysis endpoints → C++ structural analysis: dispatches (evidence: `app.py`)
- Python AST analysis → Metrics & guidance: produces (evidence: `analyzer.py`)
- C++ structural analysis → Metrics & guidance: produces (evidence: `analyzer.py`)
