# anshjain1489/aicodereviewer architecture

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

- Interactive diagram: https://gitdiagram.com/anshjain1489/aicodereviewer
- Repository: https://github.com/anshjain1489/aicodereviewer

## Overview

This is a web-based AI code-review platform. Developers submit code or GitHub pull requests, receive static and AI findings with scores, then inspect explanations and proposed fixes; PR feedback is posted only after developer approval. The main path runs from the React workspace through the REST API and review pipeline to Firestore, with separate authentication, GitHub, and analytics capabilities. The review orchestration and its analysis/scoring layers are shown distinctly. Some feature branches are documented in the README but their source was not sampled, so those relationships are marked unverified.

Main entry points: [`backend/src/services/reviewService.js`](https://github.com/anshjain1489/aicodereviewer/blob/main/backend/src/services/reviewService.js) (Review orchestration), [`frontend/src/services/api.js`](https://github.com/anshjain1489/aicodereviewer/blob/main/frontend/src/services/api.js) (REST client), [`frontend/src/pages/PRReview.jsx`](https://github.com/anshjain1489/aicodereviewer/blob/main/frontend/src/pages/PRReview.jsx) (PR review), [`backend/src/controllers/reviewController.js`](https://github.com/anshjain1489/aicodereviewer/blob/main/backend/src/controllers/reviewController.js) (Review controller)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Developer workspace"]
  node_workspace["Review workspace<br/>[NewReview.jsx]"]
  node_review_result["Findings and fixes<br/>[ReviewResult.jsx]"]
  node_pr_workspace["PR review<br/>[PRReview.jsx]"]
  node_dashboard["Dashboard and analytics<br/>[Dashboard.jsx]"]
  node_api_client["REST client<br/>[api.js]"]
end

subgraph group_api["API and identity"]
  node_application["Express application<br/>[app.js]"]
  node_review_routes["Review routes<br/>[reviewRoutes.js]"]
  node_review_controller["Review controller"]
  node_auth["Authentication<br/>[authService.js]"]
end

subgraph group_review["Review analysis"]
  node_review_service["Review orchestration<br/>[reviewService.js]"]
  node_analyzers["Static analyzers"]
  node_ai_service["AI analysis<br/>[aiService.js]"]
  node_scoring["Scoring engine<br/>[scoringService.js]"]
end

subgraph group_integrations["External integrations"]
  node_github_service["GitHub integration<br/>[githubService.js]"]
  node_github_api["GitHub API"]
  node_ai_providers["AI providers"]
end

subgraph group_data["Persistence"]
  node_issues["Issue repository<br/>[issueRepository.js]"]
  node_reviews["Review repository"]
  node_firestore[("Firestore<br/>[firebase.js]")]
end

node_developer(("Developer"))

node_developer -->|"submits code"| node_workspace
node_workspace -->|"sends review"| node_api_client
node_review_result -->|"requests results"| node_api_client
node_pr_workspace -->|"requests PR review"| node_api_client
node_dashboard -.->|"loads analytics"| node_api_client
node_api_client -->|"calls REST API"| node_application
node_application -->|"mounts routes"| node_review_routes
node_review_routes -->|"dispatches requests"| node_review_controller
node_review_controller -->|"starts review"| node_review_service
node_review_service -->|"stores review"| node_reviews
node_review_service -->|"runs static analysis"| node_analyzers
node_review_service -->|"requests AI analysis"| node_ai_service
node_review_service -->|"saves findings"| node_issues
node_review_service -->|"calculates scores"| node_scoring
node_review_controller -->|"loads findings"| node_issues
node_ai_service -->|"selects provider"| node_ai_providers
node_reviews -->|"reads and writes"| node_firestore
node_issues -->|"reads and writes"| node_firestore
node_auth -.->|"persists users"| node_firestore
node_github_service -.->|"integrates repositories"| node_github_api
node_developer -->|"reviews pull request"| node_pr_workspace
node_pr_workspace -.->|"requests PR analysis"| node_github_service
node_github_service -.->|"posts approved feedback"| node_github_api
node_developer -.->|"authenticates"| node_auth
node_developer -->|"views metrics"| node_dashboard

click node_workspace "https://github.com/anshjain1489/aicodereviewer/blob/main/frontend/src/pages/NewReview.jsx"
click node_review_result "https://github.com/anshjain1489/aicodereviewer/blob/main/frontend/src/pages/ReviewResult.jsx"
click node_pr_workspace "https://github.com/anshjain1489/aicodereviewer/blob/main/frontend/src/pages/PRReview.jsx"
click node_dashboard "https://github.com/anshjain1489/aicodereviewer/blob/main/frontend/src/pages/Dashboard.jsx"
click node_api_client "https://github.com/anshjain1489/aicodereviewer/blob/main/frontend/src/services/api.js"
click node_application "https://github.com/anshjain1489/aicodereviewer/blob/main/backend/src/app.js"
click node_review_routes "https://github.com/anshjain1489/aicodereviewer/blob/main/backend/src/routes/reviewRoutes.js"
click node_review_controller "https://github.com/anshjain1489/aicodereviewer/blob/main/backend/src/controllers/reviewController.js"
click node_auth "https://github.com/anshjain1489/aicodereviewer/blob/main/backend/src/services/authService.js"
click node_review_service "https://github.com/anshjain1489/aicodereviewer/blob/main/backend/src/services/reviewService.js"
click node_analyzers "https://github.com/anshjain1489/aicodereviewer/tree/main/backend/src/analyzers"
click node_ai_service "https://github.com/anshjain1489/aicodereviewer/blob/main/backend/src/services/aiService.js"
click node_scoring "https://github.com/anshjain1489/aicodereviewer/blob/main/backend/src/services/scoringService.js"
click node_issues "https://github.com/anshjain1489/aicodereviewer/blob/main/backend/src/repositories/issueRepository.js"
click node_reviews "https://github.com/anshjain1489/aicodereviewer/blob/main/backend/src/repositories/reviewRepository.js"
click node_firestore "https://github.com/anshjain1489/aicodereviewer/blob/main/backend/src/config/firebase.js"
click node_github_service "https://github.com/anshjain1489/aicodereviewer/blob/main/backend/src/services/githubService.js"
click node_ai_providers "https://github.com/anshjain1489/aicodereviewer/tree/main/backend/src/integrations/ai"

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_workspace,node_review_result,node_pr_workspace,node_dashboard,node_api_client toneBlue
class node_application,node_review_routes,node_review_controller,node_auth toneAmber
class node_review_service,node_analyzers,node_ai_service,node_scoring toneMint
class node_github_service,node_github_api,node_ai_providers toneRose
class node_issues,node_reviews,node_firestore,node_developer toneIndigo
```

## Components

### Developer workspace

- [Review workspace](https://github.com/anshjain1489/aicodereviewer/blob/main/frontend/src/pages/NewReview.jsx): `frontend/src/pages/NewReview.jsx`
- [Findings and fixes](https://github.com/anshjain1489/aicodereviewer/blob/main/frontend/src/pages/ReviewResult.jsx): `frontend/src/pages/ReviewResult.jsx`
- [PR review](https://github.com/anshjain1489/aicodereviewer/blob/main/frontend/src/pages/PRReview.jsx): `frontend/src/pages/PRReview.jsx`
- [Dashboard and analytics](https://github.com/anshjain1489/aicodereviewer/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [REST client](https://github.com/anshjain1489/aicodereviewer/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`

### API and identity

- [Express application](https://github.com/anshjain1489/aicodereviewer/blob/main/backend/src/app.js): `backend/src/app.js`
- [Review routes](https://github.com/anshjain1489/aicodereviewer/blob/main/backend/src/routes/reviewRoutes.js): `backend/src/routes/reviewRoutes.js`
- [Review controller](https://github.com/anshjain1489/aicodereviewer/blob/main/backend/src/controllers/reviewController.js): `backend/src/controllers/reviewController.js`
- [Authentication](https://github.com/anshjain1489/aicodereviewer/blob/main/backend/src/services/authService.js): `backend/src/services/authService.js`

### Review analysis

- [Review orchestration](https://github.com/anshjain1489/aicodereviewer/blob/main/backend/src/services/reviewService.js): `backend/src/services/reviewService.js`
- [Static analyzers](https://github.com/anshjain1489/aicodereviewer/tree/main/backend/src/analyzers): `backend/src/analyzers`
- [AI analysis](https://github.com/anshjain1489/aicodereviewer/blob/main/backend/src/services/aiService.js): `backend/src/services/aiService.js`
- [Scoring engine](https://github.com/anshjain1489/aicodereviewer/blob/main/backend/src/services/scoringService.js): `backend/src/services/scoringService.js`

### External integrations

- [GitHub integration](https://github.com/anshjain1489/aicodereviewer/blob/main/backend/src/services/githubService.js): `backend/src/services/githubService.js`
- **GitHub API**
- [AI providers](https://github.com/anshjain1489/aicodereviewer/tree/main/backend/src/integrations/ai): `backend/src/integrations/ai`

### Persistence

- [Issue repository](https://github.com/anshjain1489/aicodereviewer/blob/main/backend/src/repositories/issueRepository.js): `backend/src/repositories/issueRepository.js`
- [Review repository](https://github.com/anshjain1489/aicodereviewer/blob/main/backend/src/repositories/reviewRepository.js): `backend/src/repositories/reviewRepository.js`
- [Firestore](https://github.com/anshjain1489/aicodereviewer/blob/main/backend/src/config/firebase.js): `backend/src/config/firebase.js`

### Other components

- **Developer**

## Connections

- Developer → Review workspace: submits code (evidence: `README.md`)
- Review workspace → REST client: sends review (evidence: `frontend/src/pages/NewReview.jsx`)
- Findings and fixes → REST client: requests results (evidence: `frontend/src/pages/ReviewResult.jsx`)
- PR review → REST client: requests PR review (evidence: `frontend/src/pages/PRReview.jsx`)
- Dashboard and analytics → REST client: loads analytics
- REST client → Express application: calls REST API (evidence: `README.md`)
- Express application → Review routes: mounts routes (evidence: `backend/src/app.js`)
- Review routes → Review controller: dispatches requests (evidence: `backend/src/routes/reviewRoutes.js`)
- Review controller → Review orchestration: starts review (evidence: `backend/src/controllers/reviewController.js`)
- Review orchestration → Review repository: stores review (evidence: `backend/src/services/reviewService.js`)
- Review orchestration → Static analyzers: runs static analysis (evidence: `backend/src/services/reviewService.js`)
- Review orchestration → AI analysis: requests AI analysis (evidence: `backend/src/services/reviewService.js`)
- Review orchestration → Issue repository: saves findings (evidence: `backend/src/services/reviewService.js`)
- Review orchestration → Scoring engine: calculates scores (evidence: `backend/src/services/reviewService.js`)
- Review controller → Issue repository: loads findings (evidence: `backend/src/controllers/reviewController.js`)
- AI analysis → AI providers: selects provider (evidence: `backend/src/services/aiService.js`)
- Review repository → Firestore: reads and writes (evidence: `backend/src/repositories/reviewRepository.js`)
- Issue repository → Firestore: reads and writes (evidence: `backend/src/repositories/issueRepository.js`)
- Authentication → Firestore: persists users
- GitHub integration → GitHub API: integrates repositories
- Developer → PR review: reviews pull request (evidence: `README.md`)
- PR review → GitHub integration: requests PR analysis
- GitHub integration → GitHub API: posts approved feedback (evidence: `README.md`)
- Developer → Authentication: authenticates
- Developer → Dashboard and analytics: views metrics (evidence: `README.md`)
