AI-Powered Programming & Database Learning Platform
CodeLens AI is an AI-powered learning platform that helps students master Python programming and SQL through interactive analysis, visualization, and intelligent tutoring.
CodeLens AI combines deterministic program analysis with AI-powered explanations to make programming concepts easier to understand, debug, and explore.
The platform includes two learning environments:
- Python Lab for code analysis, runtime visualization, complexity metrics, fixes, and AI explanations.
- SQL Lab for schema-aware SQL generation, validation, execution, and tutoring.
| Python Lab | SQL Lab |
|---|---|
![]() |
![]() |
- Static Semantic Analysis
- Runtime Visualization
- Complexity Metrics
- AI Code Explanation
- Suggested Code Fixes
- Interactive Learning
- Natural Language β SQL
- Schema-aware SQL Generation
- SQL Validation
- SQL Execution
- AI SQL Tutor
- Dataset Explorer
- Result Visualization
| Layer | Technology |
|---|---|
| Frontend | Next.js 15, TypeScript, Tailwind CSS, React Query, Monaco Editor, React Flow |
| Backend | FastAPI, Pydantic, NetworkX, Python 3.11+ |
| SQL Engine | SemanticSQL, FastAPI, SQLAlchemy, sqlglot |
| AI Runtime | Ollama |
| AI Models | qwen3:4b, llama3.1:8b, qwen2.5:7b |
| Database | SQLite |
CodeLens-AI/
βββ backend/ # Python Lab API, analyzer, runtime, AI explanations
βββ sql_backend/ # SQL Lab API, SQL generation, validation, tutoring
βββ frontend/ # Next.js application
βββ setup.sh # One-time local setup helper
βββ cleanup.sh # Optional helper for freeing occupied local ports
βββ run.sh # Starts local development services
βββ stop.sh # Stops services started by run.sh
βββ status.sh # Shows local service status
βββ README.md
git clone https://github.com/dhruvak99/CodeLens-AI.git
cd CodeLens-AI
chmod +x setup.sh cleanup.sh run.sh stop.sh status.sh
./setup.shStart Ollama in a separate terminal:
ollama serveRun the application:
./cleanup.sh # Optional, frees occupied CodeLens AI ports
./run.shUse cleanup.sh only when ports 3000, 8000, or 8001 are already occupied by stale CodeLens AI processes.
Stop the application:
./stop.shCheck service status:
./status.shOpen the application:
http://localhost:3000
Note: For the best experience, open CodeLens AI in an Incognito/Private browsing window. This avoids browser extension interference and cached editor state that can occasionally affect the Monaco editor.
If you do not want to use the helper scripts, you can manually start each service:
- Backend: create
backend/.venv, install backend dependencies, then run FastAPI on port8000. - SQL Backend: create
sql_backend/.venv, install SQL backend dependencies, then run FastAPI on port8001. - Frontend: run
npm installinsidefrontend/, then start Next.js on port3000.
| Purpose | Model |
|---|---|
| Python code explanations | qwen3:4b |
| SQL generation | llama3.1:8b |
| SQL tutoring explanations | qwen2.5:7b |
- Python Lab
- SQL Lab
- AI SQL Tutor
- Runtime Visualization
- Schema-aware SQL Generation
- User Authentication
- Progress Tracking
- Learning Dashboard
- PostgreSQL Support
- Additional Programming Languages
- Docker Support
- Cloud Deployment
Contributions are welcome. If you want to improve CodeLens AI, open an issue, propose an enhancement, or submit a pull request with a focused change.
This project is licensed under the terms described in the repository LICENSE file.


