An AI-powered full-stack web application that reviews source code using Google Gemini AI and provides professional feedback on code quality, performance, security, best practices, maintainability, and potential improvements.
Built with React, Node.js, Express.js, and Google Gemini AI.
- π Live Demo
- π Project Overview
- β¨ Features
- π Multi-Language Support
- β Project Highlights
- π System Architecture
- π Application Workflow
- π Project Structure
- π Technologies Used
- π Getting Started
- β Environment Variables
- π‘ API Documentation
- π File Documentation
- π§ͺ Testing
- π§ Troubleshooting
- β Deployment
- π Future Improvements
- π€ Contributing
- π License
- π¨βπ» Author
Experience the application online.
https://your-vercel-link.vercel.app
https://your-render-link.onrender.com
- Open the application.
- Paste your source code into the editor.
- Click Analyze Code.
- Wait a few seconds while Google Gemini reviews your code.
- Read the AI-generated review.
- Copy individual snippets or the entire review.
Note: If the backend is hosted on a free-tier service such as Render, the first request may take 30β60 seconds while the server wakes up.
AI Code Reviewer is a modern full-stack application that leverages Google Gemini AI to perform intelligent code reviews across multiple programming languages.
Instead of manually reviewing code or relying solely on traditional linters, developers can submit their source code and receive detailed AI-generated feedback covering correctness, readability, performance, security, maintainability, and industry best practices.
The application combines an interactive code editor, syntax highlighting, markdown rendering, and AI-powered analysis to deliver a seamless developer experience.
Code reviews are an essential part of software development, but they often require time, collaboration, and experienced developers.
This project demonstrates how Artificial Intelligence can assist developers by providing:
- Instant code reviews
- Performance recommendations
- Security analysis
- Best practice suggestions
- Refactoring opportunities
- Code quality improvements
The goal is not to replace human reviewers but to help developers identify issues earlier and learn from AI-generated recommendations.
- Real-time syntax highlighting
- Clean coding environment
- Responsive editor layout
- Scroll synchronization
- Placeholder guidance
Generate professional reviews including:
- Overall Code Score
- Executive Summary
- Code Quality Analysis
- Strengths
- Weaknesses
- Bug Detection
- Refactoring Suggestions
- Performance Improvements
- Security Recommendations
- Best Practices
- Testing Suggestions
The AI response is rendered as a professional document with:
- Headings
- Lists
- Tables
- Syntax-highlighted code blocks
- Formatted markdown
- Copy individual code snippets
- Copy the complete review
- Visual confirmation after copying
- Fast AI responses
- Loading animations
- Responsive design
- Friendly error messages
- Clean split-screen interface
The AI Code Reviewer is designed to analyze code written in a wide range of programming languages.
- JavaScript
- TypeScript
- Python
- Java
- C
- C++
- C#
- Go
- Rust
- PHP
- Ruby
- Kotlin
- Swift
- Dart
- HTML
- CSS
- SQL
- Bash
- JSON
- YAML
The AI automatically understands the submitted language and provides language-specific recommendations without requiring manual language selection.
β AI-powered code review
β Google Gemini AI integration
β Modern React frontend
β Express.js REST API
β Interactive code editor
β Real-time syntax highlighting
β Markdown rendering
β Copy code snippets
β Responsive interface
β Error handling
β Modular project structure
β Clean code architecture
The project follows a simple client-server architecture.
+------------------------+
| React Frontend |
| Code Editor + Review |
+-----------+------------+
|
Axios
|
βΌ
+------------------------+
| Express Backend |
| REST API Endpoints |
+-----------+------------+
|
Google Gemini AI API
|
βΌ
AI Code Review & Suggestions
User Opens Application
β
βΌ
Paste Source Code
β
βΌ
Click "Analyze Code"
β
βΌ
Axios POST Request
β
βΌ
Express Backend
β
βΌ
Google Gemini AI
β
βΌ
Generate Review
β
βΌ
Return Markdown Response
β
βΌ
Render Review
β
βΌ
Copy or Read Suggestions
The project follows a clean and modular full-stack architecture, separating the frontend and backend into independent applications. This approach improves scalability, maintainability, and future development.
Project-1/
β
βββ Backend/
β βββ src/
β β βββ controllers/
β β β βββ ai.controller.js
β β β
β β βββ routes/
β β β βββ ai.routes.js
β β β
β β βββ services/
β β β βββ ai.service.js
β β β
β β βββ app.js
β β
β βββ server.js
β βββ package.json
β βββ .env
β
βββ Frontend/
β βββ public/
β βββ src/
β β βββ App.jsx
β β βββ App.css
β β βββ main.jsx
β β βββ index.css
β β
β βββ package.json
β βββ vite.config.js
β βββ index.html
β
βββ README.md
| Technology | Purpose |
|---|---|
| React | Build the user interface |
| Vite | Development server & build tool |
| Axios | HTTP requests |
| React Markdown | Render AI responses |
| PrismJS | Editor syntax highlighting |
| Highlight.js | Markdown code highlighting |
| React Simple Code Editor | Interactive code editor |
| Technology | Purpose |
|---|---|
| Node.js | JavaScript runtime |
| Express.js | REST API |
| Google Gemini AI | AI-powered code review |
| CORS | Cross-origin communication |
| dotenv | Environment variable management |
- Git
- GitHub
- Visual Studio Code
- npm
- Chrome Developer Tools
- Postman
The application follows a layered architecture where each layer has a single responsibility.
React Frontend
β
βΌ
Axios API Requests
β
βΌ
Express Routes
β
βΌ
Controllers
β
βΌ
AI Service
β
βΌ
Google Gemini AI
- Code editing
- Syntax highlighting
- Markdown rendering
- API communication
- Copy functionality
- Loading states
- API routing
- Request validation
- AI communication
- Error handling
- Response formatting
Before running the project, ensure you have the following installed.
- Node.js (v18 or higher)
- npm
- Git
- Google Gemini API Key
git clone https://github.com/your-username/AI-Code-Reviewer.gitMove into the project directory.
cd AI-Code-ReviewerNavigate to the backend folder.
cd BackendInstall dependencies.
npm installCreate a .env file.
GOOGLE_GEMINI_KEY=YOUR_API_KEYStart the backend server.
npm run devBackend URL
http://localhost:3000
Open another terminal.
cd FrontendInstall dependencies.
npm installRun the frontend.
npm run devFrontend URL
http://localhost:5173
Start both servers.
cd Backend
npm run devcd Frontend
npm run devVisit
http://localhost:5173
Paste your code into the editor and click Analyze Code.
Create a .env file inside the Backend folder.
GOOGLE_GEMINI_KEY=your_google_gemini_api_keyImportant: Never commit your
.envfile to GitHub. Keep your API keys private.
The backend exposes a simple REST API for AI-powered code review.
POST /ai/get-review{
"code": "function add(a, b) {\n return a + b;\n}"
}# Overall Score
9/10
# Executive Summary
Well-structured function with clear naming.
# Strengths
- Readable
- Efficient
- Easy to maintain
# Performance Review
No performance issues detected.
# Security Review
No security concerns found.
# Best Practices
- Add JSDoc comments.
- Consider input validation.| Status | Description |
|---|---|
| 200 | Review generated successfully |
| 400 | Invalid or missing code |
| 500 | Internal server error |
const response = await axios.post(
"http://localhost:3000/ai/get-review",
{
code
}
);
console.log(response.data);{
"review": "# Overall Score\n9/10\n..."
}User Code
β
βΌ
POST /ai/get-review
β
βΌ
Express Route
β
βΌ
Controller
β
βΌ
AI Service
β
βΌ
Google Gemini AI
β
βΌ
Markdown Review
β
βΌ
React Frontend
The backend is responsible for processing user requests and communicating with Google Gemini AI.
Application entry point.
- Load environment variables
- Start Express server
- Listen on Port 3000
Express application configuration.
- Initialize Express
- Register middleware
- Enable CORS
- Parse JSON
- Register routes
Defines the application's API endpoints.
POST /ai/get-reviewThis endpoint accepts user code and forwards it to the controller.
Processes incoming HTTP requests.
Responsibilities include:
- Validate request body
- Check for missing code
- Call AI Service
- Return AI response
- Handle errors
This is the core of the application.
Responsibilities:
- Configure Google Gemini AI
- Create system prompts
- Send user code to Gemini
- Receive AI response
- Return formatted markdown review
The frontend is built with React and Vite, providing a modern, responsive, and interactive interface for developers to submit code and receive AI-powered reviews.
The entry point of the React application.
- Creates the React application
- Mounts the root component
- Enables React Strict Mode
- Loads global styles
The heart of the frontend application.
- Manage application state
- Handle code editor
- Send requests to the backend
- Display AI responses
- Render markdown
- Copy code snippets
- Display loading animations
- Handle API errors
| State | Purpose |
|---|---|
code |
Stores the user's source code |
review |
Stores the AI-generated review |
loading |
Indicates when AI analysis is running |
copiedAll |
Displays copy confirmation |
- Reads user code
- Sends POST request
- Receives AI review
- Updates the UI
Allows users to copy the entire AI review with one click.
Allows users to copy individual code blocks from the generated review.
Updates highlighted code in real time while the user types.
Contains styles for:
- Split-screen layout
- Code editor
- Review panel
- Buttons
- Loading animation
- Responsive design
- Copy buttons
Provides global styles including:
- Typography
- Body styling
- Theme colors
- Scrollbars
- Global spacing
Configures the Vite development server.
- React integration
- Fast Hot Module Reload (HMR)
- Production build optimization
The HTML template used by Vite.
Contains:
- Root element
- Meta tags
- Entry script
| File | Description |
|---|---|
server.js |
Starts the Express server |
app.js |
Configures Express and middleware |
ai.routes.js |
Defines API endpoints |
ai.controller.js |
Handles HTTP requests |
ai.service.js |
Communicates with Google Gemini AI |
.env |
Stores environment variables |
package.json |
Project metadata and dependencies |
| File | Description |
|---|---|
main.jsx |
React entry point |
App.jsx |
Main application component |
App.css |
Component styling |
index.css |
Global styling |
vite.config.js |
Vite configuration |
package.json |
Frontend dependencies |
index.html |
HTML template |
Although this project is designed for educational purposes, it follows several security best practices.
- Store API keys in a
.envfile. - Never commit
.envfiles to GitHub. - Rotate API keys if they become exposed.
The backend validates incoming requests before sending them to Google Gemini AI.
The application returns user-friendly error messages while preventing sensitive server information from being exposed.
Cross-Origin Resource Sharing (CORS) is configured to allow communication between the frontend and backend during development.
For production deployments, restrict CORS to trusted domains only.
- Environment variables for secrets
- Server-side AI requests
- Modular application structure
- Proper HTTP status codes
- Centralized request handling
The application has been manually tested across multiple workflows.
The following features have been verified:
- β Code Editor
- β Syntax Highlighting
- β Markdown Rendering
- β Copy Review
- β Copy Code Snippets
- β Loading States
- β Responsive Layout
- β API Integration
- β Error Messages
Verified functionality includes:
- β API Endpoint
- β Request Validation
- β Google Gemini Integration
- β Error Handling
- β JSON Responses
- β CORS Configuration
| Test Case | Result |
|---|---|
| Valid Code Submission | β Pass |
| Empty Code Submission | β Pass |
| Large Code Block | β Pass |
| AI Response Rendering | β Pass |
| Copy Review | β Pass |
| Copy Code Snippets | β Pass |
| Invalid API Key | β Pass |
| Backend Offline | β Pass |
- Postman
- Chrome DevTools
- Visual Studio Code
- npm
- Git
- GitHub
If you encounter issues while running the project, try the following solutions.
Possible causes:
- Invalid API key
- API quota exceeded
- Unsupported model
- Network issues
Solutions:
- Verify
GOOGLE_GEMINI_KEY - Check your Gemini API quota
- Review backend logs
- Restart the backend server
Possible causes:
- Backend server not running
- Wrong API URL
- Incorrect port
Solutions:
cd Backend
npm run dev
Verify:
```text
http://localhost:3000
---
## Frontend Not Loading
Possible causes:
- Missing dependencies
- Vite server stopped
Solutions:
```bash
cd Frontend
npm install
npm run dev- Ensure PrismJS is installed.
- Verify Prism CSS is imported.
- Restart the Vite server.
- Verify browser clipboard permissions.
- Use a secure browser (HTTPS in production).
Possible reasons:
- Empty input
- Backend offline
- Gemini API unavailable
Verify:
- Backend is running.
- API key is valid.
- Internet connection is available.
To get the best experience:
- Submit complete code snippets.
- Keep code focused on a single feature or file.
- Avoid submitting extremely large files in one request.
- Review AI suggestions before applying them to production code.
The application can be deployed on any modern cloud platform.
Recommended Platforms
- Vercel
- Netlify
npm run buildDeploy the generated dist folder.
Recommended Platforms
- Render
- Railway
- Heroku
Ensure you have configured:
- GOOGLE_GEMINI_KEY
- PORT
- NODE_ENV=production
Start the production server.
npm startBefore deployment, verify the following:
- Environment variables are configured.
- Google Gemini API key is valid.
- Backend API URL is updated.
- Frontend builds successfully.
- CORS is configured correctly.
- API endpoints are working.
- Production dependencies are installed.
This project serves as a foundation for many exciting features planned for future releases.
- AI-powered code explanation
- AI bug fixing
- AI code optimization
- AI code generation
- AI documentation generation
- AI unit test generation
- Code complexity analysis
- Duplicate code detection
- Dependency analysis
- Cyclomatic complexity report
- Maintainability score
- Technical debt estimation
- Automatic language detection
- Language-specific best practices
- Framework-aware reviews
- Support for additional languages
- Custom review profiles
- User Authentication
- Review History
- Saved Reviews
- Favorite Reviews
- Export Review as PDF
- Export Review as Markdown
- Review Analytics
- Code Quality Trends
- Review Statistics
- Personal Dashboard
- Project History
- Dark & Light Themes
- Keyboard Shortcuts
- Drag & Drop File Upload
- GitHub Repository Integration
- VS Code Extension
- Browser Extension
Building this project strengthened my understanding of modern full-stack development and AI integration.
- React
- Vite
- Component-Based Architecture
- State Management
- Axios
- Markdown Rendering
- Syntax Highlighting
- Responsive UI Design
- Node.js
- Express.js
- REST API Development
- Middleware
- Error Handling
- Environment Variables
- API Integration
- Google Gemini AI
- Prompt Engineering
- AI-powered Code Analysis
- Response Formatting
- Structured Reviews
- Clean Code Principles
- Modular Project Structure
- Documentation
- Git Workflow
- Debugging
- Code Review Practices
- Problem Solving
This project demonstrates practical experience with modern web development by combining frontend engineering, backend APIs, and Artificial Intelligence into a single application.
It showcases:
- Full-Stack Development
- REST API Design
- AI Integration
- Professional Documentation
- Clean Architecture
- Modern React Development
- Express.js Backend Development
- Real-world Software Engineering Practices
Contributions are always welcome.
If you would like to improve this project:
Click the Fork button on GitHub.
git checkout -b feature/your-feature-namegit commit -m "Add your feature"git push origin feature/your-feature-nameDescribe your changes clearly and submit the pull request for review.
This project is licensed under the MIT License.
You are free to use, modify, and distribute this project for educational and personal purposes.
MERN Stack Developer | AI Enthusiast | Open Source Learner
Passionate about building modern web applications using React, Node.js, Express.js, MongoDB, and Artificial Intelligence.
https://github.com/Wahaj-Developer
https://linkedin.com/in/your-linkedin
https://your-portfolio-link.com
If you found this project helpful, consider supporting it by:
- β Starring the repository
- π΄ Forking the project
- π Reporting bugs
- π‘ Suggesting new features
- π’ Sharing it with others
Your support motivates me to build more open-source projects.
Special thanks to the amazing open-source community and the tools that made this project possible.
- React
- Vite
- Express.js
- Google Gemini AI
- PrismJS
- Highlight.js
- React Markdown
- Axios
- Node.js
π’ Status: Active Development
Upcoming updates include:
- Multi-language improvements
- Authentication system
- Review history
- AI-generated test cases
- PDF export
- GitHub integration
- VS Code extension
Made with β€οΈ by Muhammed Wahaj Ahmed

