# rajeshbakthavachalam/ai-code-generator architecture

> Architecture diagram of the GitHub repository rajeshbakthavachalam/ai-code-generator, 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/rajeshbakthavachalam/ai-code-generator
- Repository: https://github.com/rajeshbakthavachalam/ai-code-generator

## Overview

AI-Code-Generator is a browser-based app that turns a natural-language request into code using CodeGemma through local Ollama. The principal flow is a user prompt, app-side generation, and displayed code; the README also describes shell-command execution and offline/private operation. The tree and README support the product outline, but the app.py excerpt is unavailable, so internal call details and the exact execution path cannot be verified.

Main entry points: [`app.py`](https://github.com/rajeshbakthavachalam/ai-code-generator/blob/main/app.py) (Generator App)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User Interface"]
  node_app["Generator App<br/>[app.py]"]
  node_streamlit["Streamlit"]
end

subgraph group_generation["Local Generation"]
  node_ollama["Ollama"]
  node_codegemma["CodeGemma"]
  node_generated["Generated Code"]
end

subgraph group_execution["Code Execution"]
  node_shell["Shell Execution"]
end

node_user(("User"))

node_user -->|"submits prompt"| node_app
node_app -->|"renders interface"| node_streamlit
node_app -->|"requests generation"| node_ollama
node_ollama -->|"runs model"| node_codegemma
node_app -->|"returns code"| node_generated
node_app -.->|"executes commands"| node_shell

click node_app "https://github.com/rajeshbakthavachalam/ai-code-generator/blob/main/app.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_app,node_streamlit,node_user toneBlue
class node_ollama,node_codegemma,node_generated toneAmber
class node_shell toneMint
```

## Components

### User Interface

- [Generator App](https://github.com/rajeshbakthavachalam/ai-code-generator/blob/main/app.py): `app.py`
- **Streamlit**

### Local Generation

- **Ollama**
- **CodeGemma**
- **Generated Code**

### Code Execution

- **Shell Execution**

### Other components

- **User**

## Connections

- User → Generator App: submits prompt (evidence: `README.md`)
- Generator App → Streamlit: renders interface (evidence: `app.py`)
- Generator App → Ollama: requests generation (evidence: `README.md`)
- Ollama → CodeGemma: runs model (evidence: `README.md`)
- Generator App → Generated Code: returns code (evidence: `README.md`)
- Generator App → Shell Execution: executes commands (evidence: `README.md`)
