How aanishnithin07/gitdna works
Purpose and Entry Points
GitDNA is a GitHub behavioral-intelligence product: it fetches public GitHub telemetry, derives developer activity signals, and uses LLMs to produce profile narratives, traits, comparisons, and visual artifacts. The React client starts at src/main.jsx and composes the experience in src/App.jsx. The Python API is exposed through backend/main.py; api/index.py likely provides the Vercel-facing API entry.
Frontend Application Shell
src/App.jsx owns the scan/comparison workflow, profile state, and composition of the feature views. src/utils/backendApi.js is the frontend boundary for calling the backend rather than embedding API logic across UI components. Styling and application-level visual behavior live in src/App.css and src/index.css.
Analysis and AI Pipeline
backend/main.py is the FastAPI HTTP boundary: it accepts requested GitHub identities/features and returns analysis results. backend/analyzer.py is the deterministic analysis stage that transforms GitHub REST/Event data into behavioral metrics such as activity, timing, language, and commit-derived signals. backend/ai_engine.py is the generative interpretation layer, converting computed telemetry into archetypes, roast/battle narratives, time-machine stories, and related AI content.
GitHub and LLM Service Boundaries
The backend integrates GitHub REST and Events APIs as the source of public profile, repository, commit, and event data. LLM generation depends on Groq/Llama 3.1 and Google Gemini Flash, with credentials/configuration expected via backend/.env.example and .env.example. The key boundary is: external GitHub data is normalized and scored before being passed to AI generation, keeping visual clients insulated from provider-specific calls.
Feature Presentation Modules
Specialized React components render distinct projections of the common profile-analysis result: repository/trait analysis in src/components/RepoAnalysis.jsx, activity geography in src/components/GitMap.jsx, longitudinal narratives in src/components/TimeMachine.jsx, and workload risk in src/components/BurnoutDetail.jsx. Comparison and collectible outputs are isolated in src/components/DeveloperMatcher.jsx and src/components/TradingCard.jsx; editorial/linguistic presentations are in src/components/GitNewspaper.jsx and src/components/LanguagePrediction.jsx.
Primary Control Flow
A user supplies one or two GitHub usernames in the client. src/App.jsx invokes the backend through src/utils/backendApi.js; FastAPI coordinates GitHub retrieval, metric analysis, and optional AI enrichment. The resulting structured profile is retained client-side and fanned out to visualization components, avoiding separate external fetches per card. Share/deep-link behavior is primarily a frontend concern, while authoritative data acquisition and model calls remain server-side.
Runtime and Deployment
The frontend is a Vite/React static application, configured by vite.config.js and deployed through vercel.json. The backend is a Python/FastAPI service with dependencies in backend/requirements.txt, runtime declaration in backend/runtime.txt, and Railway deployment metadata in backend/railway.json and backend/Procfile. This creates a split deployment: Vercel serves the interactive client, while Railway hosts long-running API and AI-provider integration.
Main entry points: main.py FastAPI API · App.jsx Scan & comparison shell · backendApi.js Backend API client · main.jsx React entry
Components 16
Vite React Client
- React entry
src/main.jsx - Scan & comparison shell · Owns profile state and feature composition.
src/App.jsx - Backend API client
src/utils/backendApi.js - Profile analysis views · Repo, map, timeline, and burnout projections.
src/components/RepoAnalysis.jsx - Comparison & card views · Matchup and collectible profile outputs.
src/components/DeveloperMatcher.jsx - Editorial views · Newspaper and language presentations.
src/components/GitNewspaper.jsx
FastAPI Analysis Service
- FastAPI API · Accepts identities and requested analysis features.
backend/main.py - Telemetry analyzer · Derives behavioral metrics from GitHub data.
backend/analyzer.py - AI interpretation · Creates archetypes, narratives, and AI content.
backend/ai_engine.py - Vercel API entry
api/index.py
External Providers
- GitHub REST & Events · Profiles, repositories, commits, and events.
- Groq/Llama & Gemini
Deployment
- Vite build config
vite.config.js - Vercel · Serves the interactive client.
vercel.json - Railway · Hosts the long-running Python API.
backend/railway.json - Python API runtime
backend/requirements.txt
Connections 16
- React entry → Scan & comparison shell: mounts
- Scan & comparison shell → Backend API client: requests scans
- Scan & comparison shell → Profile analysis views: fans out profile
- Scan & comparison shell → Comparison & card views: renders comparison
- Scan & comparison shell → Editorial views: renders narratives
- Backend API client → FastAPI API: HTTP analysis request
- Vercel API entry → FastAPI API: API entry
- FastAPI API → GitHub REST & Events: retrieves telemetry
- FastAPI API → Telemetry analyzer: coordinates metrics
- Telemetry analyzer → AI interpretation: normalized scored telemetry
- AI interpretation → Groq/Llama & Gemini: generates content
- FastAPI API → Backend API client: structured profile result
- Vite build config → React entry: builds client
- Vercel → Vite build config: deploys static app
- Railway → Python API runtime: runs
- Python API runtime → FastAPI API: hosts