Skip to content

farmanali11/codelens-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” CodeLens AI

Professional AI-powered code review platform with real-time analysis

License Version Node React

CodeLens AI is a modern, production-ready code review application that leverages Google Gemini AI to provide comprehensive code analysis, security audits, and performance recommendations.


✨ Features

Core Capabilities

  • πŸ€– AI-Powered Reviews - Leverages Google Gemini 1.5 Flash for intelligent code analysis
  • πŸ”’ Security Analysis - Detects vulnerabilities and security best practices
  • ⚑ Performance Insights - Identifies bottlenecks and optimization opportunities
  • πŸ“Š Code Quality Metrics - Severity-based issue classification (Critical β†’ Low)
  • 🎨 Modern UI - Beautiful glassmorphism design with premium 2026 aesthetics
  • ⌨️ Keyboard Shortcuts - Power user features (Ctrl+Enter to review)
  • πŸŒ™ Syntax Highlighting - Multi-language support with Prism.js

Advanced Features

  • Real-time code metrics (lines, complexity, comments)
  • Detailed improvement suggestions with code examples
  • Empty state guidance for new users
  • Responsive design (mobile, tablet, desktop)
  • Professional error handling
  • Loading states with animated indicators

πŸš€ Quick Start

Prerequisites

  • Node.js >= 18.0.0
  • npm >= 9.0.0
  • Google Gemini API key (Get one here)

Installation

  1. Clone the repository
git clone https://github.com/yourusername/codelens-ai.git
cd codelens-ai
  1. Install dependencies

Frontend:

cd frontend
npm install

Backend:

cd backend
npm install
  1. Configure environment variables

Create .env in the backend directory:

cp backend/.env.example backend/.env

Add your Google Gemini API key:

GOOGLE_GEMINI_KEY=your_api_key_here
PORT=3000
CORS_ORIGIN=http://localhost:5173
  1. Start the application

Terminal 1 - Backend:

cd backend
npm start

Terminal 2 - Frontend:

cd frontend
npm run dev
  1. Open your browser
http://localhost:5173

Tech Stack

Frontend:

  • React 18.3 - UI library
  • Vite - Build tool
  • Framer Motion - Animations
  • Prism.js - Syntax highlighting
  • Axios - HTTP client
  • React Markdown - Review rendering

Backend:

  • Node.js - Runtime
  • Express.js - Web framework
  • Google Gemini AI - AI model
  • CORS - Cross-origin requests
  • dotenv - Environment configuration

🎯 Usage

Basic Review

  1. Paste your code in the left editor
  2. Click "Run AI Review" (or press Ctrl+Enter)
  3. View comprehensive analysis in the right panel

Keyboard Shortcuts

Shortcut Action
Ctrl+Enter Run AI review

πŸ”§ Configuration

Environment Variables

Variable Description Default
PORT Backend server port 3000
GOOGLE_GEMINI_KEY Google Gemini API key Required
CORS_ORIGIN Allowed frontend URL http://localhost:5173

API Limits

Google Gemini Free Tier:

  • 15 requests per minute
  • 1,500 requests per day
  • Optimized prompts to minimize token usage

πŸ“Š API Reference

POST /ai/get-review

Generate AI code review

Request:

{
  "code": "function example() { return true; }"
}

Response:

{
  "review": "## Summary\nQuality: Good\n...",
  "success": true,
  "timestamp": "2026-01-19T12:00:00.000Z",
  "responseTime": "1234ms",
  "codeLength": 42
}

GET /health

Health check endpoint

Response:

{
  "status": "ok",
  "uptime": 123.45,
  "timestamp": "2026-01-19T12:00:00.000Z"
}

πŸ› Troubleshooting

Common Issues

"Cannot connect to server"

  • βœ… Ensure backend is running: npm start
  • βœ… Check if port 3000 is available
  • βœ… Verify CORS_ORIGIN matches frontend URL

"Invalid API key"

  • βœ… Check .env file exists in backend directory
  • βœ… Verify API key has no extra spaces
  • βœ… Get a new key from Google AI Studio

"API quota exceeded"

  • βœ… Wait for quota reset (resets daily)
  • βœ… Check usage at rate limits

🀝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit your changes: git commit -m 'Add amazing feature'
  4. Push to the branch: git push origin feature/amazing-feature
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ‘¨β€πŸ’» Author

Your Name


πŸ™ Acknowledgments


πŸ—ΊοΈ Roadmap

  • Support for more programming languages
  • Review history with local storage
  • Export reviews as PDF/Markdown
  • VS Code extension
  • GitHub integration for PR reviews
  • Team collaboration features

⭐ Show Your Support

Give a ⭐️ if this project helped you!


Built with Love by Farman Ali

About

Professional AI-powered code review platform with real-time analysis

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors