# adhavan13/interviewai architecture

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

- Interactive diagram: https://gitdiagram.com/adhavan13/interviewai
- Repository: https://github.com/adhavan13/interviewai

## Overview

DecodeAI is a Chrome extension for LeetCode interview practice. Its visible workflow is: a user invokes an injected LeetCode action, the page script scrapes problem data or code and asks the extension background to open the side panel, then the React chat UI sends requests to a local backend and displays responses. The README also describes timed interviews, local code execution, Gemini-generated test cases, and AI analysis, but the corresponding implementation is not present in the supplied tree; those capabilities are shown as documented, unsampled stages. The backend and its integrations are not in this repository.

Main entry points: [`src`](https://github.com/adhavan13/interviewai/tree/main/src) (Timed interview), [`public/background.js`](https://github.com/adhavan13/interviewai/blob/main/public/background.js) (Message and panel routing), [`src/App.jsx`](https://github.com/adhavan13/interviewai/blob/main/src/App.jsx) (Panel app), [`src/components/chatPage.jsx`](https://github.com/adhavan13/interviewai/blob/main/src/components/chatPage.jsx) (Chat interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_page["LeetCode Integration"]
  node_page_actions["Page actions and scraping<br/>[content.js]"]
end

subgraph group_extension["Extension Runtime"]
  node_background["Message and panel routing<br/>[background.js]"]
end

subgraph group_interface["Side Panel UI"]
  node_react_entry["React entry<br/>[main.jsx]"]
  node_app["Panel app<br/>[App.jsx]"]
  node_chat["Chat interface<br/>[chatPage.jsx]"]
end

subgraph group_services["Interview Services"]
  node_backend["Chat API"]
  node_interview["Timed interview"]
  node_test_generation["Dynamic test cases"]
  node_code_runtime["Browser code runtime"]
  node_code_analysis["AI code analysis"]
end

node_candidate(("LeetCode user"))
node_leetcode["LeetCode page"]
node_gemini["Gemini API"]

node_candidate -->|"uses"| node_leetcode
node_leetcode -->|"invokes actions"| node_page_actions
node_page_actions -->|"sends page data"| node_background
node_background -->|"opens panel"| node_app
node_react_entry -->|"renders"| node_app
node_app -->|"renders"| node_chat
node_app -->|"signals ready"| node_background
node_background -->|"dispatches queued data"| node_chat
node_chat -->|"posts chat requests"| node_backend
node_backend -.->|"uses AI"| node_gemini
node_candidate -->|"starts session"| node_interview
node_interview -.->|"requests cases"| node_test_generation
node_interview -.->|"runs solution"| node_code_runtime
node_interview -.->|"gets feedback"| node_code_analysis
node_code_analysis -.->|"requests analysis"| node_gemini

click node_page_actions "https://github.com/adhavan13/interviewai/blob/main/public/content.js"
click node_background "https://github.com/adhavan13/interviewai/blob/main/public/background.js"
click node_react_entry "https://github.com/adhavan13/interviewai/blob/main/src/main.jsx"
click node_app "https://github.com/adhavan13/interviewai/blob/main/src/App.jsx"
click node_chat "https://github.com/adhavan13/interviewai/blob/main/src/components/chatPage.jsx"
click node_interview "https://github.com/adhavan13/interviewai/tree/main/src"
click node_test_generation "https://github.com/adhavan13/interviewai/tree/main/src"
click node_code_runtime "https://github.com/adhavan13/interviewai/tree/main/src"
click node_code_analysis "https://github.com/adhavan13/interviewai/tree/main/src"

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_page_actions,node_candidate toneBlue
class node_background toneAmber
class node_react_entry,node_app,node_chat,node_gemini toneMint
class node_backend,node_interview,node_test_generation,node_code_runtime,node_code_analysis toneRose
class node_leetcode toneIndigo
```

## Components

### LeetCode Integration

- [Page actions and scraping](https://github.com/adhavan13/interviewai/blob/main/public/content.js): `public/content.js`

### Extension Runtime

- [Message and panel routing](https://github.com/adhavan13/interviewai/blob/main/public/background.js): `public/background.js`

### Side Panel UI

- [React entry](https://github.com/adhavan13/interviewai/blob/main/src/main.jsx): `src/main.jsx`
- [Panel app](https://github.com/adhavan13/interviewai/blob/main/src/App.jsx): `src/App.jsx`
- [Chat interface](https://github.com/adhavan13/interviewai/blob/main/src/components/chatPage.jsx): `src/components/chatPage.jsx`

### Interview Services

- **Chat API**
- [Timed interview](https://github.com/adhavan13/interviewai/tree/main/src): `src`
- [Dynamic test cases](https://github.com/adhavan13/interviewai/tree/main/src): `src`
- [Browser code runtime](https://github.com/adhavan13/interviewai/tree/main/src): `src`
- [AI code analysis](https://github.com/adhavan13/interviewai/tree/main/src): `src`

### Other components

- **LeetCode user**
- **LeetCode page**
- **Gemini API**

## Connections

- LeetCode user → LeetCode page: uses (evidence: `README.md`)
- LeetCode page → Page actions and scraping: invokes actions (evidence: `public/content.js`)
- Page actions and scraping → Message and panel routing: sends page data (evidence: `public/content.js`)
- Message and panel routing → Panel app: opens panel (evidence: `public/background.js`)
- React entry → Panel app: renders (evidence: `src/main.jsx`)
- Panel app → Chat interface: renders (evidence: `src/App.jsx`)
- Panel app → Message and panel routing: signals ready (evidence: `src/App.jsx`)
- Message and panel routing → Chat interface: dispatches queued data (evidence: `public/background.js`)
- Chat interface → Chat API: posts chat requests (evidence: `src/components/chatPage.jsx`)
- Chat API → Gemini API: uses AI (evidence: `README.md`)
- LeetCode user → Timed interview: starts session (evidence: `README.md`)
- Timed interview → Dynamic test cases: requests cases (evidence: `README.md`)
- Timed interview → Browser code runtime: runs solution (evidence: `README.md`)
- Timed interview → AI code analysis: gets feedback (evidence: `README.md`)
- AI code analysis → Gemini API: requests analysis (evidence: `README.md`)
