Skip to content

About

AI-powered code review and remediation platform that analyzes source code for bugs, security risks, performance issues, and maintainability problems. Built with React, Monaco Editor, FastAPI, Gemini, and Groq, featuring structured reviews, quality scoring, repository intelligence, and AI-generated fixes.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

13 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AI Code Enhancer

AI-powered repository intelligence, code review, and automated remediation platform.

AI Code Enhancer combines deterministic static analysis with LLM-powered code review to analyze source repositories, identify bugs, security vulnerabilities, performance problems, maintainability issues, and code-quality concerns β€” and generate targeted fixes that can be reviewed through an interactive diff workflow.

The project is built with a React + Monaco Editor frontend and a FastAPI backend, with support for Google Gemini and Groq as the AI providers.


✨ What It Does

AI Code Enhancer goes beyond sending individual code snippets to an LLM.

It analyzes a repository through multiple layers:

                    Source Repository
                           β”‚
                           β–Ό
                 Repository Analysis
                           β”‚
             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
             β–Ό             β–Ό             β–Ό
        Static Analysis  Dependency   Architecture
                         Analysis       Analysis
             β”‚             β”‚             β”‚
             β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β–Ό
                    AI Code Review
                    Gemini / Groq
                           β”‚
                           β–Ό
                 Finding Normalization
                           β”‚
                           β–Ό
                    Quality Scoring
                           β”‚
                           β–Ό
                 Review Findings
                           β”‚
                           β–Ό
                  AI Remediation
                           β”‚
                           β–Ό
                     Unified Diff
                           β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”
                    β–Ό             β–Ό
                  Review        Apply

This creates a hybrid analysis workflow where deterministic tooling provides objective signals while AI provides higher-level reasoning and remediation.


πŸš€ Features

πŸ” AI-Powered Code Review

Analyze source code using LLM-powered review to identify:

  • πŸ› Potential bugs
  • πŸ” Security vulnerabilities
  • ⚑ Performance problems
  • 🧹 Maintainability issues
  • 🎨 Code-quality and style problems
  • ⚠️ Severity-ranked findings
  • πŸ“ Line-level findings
  • πŸ’‘ Improvement recommendations

πŸ€– Multi-Provider AI Engine

The project currently supports two LLM providers:

Google Gemini

Used for high-quality code analysis and remediation.

Groq

Provides an alternative high-speed inference path for AI-powered analysis.

The application uses a provider abstraction so the rest of the analysis pipeline does not need to depend directly on a specific LLM provider.

                 AI Review Engine
                       β”‚
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”
              β–Ό                 β–Ό
           Gemini              Groq

Only these two providers are intentionally supported in the current version.


πŸ§ͺ Hybrid Static + AI Analysis

AI Code Enhancer combines deterministic tooling with AI analysis.

Static analysis helps identify issues that can be detected reliably by dedicated tools, while the LLM provides contextual reasoning and higher-level recommendations.

Source Code
    β”‚
    β”œβ”€β”€β–Ί Static Analysis
    β”‚       β”œβ”€β”€ Ruff
    β”‚       β”œβ”€β”€ Bandit
    β”‚       └── JavaScript / TypeScript analysis
    β”‚
    └──► AI Analysis
            β”œβ”€β”€ Gemini
            └── Groq

                 ↓

          Finding Aggregation
                 ↓
          Finding Normalization
                 ↓
            Quality Score

This reduces dependence on a single analysis technique.


πŸ“¦ Repository Analysis

The application can work with multi-file repositories rather than only isolated code snippets.

Repository analysis provides information about:

  • Source files
  • Directory structure
  • File relationships
  • Supported source types
  • Repository-level findings

This allows the AI review process to reason about code in a broader project context.


πŸ”— Dependency Analysis

The project analyzes relationships between source files and their dependencies.

This helps identify:

  • Import relationships
  • Module dependencies
  • Dependency structure
  • Potential dependency-related problems

πŸ—οΈ Architecture Analysis

AI Code Enhancer can analyze the structural relationships within a repository.

The architecture analysis can identify:

  • File-to-file relationships
  • Import graphs
  • Dependency structure
  • Circular dependencies
  • Architectural relationships

The frontend presents this information in an interactive repository-analysis workflow.


πŸ“Š Code Quality Scoring

The project aggregates analysis results into an overall quality assessment.

The scoring system considers areas such as:

  • Overall quality
  • Security
  • Performance
  • Maintainability
  • Reliability
  • Style

Example:

CODE QUALITY

Overall          78 / 100
Security         91
Performance      67
Maintainability  74
Reliability      71
Style            86

The score provides a quick high-level view while the individual findings provide the detailed reasoning behind it.


πŸ”§ AI-Powered Remediation

Detected issues can be passed back to the AI engine to generate targeted remediation.

Instead of blindly replacing an entire source file, the application provides an interactive workflow:

Finding
   ↓
Generate AI Fix
   ↓
Proposed Changes
   ↓
