Supercharge your development with real-time AI code reviews, vulnerability detection, and 1-click automated fixes powered by Google Gemini.
Live Demo β’ Key Features β’ Architecture β’ Quick Start β’ API Reference β’ Project Structure
Below is the CodeLens review dashboard showcasing real-time issue detection, severity badges, and side-by-side diff fixes:
https://github.com/user-attachments/assets/your-video-id-here
βΆοΈ Click to view local video embed instructions
If running locally or viewing in compatible markdown previewers:
<video src="assets/demo-video.mp4" controls width="100%" poster="assets/demo-screenshot.png">
Your browser does not support the video tag.
</video>Tip: When opening a Pull Request or creating a GitHub Release, you can drag and drop your
.mp4video directly into GitHub's editor to generate a hosted video URL.
| Feature | Description |
|---|---|
| β‘ Real-Time Token Streaming | Review suggestions stream instantly token-by-token via Server-Sent Events (SSE). |
| π‘οΈ Multi-Category Issue Triage | Automatically identifies Bugs, Security Vulnerabilities, Performance Bottlenecks, and Style Violations. |
| π¨ Dynamic Severity Badging | Color-coded severity indicators (CRITICAL, WARNING, INFO) for fast prioritization. |
| π οΈ 1-Click AI Fixes & Diff View | Generates corrected code snippets with interactive, side-by-side Original vs. Fixed diff panels. |
| π Persistent Review History | Built-in SQLite database stores every code review session with instant category filtering. |
| π¨ Dark Modern Interface | Minimalist, responsive UI built with React 19 and Vite for blazing fast performance. |
flowchart TD
User([π¨βπ» Developer]) -->|1. Submit Code| Frontend[βοΈ React 19 Frontend - Vite]
subgraph Backend [β‘ FastAPI Server]
API[FastAPI Endpoints]
GeminiClient[Google GenAI Client]
Database[(SQLite DB\nreviews.db)]
end
Frontend -->|POST /review/stream| API
Frontend -->|POST /review/fix| API
Frontend -->|GET /reviews| API
API <-->|Schema & Stream Queries| GeminiClient
GeminiClient <-->|LLM Inference API| Gemini[π§ Google Gemini AI]
API <-->|Save & Fetch Reviews| Database
API -->|SSE Event Stream| Frontend
Follow these simple steps to run CodeLens locally on your machine.
- Python 3.10+ (Tested on Python 3.11 / 3.12 / 3.13)
- Node.js 18+ & npm
- Google Gemini API Key (Get your free API Key)
git clone https://github.com/vaishnaviwangalwar-cpu/Code_Reviewer_ai.git
cd Code_Reviewer_ai-
Create and activate a virtual environment:
# Windows (PowerShell) python -m venv venv .\venv\Scripts\Activate.ps1 # macOS / Linux python3 -m venv venv source venv/bin/activate
-
Install Python dependencies:
pip install fastapi uvicorn google-genai python-dotenv pydantic
-
Configure Environment Variables: Create a
.envfile in the project root:GEMINI_API_KEY=your_google_gemini_api_key_here GEMINI_MODEL=gemini-3.5-flash
-
Start the FastAPI Backend Server:
uvicorn backend.main:app --host 0.0.0.0 --port 8000 --reload
π Backend is now live at:
http://localhost:8000(API documentation athttp://localhost:8000/docs)
-
Navigate to the frontend directory:
cd frontend -
Install dependencies:
npm install
-
Start the Vite development server:
npm run dev
π Open your browser at:
http://localhost:5173/
| Method | Endpoint | Description | Payload Example |
|---|---|---|---|
GET |
/ |
API Health Check | None |
POST |
/review |
Synchronous JSON review | {"code": "def foo(): pass"} |
POST |
/review/stream |
Real-time SSE code review stream | {"code": "def foo(): pass"} |
POST |
/review/fix |
Real-time SSE code fix stream | {"code": "...", "issue_title": "...", "issue_description": "..."} |
GET |
/reviews |
Retrieve all historical reviews | None |
Code_Reviewer_ai/
βββ backend/
β βββ database.py # SQLite connection & CRUD review queries
β βββ gemini_client.py # Google GenAI SDK client, prompts & schemas
β βββ main.py # FastAPI application & SSE streaming endpoints
β βββ reviews.db # SQLite database storage
βββ frontend/
β βββ src/
β β βββ components/
β β β βββ CodeInput.jsx # Code submission form
β β β βββ ReviewResults.jsx # Real-time results, badges & diff views
β β β βββ ReviewHistory.jsx # Historical review browser & filter
β β βββ App.jsx # Main application state & tabs
β β βββ App.css # Dark-mode styling & diff layout
β β βββ main.jsx # React root entry point
β βββ package.json
β βββ vite.config.js
βββ assets/
β βββ hero.png # Project banner logo
β βββ demo-screenshot.png # UI dashboard screenshot
βββ .env.example # Environment configuration template
βββ README.md # Interactive documentation
βββ main.py # Root execution entrypoint
- Start a Review: Paste any snippet of code (Python, JavaScript, TypeScript, Go, etc.) into the editor and hit "Review Code".
- Examine Issues: Analyze the generated cards with actionable titles, issue explanations, and severity tags.
- Generate Fixes: Click the "Fix It" button on any card to stream an intelligent correction side-by-side with your original code.
- Browse History: Switch to the "History" tab anytime to look up previously analyzed code snippets and filter by issue type.
Contributions, issues, and feature requests are welcome!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.

