In progessss............... Local-First AI Software Engineering Intelligence Platform
Part 1: Foundation & Repository Analysis Layer
RepoPilot is an open-source, local-first engineering intelligence platform. It analyzes local Git repositories and codebases, computes physical lines of code (LOC), language distributions, directory hierarchies, technology manifests, and Git version historyβall strictly on your local machine with zero external AI APIs or cloud telemetry.
- Python: 3.11+
- Node.js: 18+ (Node 20+ recommended)
- Git
- (Optional) Docker & Docker Compose (for PostgreSQL)
# Navigate to backend directory
cd backend
# Create virtual environment (using venv or uv)
python3 -m venv .venv
# or: uv venv .venv
# Activate virtual environment
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# or: uv pip install -r requirements.txt
# Start FastAPI development server
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reloadThe backend API will be available at:
- API Base:
http://localhost:8000/api - Interactive Swagger Docs:
http://localhost:8000/docs - Health Check:
http://localhost:8000/health
# In a new terminal, navigate to frontend directory
cd frontend
# Install dependencies (already initialized)
npm install
# Start Next.js development server
npm run devOpen your browser to http://localhost:3000 to access the RepoPilot dashboard.
RepoPilot supports both PostgreSQL and SQLite:
-
PostgreSQL (Recommended for production/containers):
docker compose up -d db
Set in your
.envor environment:DATABASE_URL=postgresql://postgres:postgres@localhost:5432/repopilot
-
SQLite (Default local fallback): If
DATABASE_URLis omitted, RepoPilot automatically uses a localsqlite:///./repopilot.dbdatabase with full schema auto-generation, requiring zero external database configuration.
To run the automated test suite (including scanner, tech detector, Git analyzer, and FastAPI endpoints):
cd backend
PYTHONPATH=. .venv/bin/pytest tests -vRepoPilot/
βββ docker-compose.yml # PostgreSQL container configuration
βββ .env.example # Environment configuration template
βββ README.md # Comprehensive platform documentation
β
βββ backend/ # Python FastAPI Backend
β βββ requirements.txt # Python dependencies (FastAPI, SQLAlchemy, GitPython, etc.)
β βββ app/
β β βββ main.py # FastAPI application, lifespan, CORS & router mounting
β β βββ config.py # Pydantic Settings & configuration
β β βββ logging_config.py # Structured logger
β β βββ db/
β β β βββ session.py # SQLAlchemy engine & session factory (Postgres / SQLite)
β β β βββ models.py # Repository & AnalysisReport SQLAlchemy models
β β βββ schemas/ # Pydantic v2 schemas
β β β βββ repository.py # Repo import, metadata, and list schemas
β β β βββ analysis.py # Summary statistics, language breakdowns, tree models
β β β βββ git_info.py # Git commits, contributors, branches, and diff models
β β βββ services/
β β β βββ repository_service.py # Orchestrator for analysis, storage, and retrieval
β β β βββ scanner.py # Codebase walker, LOC counter, file filter, tree builder
β β β βββ technology_detector.py # Parses package.json, requirements, Cargo, go.mod, etc.
β β β βββ git_analyzer.py # GitPython wrapper for commits, branches, contributors, diffs
β β βββ routers/ # REST API endpoints
β β β βββ repositories.py # POST /api/repositories/analyze & GET /api/repositories
β β β βββ statistics.py # GET /api/repositories/{id}/statistics
β β β βββ languages.py # GET /api/repositories/{id}/languages
β β β βββ directory.py # GET /api/repositories/{id}/tree
β β β βββ git.py # GET /api/repositories/{id}/git
β β βββ utils/
β β βββ file_filters.py # Exclusion patterns, binary heuristics, language mappings
β β βββ path_validator.py # Absolute path validation & permission checker
β βββ tests/ # Automated Pytest suite
β βββ conftest.py # Temporary Git repo fixture generator
β βββ test_scanner.py # File scanner, LOC, and directory tree unit tests
β βββ test_technology_detector.py # Manifest parser unit tests
β βββ test_git_analyzer.py # Git history & contributor unit tests
β βββ test_api.py # FastAPI client integration tests
β
βββ frontend/ # Next.js 15 + TypeScript + Tailwind CSS Frontend
βββ src/
β βββ app/
β β βββ layout.tsx # Root layout
β β βββ page.tsx # Main interactive dashboard view
β β βββ globals.css # Dark theme & styling tokens
β βββ components/
β β βββ Header.tsx # Top bar with repo selector, branch tag & health status
β β βββ MetricCards.tsx # LOC, files, size, primary language, commits
β β βββ LanguageBreakdown.tsx # Multi-color distribution bar & percentage table
β β βββ TechStackBadges.tsx # Detected frameworks, package managers & runtimes
β β βββ DirectoryTreeViewer.tsx # Searchable, expandable directory tree browser
β β βββ GitActivity.tsx # Commit history, author leaderboard & diff changes
β β βββ LargestFilesList.tsx# Largest codebase files by byte size & LOC
β β βββ RepoImportModal.tsx # Local path modal with validation & quick pre-fill
β β βββ ErrorAlert.tsx # Clean error banner with actionable guidance
β βββ services/
β β βββ api.ts # Fully-typed API client service layer
β βββ types/
β βββ repopilot.ts # TypeScript interfaces mirroring Pydantic schemas
- No external AI calls: Zero calls to OpenAI, Gemini, Anthropic, or external inference APIs.
- No mock data: Every metric (LOC, file size, language percentage, commit author, SHA, branch) is computed from the repository being analyzed.
- Safe Scanning: Automatically excludes
.gitinternals,node_modules,.venv,__pycache__,dist,build,.next, binaries, and large generated lockfiles. - Robust Error Handling: Clean feedback for invalid directory paths, permission issues, or non-Git directories.