Unified Diff
   ↓
Review
   ↓
Apply / Reject

This makes AI-generated modifications easier to inspect before applying them.


πŸ“ Monaco Editor

The frontend uses Monaco Editor to provide a development-environment-style editing experience.

It supports:

  • Source-code viewing
  • Code editing
  • Finding navigation
  • Line-level issue inspection
  • Diff visualization
  • Proposed fix review

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              React Frontend               β”‚
β”‚                                           β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚ File / Repoβ”‚  β”‚   Monaco Editor    β”‚  β”‚
β”‚  β”‚   Upload   β”‚  β”‚   + Diff Viewer    β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β”‚         β”‚                   β”‚             β”‚
β”‚         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β”‚ HTTP
                     β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              FastAPI Backend              β”‚
β”‚                                           β”‚
β”‚  Repository Analysis                      β”‚
β”‚  Dependency Analysis                      β”‚
β”‚  Architecture Analysis                   β”‚
β”‚  Static Analysis                          β”‚
β”‚  AI Review                                β”‚
β”‚  Quality Scoring                           β”‚
β”‚  Remediation                              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β”‚
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β–Ό                     β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Static Analysis  β”‚   β”‚   AI Providers   β”‚
β”‚                  β”‚   β”‚                  β”‚
β”‚ Ruff             β”‚   β”‚ Google Gemini    β”‚
β”‚ Bandit           β”‚   β”‚ Groq             β”‚
β”‚ JS/TS Analysis   β”‚   β”‚                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
         β”‚                      β”‚
         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                    β–Ό
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚ Finding Aggregator β”‚
          β”‚ + Normalization    β”‚
          β”‚ + Quality Scoring  β”‚
          β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                     β”‚
                     β–Ό
             Review Findings
                     β”‚
                     β–Ό
              AI Remediation
                     β”‚
                     β–Ό
                Unified Diff

πŸ› οΈ Tech Stack

Frontend

  • React
  • Monaco Editor
  • Axios
  • Tailwind CSS
  • JavaScript

Backend

  • Python
  • FastAPI
  • Pydantic
  • Uvicorn
  • Static analysis tooling
  • Repository analysis utilities

AI

  • Google Gemini
  • Groq

Analysis

  • Ruff
  • Bandit
  • JavaScript / TypeScript analysis
  • Dependency analysis
  • Architecture analysis
  • Custom finding normalization
  • Quality scoring

πŸ“‚ Project Structure

AI_Code_Enhancer/
β”‚
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ ai/
β”‚   β”‚   β”œβ”€β”€ analyzers/
β”‚   β”‚   β”œβ”€β”€ ...
β”‚   β”‚
β”‚   β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€ main.py
β”‚   β”œβ”€β”€ config.py
β”‚   β”œβ”€β”€ requirements.txt
β”‚   └── ...
β”‚
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ ...
β”‚   β”‚   └── App.js
β”‚   β”œβ”€β”€ package.json
β”‚   └── package-lock.json
β”‚
β”œβ”€β”€ .env.example
β”œβ”€β”€ .gitignore
└── README.md

The exact internal module structure may evolve as the project develops.


βš™οΈ Installation

Prerequisites

Make sure the following are installed:

  • Python 3.10+
  • Node.js
  • npm
  • A Google Gemini API key
  • A Groq API key

1. Clone the Repository

git clone https://github.com/arjungupt771/AI_Code_Enhancer.git
cd AI_Code_Enhancer

2. Backend Setup

Create and activate a virtual environment:

cd backend

python -m venv .venv

Linux / macOS

source .venv/bin/activate

Windows

.venv\Scripts\activate

Install backend dependencies:

pip install -r requirements.txt

3. Configure Environment Variables

Return to the project root:

cd ..

Create the local environment file:

cp .env.example .env

On Windows, you can also create .env manually from .env.example.

Configure your API credentials:

GEMINI_API_KEY=your_gemini_api_key_here
GROQ_API_KEY=your_groq_api_key_here

Configure the models according to the environment variables supported by the backend.

Example:

GEMINI_MODEL=gemini-2.5-flash
GROQ_MODEL=openai/gpt-oss-120b

Never commit .env or real API keys to GitHub.


4. Start the Backend

From the project root:

cd backend
uvicorn main:app --reload --host 127.0.0.1 --port 8000

The backend will be available at:

http://127.0.0.1:8000

FastAPI's interactive documentation is available at:

http://127.0.0.1:8000/docs

5. Start the Frontend

Open another terminal:

cd frontend
npm install
npm start

The frontend will normally be available at:

http://localhost:3000

If the frontend supports a configurable backend URL, configure it through the frontend environment file.

Example:

REACT_APP_API_BASE_URL=http://127.0.0.1:8000

πŸ”„ Application Workflow

A typical repository review follows this process:

1. Upload Repository
        ↓
2. Repository Structure Analysis
        ↓
3. Dependency Analysis
        ↓
4. Architecture Analysis
        ↓
