An AI-powered Flask web application that automates code review by analyzing submitted code snippets and providing insightful feedback, issue detection, and improvement suggestions.
- Features
- Architecture & Workflow
- Prerequisites
- Installation & Setup
- Running the Application
- API Endpoints
- Technologies Used
- Contributing
- License
- Contact
- 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.
- User submits code through the front-end or API.
- Flask backend persists the submission in the database.
- An analysis task is enqueued to Redis to prevent blocking requests.
- Agent Orchestrator asynchronously processes the code using AI methods.
- Results, including detected issues and suggestions, are saved back to the database.
- Users retrieve and view results via the UI or REST APIs.
- Python 3.8 or higher
- Docker Desktop (optional but recommended)
- Git (for cloning the repository)
-
Clone the repository:
-
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
- Install dependencies:
pip install -r requirements.txt
- Initialize and apply database migrations:
flask db init flask db migrate -m "Initial migration" flask db upgrade
Start the Flask app:
python run.py
Access the web UI at: http://localhost:5000
-
Ensure Docker Desktop is installed and running.
-
From the project root, build and start containers:
docker compose up --build
- Open http://localhost:5000 in your browser.
-
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.
- Backend: Flask, SQLAlchemy, Flask-Migrate, Redis
- Frontend: Jinja2 templates, JavaScript fetch API
- Containerization: Docker, Docker Compose
- AI Components: Agent Orchestrator for automated code analysis
Contributions are welcome! To contribute:
- Fork the repository.
- Create a feature branch:
git checkout -b feature/your-feature - Commit your changes:
git commit -m 'Add some feature' - Push to your branch:
git push origin feature/your-feature - Create a Pull Request on GitHub.
Please follow existing code style and write tests for new features.
This project is licensed under the MIT License. See the LICENSE file for details.
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.