How aravind007e/edureach-chatbot works
EduReach is a college information and counseling product: visitors explore institutional content, ask grounded academic questions through chat or voice, and can create accounts. The main answer flow runs from the chat UI through the API/controller into intent routing, vector retrieval, grounded generation, and citation-bearing responses. The README also documents offline knowledge ingestion, authentication, and Vapi voice/call support. Source excerpts establish key calls; some route-to-controller and voice wiring is documented rather than sampled, so those links are marked dashed.
Main entry points: rag.service.ts RAG orchestrator · app.ts Express application · App.tsx App and routes · auth.routes.ts Auth routes
Components 31
Student experience
- App and routes
src/App.tsx - College content
src/data/content.ts - Chat drawer
src/components/ChatDrawer.tsx - Chat state
src/context/ChatContext.tsx - Chat client
src/services/chat.service.ts - Login and signup
src/pages/LoginPage.tsx - Auth state
src/context/AuthContext.tsx - Auth client
src/services/auth.service.ts - HTTP API
src/services/api.ts
API and identity
- Express application
server/src/app.ts - Chat routes
server/src/routes/chat.routes.ts - Chat controller
server/src/controllers/chat.controller.ts - Auth routes
server/src/routes/auth.routes.ts - Auth controller
server/src/controllers/auth.controller.ts - JWT middleware
server/src/middleware/auth.middleware.ts - User records
server/src/models/user.model.ts - JWT utilities
server/src/utils/jwt.util.ts
Knowledge answering
- Intent router
server/src/services/router.service.ts - RAG orchestrator
server/src/services/rag.service.ts - Chunking and ingestion
server/src/services/document.service.ts - Embedding service
server/src/services/embedding.service.ts - Vector retrieval
server/src/services/retrieval.service.ts - Knowledge chunks
server/src/models/knowladge-doc.model.ts - Ollama models
Voice counseling
- Voice interface
src/components/CallPopup.tsx - Vapi client
src/services/vapi.service.ts - Voice routes
server/src/routes/vapi.routes.ts - Voice controller
server/src/controllers/vapi.controller.ts - Vapi service
server/src/services/vapi.service.ts
Other components
- Student
- Vapi service
Connections 39
- Student → App and routes: opens
- App and routes → College content: presents
- App and routes → Chat drawer: mounts
src/App.tsx - Student → Chat drawer: asks
- Chat drawer → Chat state: uses
src/components/ChatDrawer.tsx - Chat state → Chat client: sends
src/context/ChatContext.tsx - Chat client → HTTP API: posts
src/services/chat.service.ts - HTTP API → Express application: requests
README.md - Express application → Chat routes: mounts
server/src/app.ts - Chat routes → Chat controller: dispatches
- Chat controller → RAG orchestrator: queries
- RAG orchestrator → Intent router: classifies
server/src/services/rag.service.ts - RAG orchestrator → Vector retrieval: retrieves
server/src/services/rag.service.ts - Vector retrieval → Embedding service: embeds query
server/src/services/retrieval.service.ts - Vector retrieval → Knowledge chunks: loads chunks
server/src/services/retrieval.service.ts - RAG orchestrator → Chunking and ingestion: chunks source
server/src/services/rag.service.ts - RAG orchestrator → Embedding service: embeds chunks
server/src/services/rag.service.ts - RAG orchestrator → Knowledge chunks: stores chunks
server/src/services/rag.service.ts - Embedding service → Ollama models: requests vectors
server/src/services/embedding.service.ts - RAG orchestrator → Ollama models: generates answer
server/src/services/rag.service.ts - RAG orchestrator → Chat controller: returns answer
- Student → Login and signup: registers
- Login and signup → Auth client: authenticates
src/pages/LoginPage.tsx - Auth state → Auth client: loads profile
src/context/AuthContext.tsx - Auth client → HTTP API: requests
src/services/auth.service.ts - Express application → Auth routes: mounts
server/src/app.ts - Auth routes → Auth controller: dispatches
server/src/routes/auth.routes.ts - Auth controller → User records: reads writes
server/src/controllers/auth.controller.ts - Auth controller → JWT utilities: issues token
server/src/controllers/auth.controller.ts - Auth routes → JWT middleware: protects routes
server/src/routes/auth.routes.ts - JWT middleware → JWT utilities: verifies token
server/src/middleware/auth.middleware.ts - Student → Voice interface: starts voice
- Voice interface → Vapi client: uses
- Vapi client → Vapi service: connects
README.md - Voice interface → Voice routes: requests call
README.md - Express application → Voice routes: mounts
- Voice routes → Voice controller: dispatches
server/src/routes/vapi.routes.ts - Voice controller → Vapi service: delegates
server/src/controllers/vapi.controller.ts - Vapi service → Vapi service: integrates