Living Documentation & Code Analysis Powered by Gemini 1.5 Pro
ContextMesh is a cutting-edge "Lean Monolith" application designed to bridge the gap between code and documentation. Leveraging the massive 2M token context window of Google's Gemini 1.5 Pro, it ingests entire repositories to provide holistic analysis, refactoring advice, and automated documentation.
ContextMesh exposes three distinct AI personas to interact with your codebase:
Analyzes high-level patterns, dependencies, and architectural health.
- Identifies circular imports and scalability bottlenecks.
- Generates "Health Scores" for Modularity, Documentation, and Test Coverage.
Your dedicated technical debt collector.
- Identifies messy code and anti-patterns.
- Provides specific "Before" and "After" refactoring plans.
- Predicts the impact of proposed changes.
Turns code into plain English.
- Generates comprehensive READMEs and "Living Documentation".
- Explains data flow and key architectural decisions, not just syntax.
- Framework: FastAPI (Python)
- AI Model: Google Gemini 1.5 Pro (via
google-genai) - Utilities:
pathspec(gitignore handling),pydantic(validation) - Integration: GitHub Webhooks
- Framework: Next.js 16 (App Router)
- Library: React 19
- Styling: Tailwind CSS v4
- Icons: Lucide React
- Python 3.10+
- Node.js 18+
- A Google Cloud Project with Gemini API enabled (Get API Key)
-
Clone the Repository
git clone https://github.com/yourusername/contextmesh.git cd contextmesh -
Backend Setup
# It is recommended to use a virtual environment python -m venv venv source venv/bin/activate # Windows: venv\Scripts\activate # Install Python dependencies pip install -r backend/requirements.txt # Set your API Key # Linux/Mac export GEMINI_API_KEY="your_actual_api_key_here" # Windows (PowerShell) $env:GEMINI_API_KEY="your_actual_api_key_here"
(Alternatively, create a
.envfile in the root directory) -
Frontend Setup
cd frontend npm install
You will need two terminal windows to run the full stack.
From the project root:
uvicorn backend.main:app --reload --port 8000- API URL: http://localhost:8000
- Interactive Docs: http://localhost:8000/docs
From the frontend/ directory:
npm run dev- Dashboard: http://localhost:3000
POST /analyze: Main endpoint to trigger an agent (Architect, Refactorer, Documentarian) on a local path.POST /webhook: Webhook receiver for GitHub events.GET /events: Fetch recent webhook events.