Skip to content

Latest commit

 

History

History
136 lines (93 loc) · 3.56 KB

File metadata and controls

136 lines (93 loc) · 3.56 KB

CodeSage — AI Code Explainer

An AI-powered tool that helps developers understand, debug, and optimize code

React Node.js Google Gemini Express


Overview

CodeSage is a full-stack, SaaS-grade AI tool powered by Google Gemini AI. Paste any code snippet and instantly get a plain-English explanation, bug detection with severity ratings, or optimization suggestions with time and space complexity analysis — all in one clean interface.


Features

Feature Description
Code Explainer Step-by-step beginner-friendly breakdown of any code snippet
Bug Finder Detects errors and issues with severity ratings and suggested fixes
Code Optimizer Optimization suggestions with Time & Space complexity analysis
Dark / Light Mode Persistent theme toggle saved across sessions
Copy Results One-click clipboard copy of AI-generated output

Tech Stack

Layer Technology
Frontend React, CSS
Backend Node.js, Express.js
AI Engine Google Gemini API
Architecture Full-Stack (Client / Server)

Project Structure

CodeSage-AI-Code-Explainer/
├── client/               # React frontend
│   ├── src/
│   │   ├── components/   # UI components
│   │   └── main.jsx      # Entry point
│   └── index.html
├── server/               # Express backend
│   ├── routes/           # API routes
│   └── index.js          # Server entry point
├── package.json
└── README.md

Getting Started

Prerequisites

Installation

# Clone the repository
git clone https://github.com/humaisali/CodeSage-AI-Code-Explainer.git

# Navigate into the project
cd CodeSage-AI-Code-Explainer

Setup the Server

cd server
npm install

# Create a .env file and add your Gemini API key
echo "GEMINI_API_KEY=your_api_key_here" > .env

# Start the server
npm start

Setup the Client

cd client
npm install
npm run dev

Open http://localhost:5173 in your browser.


Environment Variables

Create a .env file inside the server/ directory:

GEMINI_API_KEY=your_google_gemini_api_key

How It Works

  1. User pastes a code snippet into the editor
  2. Selects a mode — Explain, Debug, or Optimize
  3. The request is sent to the Express backend
  4. Backend calls Google Gemini API with a structured prompt
  5. AI response is returned and displayed in the UI

Author

Humais Ali — Full Stack Developer at SkyTech Developers

LinkedIn GitHub


Built with React, Node.js, and Google Gemini AI.