How alisadeghi-dev/ai-code-analyzer works
AI Codebase Auditor lets users connect a GitHub repository or upload a ZIP, builds an indexed knowledge base, and produces health reports, prioritized issues, grounded chat, and file-level explanations. The graph preserves these distinct product capabilities and the documented ingestion stages. Arrows are limited to README statements and SOURCE INDEX references or shown calls; several UI and billing subsystems are documented but their internal wiring was not sampled.
Main entry points: github.ts Repository / ZIP intake · vector-store.ts Vector index · pipline.ts Analysis pipeline · storage.ts Project file storage
Components 27
Access & Projects
- Sign-in screens
src/app/(auth)/login/page.tsx - Authentication
src/lib/auth.ts - Project dashboard
src/app/(app)/dashboard/page.tsx - New project
src/app/(app)/projects/new/page.tsx
Repository Ingestion
- Repository / ZIP intake
src/lib/actions/github.ts - GitHub access
src/lib/github.ts - Filter & extract
src/lib/files/extract.ts - Framework detection
src/lib/files/framework.ts - Project file storage
src/lib/files/storage.ts
Analysis & Reports
- Analysis pipeline
src/lib/analysis/pipline.ts - Code parsing & chunking
src/lib/analysis/chunking.ts - Local embeddings
src/lib/analysis/embeddings.ts - Vector index
src/lib/analysis/vector-store.ts - Health report
src/lib/analysis/report.ts - Issues & roadmap
src/app/(app)/projects/[id]/issues/page.tsx
Chat & Explorer
- Grounded chat API
src/app/api/chat/route.ts - Chat retrieval
src/lib/analysis/chat-rag.ts - Code explorer
src/lib/files/explorer.ts - File explanations
src/app/api/explorer/explain/route.ts - Groq language model
src/lib/ai/llm.ts
Account & Billing
- Account settings
src/app/(app)/settings/page.tsx - Plans & entitlements
src/lib/billing/entitlements.ts - Stripe billing
src/lib/billing/stripe.ts
Other components
- Developer
- PostgreSQL / pgvector
- GitHub
- Stripe
Connections 39
- Developer → Sign-in screens: signs in
- Sign-in screens → Authentication: authenticates
- Authentication → PostgreSQL / pgvector: reads / writes
src/lib/auth.ts - Developer → Project dashboard: manages projects
- Project dashboard → PostgreSQL / pgvector: reads projects
src/app/(app)/dashboard/page.tsx - Developer → New project: starts analysis
- New project → Repository / ZIP intake: submits source
- Repository / ZIP intake → GitHub access: fetches repository
src/lib/actions/github.ts - GitHub access → GitHub: reads repository
- Repository / ZIP intake → Filter & extract: extracts files
src/lib/actions/github.ts - Repository / ZIP intake → Framework detection: detects framework
src/lib/actions/github.ts - Repository / ZIP intake → Project file storage: persists files
src/lib/actions/github.ts - Filter & extract → Project file storage: stores extracted files
src/lib/files/storage.ts - Project file storage → PostgreSQL / pgvector: stores files
- Developer → Analysis pipeline: requests analysis
- Analysis pipeline → Code parsing & chunking: chunks source
src/lib/analysis/pipline.ts - Analysis pipeline → Vector index: indexes chunks
src/lib/analysis/pipline.ts - Vector index → Code parsing & chunking: uses chunking
src/lib/analysis/vector-store.ts - Vector index → Local embeddings: embeds content
src/lib/analysis/vector-store.ts - Vector index → PostgreSQL / pgvector: stores vectors
src/lib/analysis/vector-store.ts - Analysis pipeline → Health report: generates report
src/lib/analysis/pipline.ts - Health report → Groq language model: requests analysis
- Health report → PostgreSQL / pgvector: persists findings
- Developer → Issues & roadmap: reviews findings
- Developer → Grounded chat API: asks question
- Grounded chat API → Chat retrieval: retrieves context
src/app/api/chat/route.ts - Chat retrieval → Local embeddings: embeds query
src/lib/analysis/chat-rag.ts - Chat retrieval → Vector index: searches chunks
src/lib/analysis/chat-rag.ts - Grounded chat API → Groq language model: streams answer
src/app/api/chat/route.ts - Developer → Code explorer: browses files
- Code explorer → Project file storage: reads project files
src/lib/files/explorer.ts - Developer → File explanations: asks about file
- File explanations → Code explorer: reads selected file
src/app/api/explorer/explain/route.ts - File explanations → Groq language model: generates explanation
src/app/api/explorer/explain/route.ts - Developer → Account settings: manages account
- Account settings → Plans & entitlements: loads plan limits
src/app/(app)/settings/page.tsx - Plans & entitlements → PostgreSQL / pgvector: reads account state
src/lib/billing/entitlements.ts - Account settings → Stripe billing: manages subscription
- Stripe billing → Stripe: synchronizes billing