Skip to content

CodeScanAi – An AI-powered code review system that highlights, analyzes, and improves code across multiple programming languages. Designed to help developers write cleaner, more efficient, and bug-free code.

Notifications You must be signed in to change notification settings

Shreyash-SP80/CodeScanAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CodeScanAi - AI-Powered Code Review Assistant 🤖

React Node.js Express.js Google Gemini Vite CSS3 Git

CodeScanAi is an intelligent web application that provides AI-powered code reviews to help developers write better, cleaner, and more efficient code.
It analyzes your code using advanced AI and provides detailed feedback, suggestions, and improvements.


✨ Features

  • 🤖 AI-Powered Analysis: Get intelligent code reviews using Google's Gemini AI
  • 📝 Real-time Editing: Write and edit code directly in the browser
  • 🎨 Syntax Highlighting: Beautiful code highlighting for multiple languages
  • 📱 Responsive Design: Works perfectly on desktop and mobile devices
  • Fast & Lightweight: Quick analysis and minimal loading times
  • 🔒 Secure: Your code is processed securely and not stored

🏗️ Architecture Overview

code-review-system/
├── 📁 backend/ # Node.js Express server
│ ├── src/
│ │ ├── 📁 controllers/ # Route controllers
│ │ ├── 📁 routes/ # API routes
│ │ ├── 📁 services/ # Business logic & AI integration
│ │ └── app.js # Express app configuration
│ ├── server.js # Server entry point
│ ├── package.json # Backend dependencies
│ └── .env # Environment variables
│
└── 📁 frontend/ # React application
├── src/
│ ├── App.js # Main React component
│ └── App.css # Application styles
├── public/
├── package.json # Frontend dependencies
└── vite.config.js # Build configuration

🔧 Backend Structure

📄 server.js

The entry point of your backend application that:

  • Loads environment variables
  • Imports the Express app
  • Starts the server on the specified port

📄 src/app.js

Configures the Express application with:

  • CORS middleware for cross-origin requests
  • JSON parsing for request bodies
  • API routes
  • Error handling middleware
  • Health check endpoints

📁 src/routes/ai.routes.js

Defines the API endpoints:

  • POST /ai/get-review → Main endpoint for code review requests

📁 src/controllers/ai.controller.js

Handles the business logic for:

  • Validating incoming requests
  • Calling the AI service
  • Sending responses back to the client

📁 src/services/ai.services.js

Contains the AI integration that:

  • Connects to Google's Gemini AI API
  • Formats prompts with system instructions
  • Processes AI responses
  • Handles errors from the AI service

🚀 Installation & Setup

Prerequisites

  • Node.js (v14 or higher)
  • npm or yarn
  • Google Gemini API key

1. Clone the Repository

git clone <your-repository-url>
cd code-review-system

2. Backend Setup

# Navigate to backend directory
cd backend

# Install dependencies
npm install

# Create environment file
echo "GEMINI_API_KEY=your_gemini_api_key_here" > .env
echo "PORT=3000" >> .env
echo "NODE_ENV=development" >> .env

# Start the development server
npm run dev

3. Frontend Setup

# Navigate to frontend directory (in a new terminal)
cd frontend

# Install dependencies
npm install

# Start the development server
npm run dev

4. Get Google Gemini API Key

  • Visit Google AI Studio
  • Create a new API key
  • Add it to your backend .env file as GEMINI_API_KEY

📦 Dependencies Explained

Backend Dependencies

Package Purpose
express Web framework for building the API server
cors Enables cross-origin resource sharing
dotenv Loads environment variables from .env
@google/genai Official SDK for Google Gemini AI API
helmet Security middleware for Express
morgan HTTP request logger middleware

Frontend Dependencies

Package Purpose
react JavaScript library for building user interfaces
react-simple-code-editor Simple code editor with syntax highlighting
prismjs Syntax highlighting library
axios HTTP client for making API requests
react-markdown Renders Markdown content
rehype-highlight Syntax highlighting for Markdown code blocks

About

CodeScanAi – An AI-powered code review system that highlights, analyzes, and improves code across multiple programming languages. Designed to help developers write cleaner, more efficient, and bug-free code.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published