How likhith816/generative-ai-code-assistant works
This is a React code-analysis assistant: a developer enters or uploads code, requests analysis, and views generated analysis, documentation, README sections, tests, and Q&A in tabbed results. App.tsx owns analysis and follow-up requests; the Gemini service uses Gemini when configured and provides mock responses otherwise. The README also advertises code generation and live preview, but the inspected runtime excerpts do not show those workflows, so they are not represented as implemented components.
Main entry points: ResultsDisplay.tsx Results tabs · App.tsx App state · geminiService.ts AI service · CodeInput.tsx Code editor
Components 12
Code input
- Code editor
components/CodeInput.tsx
Request orchestration
- App state
App.tsx - Result contracts
types.ts
AI analysis
- AI service
services/geminiService.ts - Gemini API
Results and insights
- Results tabs
components/ResultsDisplay.tsx - Code analysis
components/AnalysisTab.tsx - Documentation
components/DocumentationTab.tsx - README sections
components/ReadmeTab.tsx - Generated tests
components/TestsTab.tsx - Follow-up Q&A
components/QATab.tsx
Other components
- Developer
Connections 15
- Developer → Code editor: enters code
components/CodeInput.tsx - Code editor → App state: submits code
App.tsx - App state → AI service: requests analysis
App.tsx - AI service → Gemini API: generates response
services/geminiService.ts - AI service → Result contracts: returns typed result
services/geminiService.ts - App state → Result contracts: stores result
App.tsx - App state → Results tabs: passes results
App.tsx - Results tabs → Code analysis: renders analysis
components/ResultsDisplay.tsx - Results tabs → Documentation: renders docs
components/ResultsDisplay.tsx - Results tabs → README sections: renders README
components/ResultsDisplay.tsx - Results tabs → Generated tests: renders tests
components/ResultsDisplay.tsx - Results tabs → Follow-up Q&A: renders Q&A
components/ResultsDisplay.tsx - Follow-up Q&A → App state: submits question
components/QATab.tsx - App state → AI service: requests follow-up
App.tsx - AI service → Gemini API: generates answer
services/geminiService.ts