Skip to content

CodeSage is a MERN stack-based AI code reviewer that trims, explains, suggests improvements, and summarizes code using OpenAI APIs. Built for developers to get instant, intelligent feedback and enhance code quality efficiently.

Notifications You must be signed in to change notification settings

AnbCrafts/CodeSage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🧙‍♂️ CodeSage - AI Code Assistant

Understand code instantly. CodeSage decodes complex logic into plain English, suggests optimizations, and refactors your code using the power of Llama-3 and Groq Cloud.


🚀 Overview

CodeSage is a SaaS-style developer tool designed to bridge the gap between complex code and human understanding. It uses advanced Large Language Models (LLMs) to analyze code snippets and provide:

  1. Explanations: Line-by-line logic breakdown.
  2. Optimization: Big O reduction and efficiency tips.
  3. Trimming: Removing dead code and redundancy.
  4. Suggestions: Best practices and architectural advice.

Built with the MERN Stack and Groq Cloud for blazing-fast inference.


✨ Key Features

  • ⚡ Blazing Fast AI: Powered by Groq LPUs running Llama-3-70b for near-instant results.
  • 🎨 Modern IDE Interface: A dark-mode, VS Code-inspired editor with syntax highlighting.
  • 🛠 Smart Tools: Explain, Summarize, Optimize, and Trim code with one click.
  • 📱 Fully Responsive: Glassmorphism UI that looks great on Desktop, Tablet, and Mobile.
  • 📧 EmailJS Integration: Serverless contact forms with auto-reply functionality.
  • 📄 Export Options: Copy to clipboard or download analysis as .txt.

📸 Application Tour

1. Modern SaaS Landing Page

Features a responsive glassmorphism design with clear value propositions. Home Page | Home Page

2. Intelligent Code Editor (IDE)

A split-screen environment with syntax highlighting, tabs for different AI actions (Explain, Trim, Optimize), and instant feedback. Code Editor

3. Authentication & Pricing

Secure Login Transparent Pricing
Login Page Pricing Section

Left: Secure authentication with visual feedback. Right: Clear pricing tiers to build user trust.

🛠️ Tech Stack

Frontend

  • Framework: React (Vite)
  • Styling: Tailwind CSS, Framer Motion (Animations)
  • Icons: Lucide React
  • Routing: React Router DOM
  • Utilities: React Hot Toast (Notifications), React Syntax Highlighter

Backend

  • Runtime: Node.js
  • Framework: Express.js
  • AI Provider: Groq SDK (Llama 3 Model)
  • Caching: Node-Cache (To reduce API usage for repeated queries)


⚡ Getting Started

Follow these steps to run CodeSage locally.

1. Clone the Repository

git clone https://github.com/your-username/codesage.git
cd codesage

2. Frontend Setup

Navigate to the client folder and install dependencies.

cd client
npm install

Create a .env file in the client directory:

VITE_EMAILJS_SERVICE_ID=your_service_id
VITE_EMAILJS_TEMPLATE_ID=your_template_id
VITE_EMAILJS_PUBLIC_KEY=your_public_key
VITE_AUTOREPLY_EMAILJS_TEMPLATE_ID=your_auto_reply_id

Run the frontend:

npm run dev

3. Backend Setup

Navigate to the server folder and install dependencies.

cd ../server
npm install

Create a .env file in the server directory:

PORT=5000
GROQ_API_KEY=your_groq_api_key

Run the backend:

node index.js
# or
npm run dev

🔌 API Endpoints

The backend exposes a single robust endpoint for code analysis.

POST /api/analyze

Request Body:

{
  "code": "function add(a, b) { return a + b; }",
  "language": "javascript",
  "action": "explain" // or "optimize", "trim"
}

Response:

{
  "optimizedCode": "...",
  "explanation": "...",
  "complexity": "O(1)"
}

🤝 Contributing

Contributions are welcome!

  1. Fork the project.
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature).
  3. Commit your changes (git commit -m 'Add some AmazingFeature').
  4. Push to the Branch (git push origin feature/AmazingFeature).
  5. Open a Pull Request.

📧 Contact

Anubhaw Gupta


Made with ❤️ and ☕ by Anubhaw.

About

CodeSage is a MERN stack-based AI code reviewer that trims, explains, suggests improvements, and summarizes code using OpenAI APIs. Built for developers to get instant, intelligent feedback and enhance code quality efficiently.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages