Phase 3 completes CodeOrbit AI with a modern Streamlit frontend, transforming the backend system into a demo-ready hackathon product.
-
Main Application (
frontend/app.py)- Modern dashboard UI
- Repository input and analysis
- Technology stack visualization
- Language distribution charts
- AI chat interface
- Session state management
- Custom CSS styling
-
API Client (
frontend/services/api.py)- Complete backend integration
- Repository analysis methods
- Chat and embedding methods
- Health checks
- Error handling
-
Helper Utilities (
frontend/utils/helpers.py)- Formatting functions
- UI components
- Sample data
- Session management
- Custom styling
# Terminal 1 - Backend
cd c:/Users/Admin/Documents/CodeOrbit_AI
python -m uvicorn backend.main:app --reload --port 8000Expected Output:
INFO: Uvicorn running on http://127.0.0.1:8000
INFO: Application startup complete.
# Terminal 2 - Frontend
cd c:/Users/Admin/Documents/CodeOrbit_AI
streamlit run frontend/app.pyExpected Output:
You can now view your Streamlit app in your browser.
Local URL: http://localhost:8501
Network URL: http://192.168.x.x:8501
Open browser to: http://localhost:8501
Steps:
- Enter GitHub URL:
https://github.com/pallets/flask - Select branch:
main - Check "Include file content (for AI)"
- Click "🚀 Analyze Repository"
What Happens:
- Repository is cloned
- Files are parsed and filtered
- Technology stack is detected
- Statistics are calculated
- Folder structure is generated
Expected Result:
- Repository overview dashboard
- Key metrics (files, LOC, size)
- Technology stack badges
- Language distribution chart
- Folder structure tree
Steps:
- Scroll to "🤖 AI Features" section
- Click "🧠 Prepare AI Features"
- Wait 1-2 minutes for embedding generation
What Happens:
- Code is chunked intelligently
- OpenAI embeddings are generated
- FAISS vector index is created
- Index is saved to disk
Expected Result:
- Success message
- Vector statistics displayed
- Chat interface becomes available
Steps:
- View suggested questions
- Click a suggestion OR type custom question
- Click "🚀 Ask Question"
Example Questions:
- "Where is authentication implemented?"
- "How is routing handled?"
- "What testing framework is used?"
- "Explain the API flow"
Expected Result:
- AI-generated answer
- Source file references
- Relevance scores
- Response time
"Hi! I'm demonstrating CodeOrbit AI - an AI-powered tool that helps developers understand any GitHub repository in minutes."
1. Repository Analysis (1 minute)
Action: Paste Flask repository URL
Say: "Let's analyze the Flask web framework repository."
Wait: 30 seconds for analysis
Show: Overview dashboard, metrics, technology stack
2. Explore Results (1 minute)
Show: Language distribution chart
Show: Folder structure
Show: Important files
Say: "CodeOrbit automatically detects technologies, analyzes structure, and identifies key files."
3. AI Preparation (1 minute)
Action: Click "Prepare AI Features"
Say: "Now let's enable AI-powered Q&A by generating embeddings."
Wait: Show progress
Show: Vector statistics when complete
4. AI Q&A Demo (1 minute)
Action: Click suggested question "Where is authentication implemented?"
Wait: 5 seconds
Show: AI answer with source references
Say: "The AI provides contextual answers with exact source file references."
Action: Ask custom question "How is routing handled?"
Show: Another answer with sources
"CodeOrbit AI combines repository analysis with RAG-based AI to help developers quickly understand any codebase. Perfect for onboarding, code reviews, or exploring new projects."
-
Sidebar
- System status indicators
- Current repository info
- Sample repository shortcuts
- Clear repository button
-
Repository Input
- URL input field
- Branch selector
- Content inclusion toggle
- Analyze button
-
Overview Section
- Repository metadata
- Key metrics cards
- Technology stack badges
- Language distribution chart
-
Structure Section
- Expandable folder tree
- Important files list
- Entry points list
-
AI Section
- Preparation status
- Vector statistics
- Suggested questions
- Chat interface
- Conversation history
- Color Scheme: Blue primary, green success, orange warning
- Icons: Emoji-based for quick recognition
- Charts: Plotly interactive visualizations
- Badges: Technology stack indicators
- Cards: Metric displays
- Expandable Sections: For detailed information
# Required for AI features
OPENAI_API_KEY=sk-...
# Optional
BACKEND_URL=http://localhost:8000
LOG_LEVEL=INFO# shared/config.py
BACKEND_HOST = "0.0.0.0"
BACKEND_PORT = 8000
TEMP_DIR = "data/repositories"
VECTOR_STORE_DIR = "data/vector_stores"# frontend/services/api.py
DEFAULT_BACKEND_URL = "http://localhost:8000"
REQUEST_TIMEOUT = 300 # 5 minutesProblem: ModuleNotFoundError
Solution:
pip install -r requirements.txtProblem: OpenAI API key not configured
Solution: Phase 1 works without it. For AI features, add to .env:
OPENAI_API_KEY=sk-your-key-hereProblem: streamlit: command not found
Solution:
pip install streamlit plotlyProblem: Cannot connect to backend
Solution: Ensure backend is running on port 8000
Problem: Repository not found
Solution: Check URL is correct and repository is public
Problem: Cloning timeout
Solution: Try smaller repository or check internet connection
Problem: OpenAI API key not configured
Solution: Add valid OpenAI API key to .env
Problem: Embedding generation fails
Solution: Check OpenAI API quota and key validity
- Click:
https://github.com/pallets/click - Files: ~50 source files
- Time: 10-15 seconds analysis, 30 seconds embeddings
- Flask:
https://github.com/pallets/flask - Files: ~200 source files
- Time: 20-30 seconds analysis, 1 minute embeddings
- FastAPI:
https://github.com/tiangolo/fastapi - Files: ~500 source files
- Time: 40-60 seconds analysis, 2 minutes embeddings
- Complete Solution: End-to-end repository intelligence
- Modern Tech Stack: FastAPI, Streamlit, OpenAI, FAISS
- Production Architecture: Modular, scalable, maintainable
- AI Integration: RAG-based Q&A with source attribution
- User Experience: Clean UI, fast responses, intuitive flow
- Smart Chunking: Context-aware code splitting
- Vector Search: FAISS for fast similarity search
- Async Processing: Efficient embedding generation
- Error Handling: Graceful degradation
- Type Safety: Full type hints with Pydantic
- Small repos (<100 files): 10-20 seconds
- Medium repos (100-500 files): 20-40 seconds
- Large repos (500+ files): 40-90 seconds
- Small repos: 30-60 seconds
- Medium repos: 1-2 minutes
- Large repos: 2-4 minutes
- Average: 2-5 seconds
- With sources: 3-6 seconds
- Complex queries: 5-10 seconds
- Add repository comparison feature
- Implement code search
- Add export functionality
- Create shareable reports
- Add user authentication
- Cache analysis results
- Parallel embedding generation
- Incremental updates
- Background processing
- Response streaming
- Start with problem statement
- Show quick demo first
- Explain technology after
- Use prepared repository
- Have backup in case of issues
- Show both analysis and AI features
- Highlight source attribution
- Emphasize architecture
- Discuss scalability
- Mention production readiness
- Show code quality
- Summarize key features
- Mention future enhancements
- Thank judges
- Be ready for questions
- ✅ Repository analysis works
- ✅ UI is responsive and clean
- ✅ AI Q&A provides accurate answers
- ✅ Source attribution is visible
- ✅ Demo completes in 5 minutes
- ✅ All of above
- ✅ Multiple repositories analyzed
- ✅ Complex questions answered
- ✅ Fast response times
- ✅ No errors during demo
- ✅ All of above
- ✅ Smooth presentation
- ✅ Technical depth shown
- ✅ Architecture explained
- ✅ Future vision articulated
- Check logs in terminal
- Use browser console for frontend errors
- Test with small repositories first
- Have backup repository ready
- Test everything before presenting
- Keep backend logs visible
- Have fallback slides ready
Before Demo:
- Backend starts without errors
- Frontend loads correctly
- Sample repository analyzes successfully
- AI features work end-to-end
- All UI elements display properly
- Response times are acceptable
- Error handling works gracefully
- Presentation script is ready
Made with ❤️ by Bob
Good luck with your hackathon! 🚀