AI Developer Assistant is an open-source tool that helps developers understand code, detect bugs, and get plain-English explanations. It uses a rule-based engine for fast analysis and optionally connects to an LLM (like OpenAI or Groq) for deeper insights.
flowchart TD
A[User - Browser] -->|Pastes code + clicks Analyze| B[Vanilla JS Frontend\nindex.html]
B -->|HTTP POST /analyze/| C[FastAPI Backend\nPort 8000]
C --> D{Analysis Mode}
D -->|Rule-based| E[Rule Engine\ncode_assistant.py\n40+ patterns · 5 languages]
D -->|LLM mode| F[AI Provider Layer\nai_provider.py]
F --> G[OpenAI / Groq / Ollama]
E --> H[Response JSON]
G --> H
H -->|Returns results| B
C <--> I[PostgreSQL Database\nAuth · Share links · History]
C --> J[Docker / Render\nDeployment]
- User pastes code into the editor in the browser
- Frontend sends a
POSTrequest to/analyze/on the FastAPI backend - Backend decides: use rule-based engine or LLM based on config
- Result is returned as JSON and rendered in the UI
- File:
frontend/index.html - Plain HTML + Vanilla JavaScript (no framework)
- Sends code to backend via
fetch()API - Renders results: Plain-English breakdown, suggestions, code fixes
- File:
main.py - Runs on port
8000 - Handles routing, auth middleware, and API responses
- Connects frontend to the analysis engine and database
- File:
code_assistant.py - 40+ pattern rules across 5 languages (Python, JS, TS, Java, C++)
- Fast, offline, no API key needed
- Detects common bugs, anti-patterns, and style issues
- File:
ai_provider.py - Optional — only used when an API key is configured
- Supports OpenAI, Groq, and Ollama
- Provides deeper analysis and natural language explanations
- Technology: PostgreSQL
- Stores user auth, share links, and analysis history
- Used only when auth/sharing features are enabled
- Supports Docker (via
Dockerfile) - Also deployable on Render (cloud hosting)
| File | Purpose |
|---|---|
main.py |
FastAPI app entry point |
code_assistant.py |
Rule-based analysis engine |
ai_provider.py |
LLM provider abstraction |
frontend/index.html |
Entire frontend UI |
requirements.txt |
Python dependencies |
Dockerfile |
Container setup |
README.md |
Setup and usage guide |
| Rule-Based | LLM Mode | |
|---|---|---|
| Speed | Fast | Slower |
| Requires API key | No | Yes |
| Works offline | Yes | No |
| Analysis depth | Pattern matching | Deep reasoning |
| Languages supported | 5 | Any |
New to the project? Start here:
- Read
README.mdfor setup instructions - Look at
code_assistant.pyto understand how rules work - Check open issues labeled
good first issue - See
CONTRIBUTING.mdfor PR guidelines