How abuzargabol/code-debug-ai-agent works
This is a small Flask code-fixing web app. A user opens the page, logs in, submits code, and receives a formatted diagnosis, corrected code, and explanation from OpenRouter or, if that fails, a local Ollama model. Successful answers are saved to and served from a JSON history file. The HTML is served by Flask; its client-side request behavior is not shown, so that connection is documented only at the route level. The graph reflects the single sampled runtime file.
Main entry points: APP.py Code submission · index.html Web page · history.json History JSON
Components 11
Web interface
- Flask app and routes
APP.py - Web page
index.html
Code-fixing workflow
- Login session
APP.py - Code submission
APP.py - Fix prompt
APP.py - OpenRouter model
- Local Ollama model
- Formatted answer
APP.py
Chat history
- History JSON
history.json - History endpoint
APP.py
Other components
- User
Connections 14
- User → Web page: opens
- Flask app and routes → Web page: serves
APP.py - User → Login session: logs in
APP.py - Login session → Flask app and routes: sets session
APP.py - User → Code submission: submits code
APP.py - Code submission → Fix prompt: formats
APP.py - Code submission → OpenRouter model: requests answer
APP.py - Code submission → Local Ollama model: fallback request
APP.py - OpenRouter model → Formatted answer: returns text
APP.py - Local Ollama model → Formatted answer: returns text
APP.py - Code submission → History JSON: saves answer
APP.py - User → History endpoint: requests history
APP.py - History endpoint → History JSON: reads
APP.py - Code submission → User: returns answer
APP.py