Understand any codebase β without ever running it.
DevPilot AI lets you import a public GitHub repository or ZIP file and instantly explore it through static analysis, semantic search, citation-backed AI chat, generated documentation, and structured code reviews β all grounded in verified file and line evidence.
- β¨ Features
- π οΈ Tech Stack
- ποΈ Architecture
- π Project Structure
- β‘ Quick Start
- π Environment Variables
- ποΈ Database & Auth
- π Security Design
- π§ͺ Testing
- π Deployment
β οΈ Known Limitations
| # | Feature | Description |
|---|---|---|
| π | Authentication | Email/password login with optional Google OAuth via Supabase Auth |
| ποΈ | Workspaces | User-owned workspaces with full CRUD β isolated and secured per user |
| π₯ | Safe Imports | Public GitHub repos (shallow clone) and ZIP files with background progress tracking |
| π | Static Analysis | Deterministic parsing of Python, Java, JavaScript, TypeScript, HTML, CSS, JSON, and Markdown |
| π | Deep Metrics | Language, framework, dependency, symbol, route, test, and documentation metrics |
| πΊοΈ | Repo Explorer | Browse source files with syntax preview and symbol navigation |
| π | Hybrid Search | Keyword, semantic, and reciprocal-rank fusion search powered by pgvector |
| π¬ | AI Chat | Repository chat with selected-file context and citation-verified responses |
| π | Doc Generation | Auto-generate README, overview, architecture, module, and API documentation |
| π‘οΈ | Code Reviews | Structured reviews grouped by severity with verified file and line references |
| Technology | Role |
|---|---|
| Next.js 15 + React | App framework and routing |
| TypeScript | Type-safe development |
| Tailwind CSS + shadcn/ui | Styling and component system |
| TanStack Query | Server-state management and caching |
| Technology | Role |
|---|---|
| FastAPI | High-performance async API layer |
| SQLAlchemy + Alembic | ORM and schema migrations |
| Pydantic | Request/response validation |
| Technology | Role |
|---|---|
| LangChain + LangGraph | Controlled AI orchestration workflows |
FastEmbed BAAI/bge-small-en-v1.5 |
Local embeddings |
| Ollama / Groq | Local and hosted LLM inference |
| pgvector | Vector similarity search in PostgreSQL |
| Technology | Role |
|---|---|
| Supabase | Auth (JWT) + PostgreSQL hosting |
| Vercel | Frontend hosting |
| Render | Backend hosting via render.yaml blueprint |
βββββββββββββββββββββββββββββββββββββββ
β Next.js Browser Application β
β (Supabase Auth β JWT token only) β
ββββββββββββββββββ¬βββββββββββββββββββββ
β Verified Supabase Access Token
βΌ
βββββββββββββββββββββββββββββββββββββββ
β FastAPI β Auth & Ownership β
β (JWT verify + user scope) β
ββββββ¬βββββββββββββββ¬ββββββββββββββββββ
β β β
βΌ βΌ βΌ
Supabase Safe Repo Ollama (local)
PostgreSQL Storage & Groq (hosted)
+ pgvector Analysis
Key principle: The browser touches Supabase only for authentication. Every application-data request goes through FastAPI, which verifies JWT signatures and enforces per-user workspace ownership before reading or writing any data.
devpilot-ai/
βββ frontend/ # Next.js 15 application (Vercel)
β βββ app/ # App Router pages and layouts
β βββ components/ # Reusable UI components
β βββ .env.example # Frontend env template
βββ backend/ # FastAPI application (Render)
β βββ app/ # API routes, services, models
β βββ migrations/ # Alembic migration scripts
β βββ .env.example # Backend env template
βββ render.yaml # Render deployment blueprint
βββ README.md
- Python 3.11+
- Node.js 20+
- PostgreSQL with pgvector extension (or Supabase project)
- Ollama for local AI inference
cd backend
# Create and activate virtual environment
python -m venv .venv
.\.venv\Scripts\python.exe -m pip install -e ".[dev]"
# Configure environment
Copy-Item .env.example .env
# Edit .env with your Supabase and database credentials
# Run database migrations
.\.venv\Scripts\python.exe -m alembic upgrade head
# Start the API server
.\.venv\Scripts\python.exe -m uvicorn app.main:app --reload --port 8000API will be live at
http://localhost:8000
Health checks:/api/v1/health/liveΒ·/api/v1/health/ready
cd frontend
npm install
# Configure environment
Copy-Item .env.example .env.local
# Edit .env.local with your Supabase and API URLs
npm run devApp will be live at
http://localhost:3000
ollama pull llama3.1:8b
ollama serveSet
AI_PROVIDER=ollamainbackend/.envfor local inference.
Switch toAI_PROVIDER=groqwith aGROQ_API_KEYfor hosted inference.
| Variable | Description |
|---|---|
NEXT_PUBLIC_SUPABASE_URL |
Your Supabase project URL |
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY |
Supabase anon/publishable key β never use service-role here |
NEXT_PUBLIC_API_BASE_URL |
FastAPI origin, without trailing /api/v1 |
| Variable | Description |
|---|---|
DATABASE_URL |
SQLAlchemy PostgreSQL connection string |
SUPABASE_URL |
JWT issuer and JWKS endpoint |
FRONTEND_ORIGIN |
Exact frontend origin for CORS |
AI_PROVIDER |
ollama (local) or groq (hosted) |
GROQ_API_KEY |
Groq API secret β backend only, never exposed to client |
OLLAMA_BASE_URL |
Ollama server URL (default: http://localhost:11434) |
OLLAMA_MODEL |
Model tag to use (e.g. llama3.1:8b) |
WORKSPACE_STORAGE_ROOT |
Directory where imported repos are stored |
FASTEMBED_MODEL |
Embedding model identifier |
EMBEDDING_DIMENSION |
Must match the chosen model's output dimension |
π Full documentation for every variable is in
backend/.env.exampleandfrontend/.env.example.
Alembic manages all schema changes. The migration history creates:
- Profiles β linked to Supabase Auth users
- Workspaces β user-owned repository containers
- Import Jobs β background import progress tracking
- Repository Metadata β parsed analysis results
- Vector Chunks β embeddings for semantic search (pgvector)
- Conversations & Messages β chat history with citations
- Generated Documents β AI-produced documentation artifacts
- Code Reviews β structured severity-grouped review results
Current migration head: 20260730_10
Hosting tip: Use the Supabase Session Pooler URL for IPv4-compatible hosted database access. Set the production
Site URLand/auth/callbackredirect in Supabase Auth settings.
DevPilot AI is designed with a zero-execution, evidence-grounded security model:
- π« No code execution β imported code and its dependencies are never run
- π Safe Git imports β shallow, public-only, non-interactive; submodules and symlinks are rejected
- π¦ Safe ZIP imports β path traversal, symlinks, encrypted/nested archives, and oversized content are all rejected
- π Sensitive file exclusion β
.env, key/certificate files, binaries, and archives are excluded from analysis and AI context - β Full JWT verification β FastAPI verifies Supabase JWT signatures, issuer, audience, expiry, and authenticated role on every request
- π€ Per-user scoping β all workspace and artifact queries are filtered to the authenticated owner
- π Untrusted AI context β repository content is wrapped as untrusted evidence in prompts; model output is never trusted for file paths or line numbers
- π Secrets hygiene β secrets live only in ignored local files or hosting dashboards, never in source code
cd backend
# Linting
.\.venv\Scripts\python.exe -m ruff check app tests --no-cache
# Type checking
.\.venv\Scripts\python.exe -m mypy app --cache-dir nul
# Unit & integration tests
.\.venv\Scripts\python.exe -m pytest -qcd frontend
npm run lint
npm run typecheck -- --incremental false
npm test -- --run
npm run buildCoverage includes: auth failures, ownership enforcement, safe imports, parsers, file containment, pgvector retrieval, chat citations, document generation, code reviews, and frontend user flows.
| Service | URL |
|---|---|
| Frontend (Vercel) | https://devpilot-ai-gamma.vercel.app |
| Backend (Render) | https://devpilot-ai-owr2.onrender.com |
| API Docs | https://devpilot-ai-owr2.onrender.com/docs |
- Import
frontend/as a Next.js project in Vercel - Add all
NEXT_PUBLIC_*environment variables in the Vercel dashboard - Set
NEXT_PUBLIC_API_BASE_URLto your Render backend URL
- Connect this repository to Render and select the Blueprint option using
render.yaml - Add all backend environment variables in the Render dashboard
- Set
FRONTEND_ORIGINto your production Vercel URL - Configure the same origin in Supabase Auth β URL Configuration
- Only public GitHub repositories and ZIP files are supported
- Imported repositories are intentionally never built or executed
- Google OAuth requires manual setup in both Google Cloud Console and Supabase Auth
- Groq requires a user-provided API key; Ollama is the free local default
- Render's free tier filesystem is ephemeral β hosted source files may disappear after sleep or redeploy; local use is more reliable
- The built-in Markdown viewer supports common formatting from the documentation workflow, not every Markdown extension
- This is a student demonstration project, not a production-grade multi-tenant service