# mishraharsh01/ai-code-reviewer architecture

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

- Interactive diagram: https://gitdiagram.com/mishraharsh01/ai-code-reviewer
- Repository: https://github.com/mishraharsh01/ai-code-reviewer

## Overview

This is a browser-based AI code reviewer. A developer edits code in the React interface and requests a review; the frontend posts the code to the backend, which routes and validates the request before asking Google Gemini to generate feedback. The response is displayed as Markdown in the interface. The graph follows the sampled runtime sources; no README was provided, so there are no additional documented capabilities to add.

Main entry points: [`Frontend/src/App.jsx`](https://github.com/mishraharsh01/ai-code-reviewer/blob/master/Frontend/src/App.jsx) (Code editor and feedback), [`backend/src/routes/ai.routes.js`](https://github.com/mishraharsh01/ai-code-reviewer/blob/master/backend/src/routes/ai.routes.js) (AI review route), [`backend/src/app.js`](https://github.com/mishraharsh01/ai-code-reviewer/blob/master/backend/src/app.js) (Express app), [`backend/src/controllers/ai.controller.js`](https://github.com/mishraharsh01/ai-code-reviewer/blob/master/backend/src/controllers/ai.controller.js) (Review handler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Review interface"]
  node_bootstrap["React bootstrap<br/>[main.jsx]"]
  node_review_ui["Code editor and feedback<br/>[App.jsx]"]
end

subgraph group_api["Backend API"]
  node_server["HTTP server<br/>[server.js]"]
  node_app["Express app<br/>[app.js]"]
  node_routes["AI review route<br/>[ai.routes.js]"]
  node_controller["Review handler<br/>[ai.controller.js]"]
end

subgraph group_review["AI review"]
  node_service["Gemini review service<br/>[ai.service.js]"]
end

node_developer(("Developer"))
node_gemini["Google Gemini"]

node_bootstrap -->|"renders"| node_review_ui
node_developer -->|"edits and submits"| node_review_ui
node_review_ui -->|"POSTs code"| node_routes
node_server -->|"starts"| node_app
node_app -->|"mounts"| node_routes
node_routes -->|"dispatches"| node_controller
node_controller -->|"requests review"| node_service
node_service -->|"generates review"| node_gemini

click node_bootstrap "https://github.com/mishraharsh01/ai-code-reviewer/blob/master/Frontend/src/main.jsx"
click node_review_ui "https://github.com/mishraharsh01/ai-code-reviewer/blob/master/Frontend/src/App.jsx"
click node_server "https://github.com/mishraharsh01/ai-code-reviewer/blob/master/backend/server.js"
click node_app "https://github.com/mishraharsh01/ai-code-reviewer/blob/master/backend/src/app.js"
click node_routes "https://github.com/mishraharsh01/ai-code-reviewer/blob/master/backend/src/routes/ai.routes.js"
click node_controller "https://github.com/mishraharsh01/ai-code-reviewer/blob/master/backend/src/controllers/ai.controller.js"
click node_service "https://github.com/mishraharsh01/ai-code-reviewer/blob/master/backend/src/services/ai.service.js"

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_bootstrap,node_review_ui toneBlue
class node_server,node_app,node_routes,node_controller toneAmber
class node_service toneMint
class node_developer,node_gemini toneIndigo
```

## Components

### Review interface

- [React bootstrap](https://github.com/mishraharsh01/ai-code-reviewer/blob/master/Frontend/src/main.jsx): `Frontend/src/main.jsx`
- [Code editor and feedback](https://github.com/mishraharsh01/ai-code-reviewer/blob/master/Frontend/src/App.jsx): `Frontend/src/App.jsx`

### Backend API

- [HTTP server](https://github.com/mishraharsh01/ai-code-reviewer/blob/master/backend/server.js): `backend/server.js`
- [Express app](https://github.com/mishraharsh01/ai-code-reviewer/blob/master/backend/src/app.js): `backend/src/app.js`
- [AI review route](https://github.com/mishraharsh01/ai-code-reviewer/blob/master/backend/src/routes/ai.routes.js): `backend/src/routes/ai.routes.js`
- [Review handler](https://github.com/mishraharsh01/ai-code-reviewer/blob/master/backend/src/controllers/ai.controller.js): `backend/src/controllers/ai.controller.js`

### AI review

- [Gemini review service](https://github.com/mishraharsh01/ai-code-reviewer/blob/master/backend/src/services/ai.service.js): `backend/src/services/ai.service.js`

### Other components

- **Developer**
- **Google Gemini**

## Connections

- React bootstrap → Code editor and feedback: renders (evidence: `Frontend/src/main.jsx`)
- Developer → Code editor and feedback: edits and submits (evidence: `Frontend/src/App.jsx`)
- Code editor and feedback → AI review route: POSTs code (evidence: `Frontend/src/App.jsx`)
- HTTP server → Express app: starts (evidence: `backend/server.js`)
- Express app → AI review route: mounts (evidence: `backend/src/app.js`)
- AI review route → Review handler: dispatches (evidence: `backend/src/routes/ai.routes.js`)
- Review handler → Gemini review service: requests review (evidence: `backend/src/controllers/ai.controller.js`)
- Gemini review service → Google Gemini: generates review (evidence: `backend/src/services/ai.service.js`)
