How dhruv4848l/knoq-ai-parul-university-helpdesk-chat-bot works
Knoq-AI is a campus helpdesk whose main flow runs from the student chat UI through the API’s chat orchestration, optional cache/FAQ/RAG context gathering, and Gemini response generation; navigation requests additionally use campus route data or Google Maps. The frontend also supports student accounts and an admin knowledge-ingestion workflow. Some modules are represented from the README and source index rather than inspected excerpts, so only documented or indexed relationships are connected.
Main entry points: chat.js Chat Orchestrator · server.js Express Server · gemini.js Gemini Service · admin.js Admin Routes
Components 25
Student Web App
- App Router
frontend/src/App.jsx - Chat Panel
frontend/src/components/ChatPanel.jsx - Admin Console
frontend/src/pages/Admin.jsx - Crawler UI
frontend/src/components/SiteCrawler.jsx - Auth Context
frontend/src/contexts/AuthContext.jsx - API Client
frontend/src/api/client.js
Backend API
- Express Server
backend/server.js - Auth Routes
backend/routes/auth.js - Chat Orchestrator
backend/routes/chat.js - Admin Routes
backend/routes/admin.js - Crawl Routes
backend/routes/crawl.js - Auth Middleware
backend/middleware/auth.js
Knowledge and AI
- RAG Retrieval
backend/services/rag.js - Gemini Service
backend/services/gemini.js - Semantic Cache
backend/services/semanticCache.js
Data and Integrations
- FAQ Knowledge
backend/models/Faq.js - Brochure Pages
backend/models/BrochurePage.js - Scraped Pages
backend/models/ScrapedPage.js - Campus Routes
backend/models/CampusRoute.js - User Accounts
backend/models/User.js - Chat Logs
backend/models/ChatLog.js - Google Maps Service
backend/services/googleMaps.js
Other components
- Student / Admin
- Google Gemini
- Google Maps
Connections 33
- Student / Admin → App Router: uses
README.md - App Router → Chat Panel: renders chat
frontend/src/App.jsx - Chat Panel → API Client: sends requests
frontend/src/components/ChatPanel.jsx - Admin Console → API Client: calls API
frontend/src/pages/Admin.jsx - Admin Console → Crawler UI: renders crawler
frontend/src/pages/Admin.jsx - Auth Context → API Client: calls API
frontend/src/contexts/AuthContext.jsx - API Client → Express Server: HTTP requests
- Express Server → Auth Routes: mounts routes
backend/server.js - Express Server → Chat Orchestrator: mounts routes
backend/server.js - Express Server → Admin Routes: mounts routes
backend/server.js - Express Server → Crawl Routes: mounts routes
backend/server.js - Auth Routes → User Accounts: reads and writes
backend/routes/auth.js - Auth Routes → Auth Middleware: protects profile
backend/routes/auth.js - Auth Middleware → User Accounts: loads account
backend/middleware/auth.js - Chat Orchestrator → FAQ Knowledge: searches FAQs
backend/routes/chat.js - Chat Orchestrator → Chat Logs: records chats
backend/routes/chat.js - Chat Orchestrator → Campus Routes: looks up routes
backend/routes/chat.js - Chat Orchestrator → RAG Retrieval: retrieves context
backend/routes/chat.js - Chat Orchestrator → Semantic Cache: checks and saves
backend/routes/chat.js - Chat Orchestrator → Gemini Service: generates reply
backend/routes/chat.js - Chat Orchestrator → Google Maps Service: resolves distance
backend/routes/chat.js - RAG Retrieval → Brochure Pages: searches pages
backend/services/rag.js - RAG Retrieval → Scraped Pages: searches pages
backend/services/rag.js - RAG Retrieval → Gemini Service: embeds query
backend/services/rag.js - Gemini Service → Google Gemini: requests generation
backend/services/gemini.js - Google Maps Service → Google Maps: requests directions
- Crawl Routes → Scraped Pages: stores crawl pages
backend/routes/crawl.js - Crawl Routes → FAQ Knowledge: creates FAQs
backend/routes/crawl.js - Crawl Routes → Gemini Service: extracts content
backend/routes/crawl.js - Admin Routes → Brochure Pages: manages uploads
backend/routes/admin.js - Admin Routes → Chat Logs: reads conversations
backend/routes/admin.js - Admin Routes → Gemini Service: generates embeddings
backend/routes/admin.js - Google Maps Service → Campus Routes: uses route data
backend/services/googleMaps.js