5. Static Analysis
        ↓
6. AI Review
   β”Œβ”€β”€β”€β”€β”΄β”€β”€β”€β”€β”
   β–Ό         β–Ό
Gemini      Groq
   β””β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”˜
        ↓
7. Finding Normalization
        ↓
8. Quality Scoring
        ↓
9. Review Findings
        ↓
10. Generate AI Fix
        ↓
11. Review Unified Diff
        ↓
12. Apply or Reject Changes

πŸ“‘ API

The backend exposes API endpoints for application health, code review, remediation, and supporting analysis workflows.

GET /health

Checks whether the backend is running.

Example:

curl http://127.0.0.1:8000/health

POST /review-code

Reviews uploaded source code and returns structured findings.

The review workflow can incorporate:

  • Static analysis
  • AI analysis
  • Finding normalization
  • Severity classification
  • Quality scoring

The selected AI provider/model is used for the AI portion of the review.


POST /fix-code

Generates a proposed remediation based on source code and detected findings.

The resulting changes can be reviewed through the frontend's diff workflow before being applied.

API request/response schemas may evolve as the project continues to be refined. The FastAPI documentation at /docs is the authoritative local API reference.


πŸ§ͺ Testing

Backend tests are located under:

backend/tests/

Run the backend test suite with:

PYTHONPATH=. pytest backend/tests -q

You can also perform a Python compilation check:

python -m compileall -q backend

For the frontend:

cd frontend
npm run test:ci

Build verification:

npm run build

Before making a release/final push, verify both the backend test suite and frontend build successfully.


πŸ” Security

AI Code Enhancer uses environment variables for sensitive configuration.

Never commit:

.env

or actual API credentials.

The repository should also exclude local development artifacts such as:

.venv/
node_modules/
__pycache__/
.pytest_cache/
*.db
build/
dist/

API keys should only exist in the local environment or an appropriate secret-management system.


🎯 Current Project Scope

The current version focuses on local repository analysis and AI-assisted code review.

The project intentionally prioritizes:

  • Code quality
  • Repository intelligence
  • Static analysis
  • AI reasoning
  • Gemini + Groq integration
  • Quality scoring
  • AI remediation
  • Interactive review
  • Clean project architecture
  • Portfolio-quality implementation

The project is not currently focused on deployment infrastructure or production CI/CD integration.


πŸ—ΊοΈ Development Status

The original development roadmap has now been consolidated into the current implementation.

βœ… Completed

  • Repository cleanup and project stabilization
  • Environment-based configuration
  • FastAPI backend
  • React frontend
  • Monaco Editor integration
  • Multi-file code analysis
  • Static analysis integration
  • Structured AI responses
  • Gemini integration
  • Groq integration
  • Repository analysis
  • Dependency analysis
  • Architecture analysis
  • Finding normalization
  • Code-quality scoring
  • AI-powered remediation
  • Unified diff workflow
  • Interactive review/apply workflow
  • Backend test coverage
  • Frontend integration

πŸ”„ Future Improvements

Potential future improvements may include:

  • More advanced language-specific analyzers
  • Improved architecture visualization
  • More sophisticated remediation validation
  • Expanded test coverage
  • Additional repository-level intelligence
  • Improved review UX
  • Performance optimization for large repositories

These are optional improvements rather than required components of the current project.


πŸ“ˆ Why This Project?

Traditional static analysis tools are effective at detecting deterministic problems, while LLMs are capable of understanding broader context and suggesting higher-level improvements.

AI Code Enhancer combines both approaches:

             Static Analysis
                    β”‚
                    β”‚ Deterministic Findings
                    β”‚
                    β–Ό
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚           β”‚
              β”‚ Aggregatorβ”‚
              β”‚           β”‚
              β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜
                    β”‚
                    β”‚
              AI Analysis
                    β”‚
                    β”‚ Contextual Reasoning
                    β–Ό
              Unified Review
                    β”‚
                    β–Ό
              Quality Score
                    β”‚
                    β–Ό
             AI Remediation

The result is a more comprehensive development workflow than either static analysis or an isolated AI code-review prompt alone.


🀝 Contributing

Contributions and improvements are welcome.

When contributing:

  1. Keep changes focused.
  2. Add tests for new functionality.
  3. Avoid committing secrets.
  4. Keep frontend/backend API contracts synchronized.
  5. Document significant architectural changes.
  6. Preserve the existing provider abstraction.
  7. Verify the project locally before submitting changes.

πŸ“„ License

This project is currently maintained as an AI engineering portfolio project.


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

Arjun Gupta

GitHub:
https://github.com/arjungupt771

Repository:
https://github.com/arjungupt771/AI_Code_Enhancer

About

AI-powered code review and remediation platform that analyzes source code for bugs, security risks, performance issues, and maintainability problems. Built with React, Monaco Editor, FastAPI, Gemini, and Groq, featuring structured reviews, quality scoring, repository intelligence, and AI-generated fixes.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages