How shuvam-11/bis-sahayak-ai works
Purpose and Entry Points
BIS Sahayak AI is a React/TypeScript assistant for navigating Indian Standards and BIS services. The browser app starts at src/main.tsx, renders the application shell in src/App.tsx, and is hosted through the Vite setup. A separate Node/Express backend entry point exists at server.ts, likely serving Gemini/RAG requests and keeping API credentials outside the browser.
Application Shell and Navigation
The UI is organized as a single application surface with navigation, hero content, dashboard-style actions, and footer:
• src/App.tsx
• src/components/Navbar.tsx
• src/components/Dashboard.tsx
• src/components/Footer.tsx
Dashboard.tsx and reusable src/components/QuickActionCard.tsx likely route users into specialized BIS assistance workflows rather than separate application deployments.
Conversational AI and Evidence Boundary
The core AI interaction is represented by:
• src/components/ChatInterface.tsx
• src/services/ragEngine.ts
• src/components/SourcePanelDrawer.tsx
The RAG engine is the central knowledge-retrieval boundary: it should retrieve BIS-grounded material before generating an answer. The source drawer exposes supporting references to the user. This implements the repository’s “Source or Refuse” principle: answer only when evidence is available, otherwise communicate lack of verified support.
Knowledge Corpus and Domain Types
The embedded BIS knowledge layer is defined by:
• src/data/bisKnowledgeBase.ts
• src/types/index.ts
• src/components/AdminKnowledge.tsx
bisKnowledgeBase.ts is the primary local/domain data source for retrieval and guided assistance. Shared types define contracts between UI, RAG processing, sources, and responses. AdminKnowledge.tsx is the likely management/inspection interface for knowledge content, making knowledge quality a distinct boundary from chat presentation.
Specialized BIS Workflows
Domain-specific assistant panels encapsulate major user journeys:
• src/components/StandardFinder.tsx
• src/components/CertificationGuide.tsx
• src/components/TestingLabAssistant.tsx
• src/components/HallmarkingAssistant.tsx
• src/components/ConsumerHelp.tsx
These components collect task-specific context and present tailored guidance for standards discovery, certification, laboratory/testing, hallmarking/HUID, and consumer concerns. They should converge on the same RAG/evidence flow rather than independently owning knowledge or model integration.
Trust, Localization, and Experience Controls
Trust and language concerns are first-class UI concerns:
• src/components/ResponsibleAIModal.tsx
• src/i18n/translations.ts
• src/components/KnowledgeCore3D.tsx
The responsible-AI modal communicates behavioral limits and provenance expectations. The translations module centralizes multilingual UI content. KnowledgeCore3D.tsx, alongside src/components/HeroSection.tsx and src/components/HowItWorks.tsx, provides explanatory/onboarding presentation around the knowledge system.
Runtime and External Dependencies
The frontend runs on React, TypeScript, and Vite (src/main.tsx, vite.config.ts); styling is described as Tailwind-based. The backend runtime is Node.js with Express (server.ts). Google Gemini is the external model service, accessed behind the server-side/RAG boundary. Deployment is intended for Vercel, while environment configuration is represented by .env.example.
Components 21
Browser Application
- Vite host
vite.config.ts - Browser entry
src/main.tsx - Application shell
src/App.tsx - Navigation & footer
src/components/Navbar.tsx - Dashboard actions
src/components/Dashboard.tsx - Hero & onboarding
src/components/HeroSection.tsx - Chat interface
src/components/ChatInterface.tsx - Source drawer · Shows supporting references for answers.
src/components/SourcePanelDrawer.tsx - Responsible AI notice
src/components/ResponsibleAIModal.tsx - Translations
src/i18n/translations.ts
BIS Workflows
- Standard finder
src/components/StandardFinder.tsx - Certification guide
src/components/CertificationGuide.tsx - Testing lab assistant
src/components/TestingLabAssistant.tsx - Hallmarking assistant
src/components/HallmarkingAssistant.tsx - Consumer help
src/components/ConsumerHelp.tsx
Knowledge & Evidence
- RAG engine · Retrieves evidence before answering or refuses when unsupported.
src/services/ragEngine.ts - BIS knowledge base
src/data/bisKnowledgeBase.ts - Shared domain types
src/types/index.ts - Knowledge admin
src/components/AdminKnowledge.tsx
Server & Model
- Express API · Keeps model credentials outside the browser.
server.ts - Google Gemini
Connections 25
- Vite host → Browser entry: hosts
- Browser entry → Application shell: renders
- Application shell → Navigation & footer: composes
- Application shell → Dashboard actions: composes
- Application shell → Hero & onboarding: composes
- Application shell → Chat interface: hosts
- Application shell → Responsible AI notice: presents
- Application shell → Translations: uses
- Dashboard actions → Standard finder: opens
- Dashboard actions → Certification guide: opens
- Dashboard actions → Testing lab assistant: opens
- Dashboard actions → Hallmarking assistant: opens
- Dashboard actions → Consumer help: opens
- Chat interface → RAG engine: submits questions
- Standard finder → RAG engine: requests guidance
- Certification guide → RAG engine: requests guidance
- Testing lab assistant → RAG engine: requests guidance
- Hallmarking assistant → RAG engine: requests guidance
- Consumer help → RAG engine: requests guidance
- RAG engine → BIS knowledge base: retrieves evidence
- RAG engine → Shared domain types: uses contracts
- RAG engine → Express API: sends grounded requests
- Express API → Google Gemini: invokes
- Chat interface → Source drawer: shows citations
- Knowledge admin → BIS knowledge base: inspects knowledge