How ahsan-raza-sheikh/ai-based-code-reviewer works
Project type and purpose
• This is a hybrid full-stack project composed of a VS Code extension (written in TypeScript/JavaScript) that provides AI-powered code-review capabilities, plus a standalone Python backend (FastAPI) that interfaces with Google Gemini.
• The extension invokes commands (review, refactor, documentation, real-time analysis) via the VS Code API and sends requests to the backend, which runs machine-learning logic and returns diagnostics, fixes, or documentation.
File structure
• Top level:
• package.json / tsconfig.json → VS Code extension manifest & TS config
• requirements.txt / backend/ → Python VirtualEnv + FastAPI service
• src/ → extension source (commands/, core/, providers/, services/, utils/)
• backend/api/server.py → FastAPI application entrypoint
• backend/services/analyzer.py → AI analysis logic
• test/ → integration & fixture tests
• Patterns:
• “commands → core → services → providers” reflects a command pattern layered atop a service layer, with language providers hooking into VS Code’s Diagnostic and CodeAction APIs.
• Backend is structured with clear separation: API endpoints vs. business logic vs. utility helpers.
README insights
• It describes two major sub-systems: the “Frontend VS Code Extension” and the “Python AI Backend.”
• Lists features (real-time analysis, auto-fix, refactor, docs generation, security, performance) driven by Google Gemini.
• Mentions configuration (API key, server URL) and dev workflows (npm scripts, uvicorn).