π Code Intel
AI-Powered Codebase Analysis Platform
Understand any codebase in seconds, not hours
Live Demo β’ Features β’ Quick Start β’ Documentation
π― What is Code Intel?
Code Intel is an intelligent code analysis platform that combines static analysis, AST parsing, and LLM reasoning to help developers understand complex codebases, identify issues, and improve code qualityβall in real-time.
Simply connect your GitHub repository and get:
- π Deep code analysis - Security vulnerabilities, performance bottlenecks, anti-patterns
- π Circular dependency detection - Using graph traversal algorithms
- π Code duplication tracking - With exact file/line referβ¦
π Code Intel
AI-Powered Codebase Analysis Platform
Understand any codebase in seconds, not hours
Live Demo β’ Features β’ Quick Start β’ Documentation
π― What is Code Intel?
Code Intel is an intelligent code analysis platform that combines static analysis, AST parsing, and LLM reasoning to help developers understand complex codebases, identify issues, and improve code qualityβall in real-time.
Simply connect your GitHub repository and get:
- π Deep code analysis - Security vulnerabilities, performance bottlenecks, anti-patterns
- π Circular dependency detection - Using graph traversal algorithms
- π Code duplication tracking - With exact file/line references
- π€ AI-powered insights - Context-aware recommendations from specialized agents
- β‘ Real-time results - Stream analysis progress via WebSocket
β¨ Features
π GitHub Integration
One-click repository scanning directly from GitHub URLs. No manual uploads needed.
π§ Multi-Agent Analysis
Specialized AI agents analyze different aspects:
- Security Agent - Identifies vulnerabilities and security risks
- Performance Agent - Detects bottlenecks and optimization opportunities
- Architecture Agent - Reviews code structure and design patterns
π¨ AST-Based Code Understanding
Parse and analyze code structure using Abstract Syntax Trees to identify:
- Code patterns and anti-patterns
- Duplicate code blocks with exact references
- Structural issues and complexity hotspots
π RAG Pipeline
Vector embeddings (ChromaDB) combined with traditional static analysis for context-aware insights that understand your entire codebase.
π― Graph Analysis
Directed graph traversal to detect circular dependencies and visualize module relationships.
πΎ Export Results
Download comprehensive analysis reports as JSON for further processing or sharing.
π οΈ Tech Stack
Backend:
- FastAPI (Python) - High-performance async API
- LangChain - Multi-agent orchestration
- ChromaDB - Vector database for embeddings
- OpenAI GPT-4 - LLM reasoning
Frontend:
- React 18 - Modern UI framework
- WebSocket - Real-time progress updates
- Glassmorphism UI - Beautiful, responsive design
Infrastructure:
- PostgreSQL - Data persistence
- GitHub API - Repository integration
- Vercel - Deployment
π Quick Start
Prerequisites
- Python 3.11+
- Node.js 18+
- OpenAI API key (Get one here)
- GitHub OAuth App (Setup guide)
1. Clone the Repository
git clone https://github.com/yourusername/code-intel.git
cd code-intel
2. Backend Setup
# Install Python dependencies
pip install -r requirements.txt
# Copy environment template
cp .env.example .env
# Edit .env and add your credentials
nano .env
Required environment variables:
# OpenAI API Key
OPENAI_API_KEY=sk-your-key-here
# GitHub OAuth (see setup guide below)
GITHUB_CLIENT_ID=your-client-id
GITHUB_CLIENT_SECRET=your-client-secret
# Server URLs (for local development)
BACKEND_URL=http://localhost:8000
FRONTEND_URL=http://localhost:3000
# Vector DB
VECTOR_DB_PATH=./chroma_db
EMBEDDING_MODEL=all-MiniLM-L6-v2
3. Frontend Setup
# Navigate to web directory
cd web
# Install dependencies
npm install
# Start development server
npm start
4. Start the Backend
# From project root
python api.py
5. Access the App
Open http://localhost:3000 in your browser π
π GitHub OAuth Setup
To enable GitHub repository scanning, you need to create a GitHub OAuth App:
Step 1: Create OAuth App
- Go to GitHub Developer Settings
- Click βNew OAuth Appβ
- Fill in the details:
- Application name:
Code Intel (Local Dev) - Homepage URL:
http://localhost:3000 - Authorization callback URL:
http://localhost:8000/auth/github/callback
- Click βRegister applicationβ
Step 2: Get Credentials
- Copy your Client ID
- Click βGenerate a new client secretβ and copy it
- Add both to your
.envfile:
GITHUB_CLIENT_ID=your_client_id_here
GITHUB_CLIENT_SECRET=your_client_secret_here
Step 3: Restart Backend
# Kill the running server and restart
python api.py
β GitHub integration is now ready!
π Usage
Analyze a Repository
- Enter Repository URL
https://github.com/username/repository
Configure Analysis (optional)
- Branch:
main(default) - File patterns:
*.py, *.js, *.ts(customize as needed)
Start Analysis
- Click βAnalyze Repositoryβ
- Watch real-time progress via WebSocket
- View results in interactive file explorer
Review Results
- Expandable file tree showing all issues
- Detailed descriptions with severity levels
- Code snippets with exact line references
- Export as JSON for further analysis
Example Repositories to Try
| Repository | Language | Complexity |
|---|---|---|
pallets/flask | Python | Medium |
django/django | Python | High |
fastapi/fastapi | Python | Medium |
facebook/react | JavaScript | High |
ποΈ Architecture
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Code Intel β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββΌββββββββββββββββ
β β β
ββββββΌβββββ ββββββΌβββββ ββββββΌβββββ
β React β β FastAPI β β GitHub β
β Web βββββΊβ API βββββΊβ API β
β (3000) β WS β (8000) β β β
βββββββββββ ββββββ¬βββββ βββββββββββ
β
ββββββββββββββββΌβββββββββββββββ
β β β
ββββββΌβββββ ββββββΌβββββ ββββββΌβββββ
β OpenAI β β ChromaDBβ β AST β
β API β β Vector β β Parser β
β (GPT4) β β DB β β β
βββββββββββ βββββββββββ βββββββββββ
Analysis Pipeline
- Repository Cloning - Clone GitHub repo to temp directory
- File Discovery - Identify relevant files based on patterns
- AST Parsing - Parse code structure and extract metadata
- Vector Embedding - Generate embeddings and store in ChromaDB
- Static Analysis - Run traditional linters and analyzers
- Graph Analysis - Build dependency graph and detect cycles
- LLM Reasoning - Multi-agent analysis with GPT-4
- Results Synthesis - Combine insights and generate report
π¨ API Endpoints
Analysis
POST /github/analyze- Start repository analysis
{
"repo_url": "https://github.com/user/repo",
"branch": "main",
"file_patterns": ["*.py"]
}
Status & Results
GET /github/status/{job_id}- Check analysis statusGET /github/results/{job_id}- Get analysis resultsWS /ws/progress/{job_id}- Real-time progress updates
Authentication
GET /auth/github- Initiate GitHub OAuth flowGET /auth/github/callback- OAuth callback handler
π Troubleshooting
Common Issues
βGitHub OAuth not workingβ
- Verify
GITHUB_CLIENT_IDandGITHUB_CLIENT_SECRETare set correctly - Check callback URL matches:
http://localhost:8000/auth/github/callback - Make sure backend is running on port 8000
βOpenAI API errorsβ
- Verify your
OPENAI_API_KEYis valid - Check you have API credits remaining
- Ensure youβre using GPT-4 compatible key
βWebSocket connection failedβ
- Backend must be running on port 8000
- Check CORS settings in
api.py - Verify
FRONTEND_URLis set tohttp://localhost:3000
βAnalysis stuck at X%β
- Large repos take time (5-10 minutes for 1000+ files)
- Check backend logs for errors
- Ensure sufficient disk space for temp cloning
Getting Help
- π§ Open an issue
- π¬ Check existing discussions
- π Submit bug reports with logs and repo details
π€ Contributing
Contributions are welcome! Hereβs how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
- OpenAI for GPT-4 API
- LangChain for agent orchestration framework
- ChromaDB for vector database
- FastAPI for excellent API framework
- React team for the UI library