How anshulsharma48/gitinsight works
GitInsight lets users authenticate, import a public GitHub repository, inspect its metadata and tree, review deterministic health findings and AI insights, and ask citation-grounded codebase questions. The graph follows the documented UI-to-API workflow and the source-indexed backend calls. README-described capabilities such as onboarding roadmaps and static audit dimensions are retained; unsampled implementation details and unsupported links are omitted.
Main entry points: App.jsx App routing and landing · api.js Authenticated API client · repositoryRoutes.js Repository routes · analysisController.js Analysis orchestration
Components 30
Web application
- App routing and landing
client/src/App.jsx - Session state
client/src/context/AuthContext.jsx - Repository dashboard
client/src/pages/Dashboard.jsx - Repository details
client/src/pages/RepositoryDetail.jsx - Health results
client/src/pages/RepositoryAnalysis.jsx - Repository chat UI
client/src/pages/RepositoryChat.jsx - Authenticated API client
client/src/services/api.js
Identity and API
- Express API bootstrap
server/server.js - Auth routes
server/routes/authRoutes.js - Repository routes
server/routes/repositoryRoutes.js - Account handlers
server/controllers/authController.js - JWT protection
server/middleware/authMiddleware.js - User records
server/models/User.js
Repository ingestion and audit
- Repository import and access
server/controllers/repositoryController.js - GitHub repository fetch
server/services/github/githubService.js - Offline fallback data
server/services/github/fallbackData.js - Repository records
server/models/Repository.js - Analysis orchestration
server/controllers/analysisController.js - Deterministic health scoring
server/analyzers/scoringEngine.js - Code quality rules
server/analyzers/quality/codeQualityAnalyzer.js - Security rules
server/analyzers/security/securityAnalyzer.js - Analysis records
server/models/Analysis.js
Grounded repository chat
- AI insights and responses
server/services/ai/geminiService.js - Index and chat handlers
server/controllers/ragController.js - Chunking and retrieval
server/services/rag/ragService.js - Indexed code chunks
server/models/RepositoryChunk.js
Other components
- Repository user
- GitHub REST API
- Google Gemini
- MongoDB
Connections 38
- Repository user → App routing and landing: uses
README.md - App routing and landing → Session state: provides session
client/src/App.jsx - App routing and landing → Repository dashboard: routes to
client/src/App.jsx - App routing and landing → Repository details: routes to
client/src/App.jsx - App routing and landing → Health results: routes to
client/src/App.jsx - App routing and landing → Repository chat UI: routes to
client/src/App.jsx - Session state → Authenticated API client: verifies session
client/src/context/AuthContext.jsx - Repository dashboard → Authenticated API client: requests repositories
client/src/pages/Dashboard.jsx - Repository details → Authenticated API client: loads repository
client/src/pages/RepositoryDetail.jsx - Health results → Authenticated API client: loads findings
client/src/pages/RepositoryAnalysis.jsx - Repository chat UI → Authenticated API client: indexes and chats
client/src/pages/RepositoryChat.jsx - Authenticated API client → Express API bootstrap: sends API requests
README.md - Express API bootstrap → Auth routes: mounts routes
server/server.js - Express API bootstrap → Repository routes: mounts routes
server/server.js - Auth routes → Account handlers: dispatches
server/routes/authRoutes.js - Auth routes → JWT protection: protects session route
server/routes/authRoutes.js - Repository routes → Repository import and access: dispatches
server/routes/repositoryRoutes.js - Repository routes → Analysis orchestration: dispatches
server/routes/repositoryRoutes.js - Repository routes → Index and chat handlers: dispatches
server/routes/repositoryRoutes.js - Repository routes → JWT protection: protects routes
server/routes/repositoryRoutes.js - Account handlers → User records: reads and writes
server/controllers/authController.js - JWT protection → User records: looks up user
server/middleware/authMiddleware.js - Repository import and access → GitHub repository fetch: fetches repository data
server/controllers/repositoryController.js - Repository import and access → Offline fallback data: uses fallback dataset
server/controllers/repositoryController.js - Repository import and access → Repository records: stores and queries
server/controllers/repositoryController.js - Analysis orchestration → Repository records: loads repository
server/controllers/analysisController.js - Analysis orchestration → Deterministic health scoring: runs scoring
server/controllers/analysisController.js - Analysis orchestration → AI insights and responses: generates insights
server/controllers/analysisController.js - Analysis orchestration → Analysis records: stores analysis
server/controllers/analysisController.js - Deterministic health scoring → Code quality rules: runs quality rules
server/analyzers/scoringEngine.js - Deterministic health scoring → Security rules: runs security rules
server/analyzers/scoringEngine.js - Index and chat handlers → Repository records: loads repository
server/controllers/ragController.js - Index and chat handlers → Chunking and retrieval: indexes and answers
server/controllers/ragController.js - Chunking and retrieval → Indexed code chunks: stores and retrieves chunks
server/services/rag/ragService.js - Chunking and retrieval → AI insights and responses: generates chat response
server/services/rag/ragService.js - GitHub repository fetch → GitHub REST API: fetches public data
README.md - AI insights and responses → Google Gemini: requests generation
README.md - Express API bootstrap → MongoDB: connects database
server/server.js