Understand a public GitHub repository with a beginner-friendly explanation of its structure, technologies, important files, and application flow. The project supports a local Ollama setup and an online Groq setup. Repository files are cloned temporarily and read as text; repository code is never executed.
GitHub URL → GitPython shallow clone → ranked text-file selection → bounded context
→ selected LLM provider → FastAPI response → Streamlit or static web frontend
The API entry point is backend/main.py. Repository filtering and extraction live in backend/services/repository_processor.py. Provider selection changes only the explanation step.
The academic/demo setup uses Streamlit, FastAPI, GitPython, and Ollama with rafw007/qwen35-codex-coder:9b.
-
Install Python, Git, and Ollama.
-
Create a virtual environment and install dependencies:
python -m venv .venv ..venv\Scripts\Activate.ps1 pip install -r requirements.txt Copy-Item .env.example .env
-
Set
LLM_PROVIDER=ollama,OLLAMA_URL=http://localhost:11434, andOLLAMA_MODEL=rafw007/qwen35-codex-coder:9bin the ignored local.env. Make sure the model is installed in Ollama. -
In one terminal, run the API:
uvicorn backend.main:app --reload -
In another terminal, run the Streamlit app:
streamlit run frontend/app.py
The local web frontend is also available using a static server: run python -m http.server 3000 --directory frontend, then open http://localhost:3000. Its API URL is configured in frontend/config.js.
The online setup uses the static HTML/CSS/JavaScript frontend, FastAPI on Render, GitPython, and Groq API. The browser communicates only with FastAPI. The Groq key is read by the backend from GROQ_API_KEY; it must be configured as a private Render environment variable. Ollama is not contacted when LLM_PROVIDER=groq.
The Groq model defaults to openai/gpt-oss-20b and can be changed using GROQ_MODEL. Check Groq's supported models and model deprecation notices for the latest availability and migration information.
Install the project requirements, put the key into your local ignored .env, and set:
LLM_PROVIDER=groq
GROQ_MODEL=openai/gpt-oss-20b
GROQ_API_KEY=<your key in the local .env only>
MAX_CONTEXT_CHARS=60000
ALLOWED_ORIGINS=http://localhost:3000,http://localhost:8501
Start the API with uvicorn backend.main:app --reload. Serve the static frontend with python -m http.server 3000 --directory frontend. frontend/config.js defaults to the local API at http://localhost:8000.
-
Push the project to a GitHub repository. Confirm
.envis ignored and contains no committed key. -
Create or use a Groq API key. Do not paste it into source files, the frontend, or this README.
-
In Render, create a Blueprint from the repository using
render.yaml, or create the services manually. -
For the backend Web Service, use build command
pip install -r requirements.txtand start commanduvicorn backend.main:app --host 0.0.0.0 --port $PORT. -
Set backend environment variables in Render:
LLM_PROVIDER=groqGROQ_MODEL=openai/gpt-oss-20bGROQ_API_KEYset privately in the Render dashboardMAX_CONTEXT_CHARS=60000ALLOWED_ORIGINS=https://<your-static-site>.onrender.com
-
Deploy the backend and check its
/healthand/docsURLs. -
Deploy a Render Static Site with publish directory
frontend(already described inrender.yaml). -
Set
frontend/config.jsAPI_BASE_URLto the deployed backend URL, commit and redeploy the static site. -
Set backend
ALLOWED_ORIGINSto the exact static-site origin, without a trailing slash, and redeploy the backend if needed. -
Submit a small public GitHub repository URL in the website and check the generated report.
Render filesystems are ephemeral. Each clone is created in a unique temporary directory and removed after analysis, including when an error occurs. /health does not contact GitHub or either LLM provider. API documentation remains at /docs and /openapi.json.
The production frontend is plain HTML, CSS, and JavaScript in frontend/index.html, frontend/style.css, and frontend/app.js. It has responsive layouts, URL validation, loading and error states, a file list, and safe text-based Markdown rendering. frontend/config.js is the single place to set the backend URL; it contains no secrets.
- Only HTTPS public GitHub repository URLs are accepted; arbitrary Git servers are rejected.
- The backend never imports or runs target repository code, installs its dependencies, or runs its scripts.
.git, dependency, build, cache, editor, generated, binary, lock, and oversized files are excluded.- Repository context is capped at 60,000 characters by default.
- Groq and Git operations have time limits, and API errors do not include credentials or SDK diagnostics.
- CORS is controlled by
ALLOWED_ORIGINS; production should list only the deployed frontend origin. - Large repositories may be truncated or omit files, so explanations describe only selected context.
GET /— API informationGET /health— process health checkPOST /explain— analyze and explain a public GitHub repository
{ "repo_url": "https://github.com/owner/repository" }
Python, FastAPI, Pydantic, Uvicorn, GitPython, Streamlit, Ollama, Groq Python SDK, python-dotenv, and plain HTML/CSS/JavaScript.