Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CodeReviewAI

An AI-powered code review assistant that analyzes code for readability, structure, and maintainability before human review. Powered by GPT-4o.

Features

  • Readability — naming conventions, clarity, documentation
  • Structure — function decomposition, separation of concerns, module design
  • Maintainability — complexity, duplication, SOLID principles
  • Per-category scores (0–10) with color-coded visualization
  • Actionable issues with line references and concrete suggestions
  • Highlights code strengths alongside problems

Setup

1. Install backend dependencies

npm install

2. Configure environment

cp .env.example .env
# Edit .env and add your OpenAI API key

3. Install frontend dependencies

cd frontend && npm install

Running

Open two terminals:

Backend (port 3001):

npm run dev

Frontend (port 5173):

cd frontend && npm run dev

Then open http://localhost:5173.

Project Structure

├── src/
│   ├── server.ts        # Express API server
│   ├── reviewAgent.ts   # OpenAI review logic
│   └── types.ts         # Shared TypeScript types
├── frontend/
│   └── src/
│       ├── App.tsx      # React UI
│       └── App.css      # Styles
├── .env.example
└── tsconfig.json

API

POST /api/review

Request body:

{
  "code": "function foo() { ... }",
  "language": "JavaScript",
  "filename": "utils.js"
}

Response:

{
  "overallScore": 7.2,
  "summary": "...",
  "readability": { "score": 7.5, "summary": "...", "issues": [...] },
  "structure":    { "score": 7.0, "summary": "...", "issues": [...] },
  "maintainability": { "score": 7.0, "summary": "...", "issues": [...] },
  "positives": ["..."],
  "reviewedAt": "2026-03-17T..."
}

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages