How prerna7506/repolens works
RepoLens lets users connect GitHub repositories, index their code, browse it, and ask questions answered with file-and-line citations. The main path is repository submission through the gateway to the ingestion worker, followed by hybrid retrieval and LLM answering; separate capabilities cover OAuth, history, live presence, and webhook-driven re-indexing. The README documents several subsystems whose implementation was not sampled, so those links are shown as unverified rather than inferred from module names.
Main entry points: app.js Express gateway · main.py Worker API · db_connection.js Postgres index · ingest.py Clone and index
Components 28
Web application
- Angular app
frontend/src/app/app.config.ts - Repo browsing
frontend/src/app/core/components/repository/repository.component.ts - Code explorer
frontend/src/app/core/components/code-explorer/code-explorer.component.ts - Ask questions
frontend/src/app/core/components/chat/chat.component.ts - Search
frontend/src/app/core/components/search/search.component.ts - Query history
frontend/src/app/core/components/search-history/search-history.component.ts - Auth client
frontend/src/app/core/services/auth.service.ts - Repository client
frontend/src/app/core/services/repo.service.ts - Query client
frontend/src/app/core/services/query.service.ts - Live presence client
frontend/src/app/core/services/socket.service.ts
API gateway
- Express gateway
backend/api-gateway/src/app.js - Auth routes
backend/api-gateway/src/routes/auth.js - OAuth and tokens
backend/api-gateway/src/controller/authController.js - Repository routes
backend/api-gateway/src/routes/repos.js - Repository operations
backend/api-gateway/src/controller/repoController.js - Query routes
backend/api-gateway/src/routes/query.js - Retrieval and answers
backend/api-gateway/src/controller/queryController.js - Push webhook
backend/api-gateway/src/controller/webhookController.js - Socket presence
backend/api-gateway/src/socket.js
Code ingestion
- Worker API
backend/ingestion/app/main.py - Clone and index
backend/ingestion/app/tasks/ingest.py - Task dispatch
backend/ingestion/app/celery_app.py
Index and cache
- Postgres index
backend/api-gateway/src/db/db_connection.js - Redis cache and queue
backend/api-gateway/src/db/redis.js
External services
- GitHub
- Groq LLM
- Embedding model
Other components
- User
Connections 36
- User → Angular app: uses
README.md - Angular app → Auth client: initializes
frontend/src/app/app.config.ts - Repo browsing → Repository client: uses
frontend/src/app/core/components/repository/repository.component.ts - Code explorer → Query client: loads file content
- Ask questions → Query client: asks questions
- Search → Query client: searches
- Query history → Query client: loads history
frontend/src/app/core/components/search-history/search-history.component.ts - Repository client → Express gateway: REST requests
- Query client → Express gateway: REST requests
frontend/src/app/core/services/query.service.ts - Auth client → Express gateway: auth requests
frontend/src/app/core/services/auth.service.ts - Live presence client → Socket presence: WebSocket presence
- Express gateway → Auth routes: mounts
backend/api-gateway/src/app.js - Express gateway → Repository routes: mounts
backend/api-gateway/src/app.js - Express gateway → Query routes: mounts
backend/api-gateway/src/app.js - Express gateway → Push webhook: mounts
backend/api-gateway/src/app.js - Auth routes → OAuth and tokens: dispatches
backend/api-gateway/src/routes/auth.js - Repository routes → Repository operations: dispatches
backend/api-gateway/src/routes/repos.js - Query routes → Retrieval and answers: dispatches
backend/api-gateway/src/routes/query.js - Repository operations → Postgres index: reads and writes
backend/api-gateway/src/controller/repoController.js - Repository operations → Worker API: starts ingestion
backend/api-gateway/src/controller/repoController.js - Retrieval and answers → Worker API: requests embedding
backend/api-gateway/src/controller/queryController.js - Retrieval and answers → Postgres index: retrieves and stores queries
backend/api-gateway/src/controller/queryController.js - Retrieval and answers → Groq LLM: generates cited answer
backend/api-gateway/src/controller/queryController.js - Push webhook → Postgres index: reads repository data
backend/api-gateway/src/controller/webhookController.js - Push webhook → Worker API: triggers delta indexing
- Worker API → Task dispatch: dispatches task
backend/ingestion/app/main.py - Task dispatch → Clone and index: runs task
backend/ingestion/app/tasks/ingest.py - Clone and index → GitHub: clones repository
- Clone and index → Postgres index: writes chunks and embeddings
- Clone and index → Redis cache and queue: caches embeddings
backend/ingestion/app/tasks/ingest.py - Clone and index → Embedding model: embeds chunks
backend/ingestion/app/tasks/ingest.py - Worker API → Postgres index: health checks
backend/ingestion/app/main.py - Worker API → Redis cache and queue: health checks
backend/ingestion/app/main.py - Express gateway → Socket presence: enables live presence
- OAuth and tokens → Postgres index: reads and writes users
backend/api-gateway/src/controller/authController.js - OAuth and tokens → GitHub: OAuth login