An intelligent tool for automated error detection, correction, and pattern learning in code, helping developers identify and fix bugs, learn from common patterns, and improve code quality.
Check out the live application at: AI Code Healer
- Real-time code analysis and error detection
- Support for multiple programming languages (Python, JavaScript, TypeScript, C/C++)
- Interactive web interface with syntax highlighting
- AI-powered code fixing suggestions
- Secure and scalable deployment on Heroku
- Modern, responsive UI with Bootstrap
- Python
- HTML/CSS
- JavaScript
- Django
- LangGraph
- Bootstrap 5
- Crispy Forms
- WhiteNoise
- LLM
- Heroku
- Conda
- Clone the repository:
git clone https://github.com/yourusername/AI-code-healer.git
cd AI-code-healer- Set up the conda environment:
conda create -n langgraph python=3.9.21
conda activate langgraph- Install Python dependencies:
pip install -r requirements.txt- Run migrations:
python manage.py migrate- Collect static files:
python manage.py collectstatic --noinput- Start the development server:
python manage.py runserver- Access the web interface at http://localhost:8000
- Open the web interface
- Select your programming language from the dropdown
- Input your code in the editor
- Click "Execute" to run the code
- View the analysis results and suggested fixes
- Apply the fixes or explore alternative solutions
The application is deployed on Heroku with the following configuration:
- Python 3.9.21 runtime
- WhiteNoise for static file serving
- Environment variables for security
- Automatic static file collection
- SSL/TLS enabled
To deploy to Heroku:
- Create a Heroku account and install the Heroku CLI
- Login to Heroku:
heroku login- Create a new Heroku app:
heroku create your-app-name- Set environment variables:
heroku config:set DJANGO_SECRET_KEY=your-secret-key
heroku config:set DJANGO_DEBUG=False- Deploy the application:
git push heroku main- Automated error detection and correction
- Pattern-based learning using vector databases
- Semantic code understanding and analysis
- Context-aware bug fixing
Currently supports:
- Python
- JavaScript/TypeScript
- C/C++
Each language is supported through:
- Language-specific syntax highlighting
- Custom execution environments
- Language-specific error handling
- Vector-based pattern storage and retrieval
- Similar bug detection across projects
- Historical fix tracking
- Pattern-based solution suggestions
- Runtime safety checks
- Code modification verification
- Test coverage analysis
- Security vulnerability detection
- Modern, responsive UI
- Real-time code editing with syntax highlighting
- Interactive error visualization
- Solution history tracking
- Language selection dropdown
AI-code-healer/
├── AI_code_healer/ # Django project settings
├── web/ # Django application
│ ├── templates/ # HTML templates
│ ├── migrations/ # Database migrations
│ ├── views.py # View logic and language execution
│ ├── urls.py # URL routing
│ └── models.py # Data models
├── src/ # Core functionality
│ ├── core/ # Core implementation
│ │ ├── build.py # Build process
│ │ ├── graph.py # Graph-based workflow
│ │ └── state.py # State management
│ ├── healer.py # Main healing logic
│ ├── config.py # Configuration
│ └── test_healer.py # Test suite
├── static/ # Static files (CSS, JS)
├── manage.py # Django management
└── requirements.txt # Dependencies
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
- GenAI_Agents - Repository that provided comprehensive tutorials and implementations for building AI agents