Skip to content

Singh0622/CODErev

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Intelligent Code Review Platform

An AI-powered Flask web application that automates code review by analyzing submitted code snippets and providing insightful feedback, issue detection, and improvement suggestions.


Table of Contents


Features

  • Submit code via a user-friendly web interface with optional repository and file path.
  • Automated AI-powered code analysis with an Agent Orchestrator.
  • View detailed issue reports and code improvement suggestions.
  • RESTful API to submit code, fetch review results, and list past reviews.
  • Asynchronous task management using Redis for scalability.
  • Database handled with SQLAlchemy and Flask-Migrate for smooth migrations.
  • Containerized deployment with Docker and Docker Compose.

Architecture & Workflow

  1. User submits code through the front-end or API.
  2. Flask backend persists the submission in the database.
  3. An analysis task is enqueued to Redis to prevent blocking requests.
  4. Agent Orchestrator asynchronously processes the code using AI methods.
  5. Results, including detected issues and suggestions, are saved back to the database.
  6. Users retrieve and view results via the UI or REST APIs.

Prerequisites

  • Python 3.8 or higher
  • Docker Desktop (optional but recommended)
  • Git (for cloning the repository)

Installation & Setup

Local Setup (Without Docker)

  1. Clone the repository:

  2. Create and activate a virtual environment:

  • Windows (CMD):

    python -m venv venv
    venv\Scripts\activate
    
  • Mac/Linux:

    python3 -m venv venv
    source venv/bin/activate
    
  1. Install dependencies:

pip install -r requirements.txt

  1. Initialize and apply database migrations:

flask db init flask db migrate -m "Initial migration" flask db upgrade


Running the Application

Without Docker

Start the Flask app:

python run.py

Access the web UI at: http://localhost:5000

Using Docker Compose

  1. Ensure Docker Desktop is installed and running.

  2. From the project root, build and start containers:

docker compose up --build

  1. Open http://localhost:5000 in your browser.

API Endpoints

  • GET /api/reviews
    Lists all code reviews.

  • POST /api/submit-code
    Submit code for analysis.
    Example JSON payload: { "repository_url": "https://github.com/user/repo", "file_path": "src/main.py", "code_content": "print('Hello World')" }

  • GET /api/review/<review_id>
    Retrieve detailed results of a specific code review.


Technologies Used

  • Backend: Flask, SQLAlchemy, Flask-Migrate, Redis
  • Frontend: Jinja2 templates, JavaScript fetch API
  • Containerization: Docker, Docker Compose
  • AI Components: Agent Orchestrator for automated code analysis

Contributing

Contributions are welcome! To contribute:

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

Please follow existing code style and write tests for new features.


License

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


Contact

Rahul singh — rahulsinghthakur0622@gmail.com Project Repository: https://github.com/yourusername/CODErev


Thank you for using the CODErev!
Feel free to open issues or contribute improvements.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published