How sairohit022001/vidyavahini works
Project Type and Purpose
• Full-stack AI-driven education platform (“VidyaVāhinī”) supporting offline-first, multilingual, multimodal lessons, quizzes, and teacher dashboards.
• Frontend: React + Tailwind (TypeScript, Vite) in /frontend.
• Backend: FastAPI-style Python server (main.py + modules) exposing AI agent APIs.
• AI orchestration: “agents”, “crewflows”, “tasks”, “tools”, “llms” modules to generate content, quizzes, voice.
High-Level File-Structure Analysis
• Top-level:
• frontend/ – React SPA code, UI components, API wrappers (axios)
• agents/ – Prompt templates & agent-level logic
• crewflows/ – Conversational flow orchestrator, memory handlers
• routes/ – HTTP API endpoints
• tasks/ – Service-layer logic mapping API calls → agents/tools
• tools/ – LLM prompt loaders, tool abstractions, dialect adapters
• firestore/ – Firestore configuration, connectors, data utilities
• llms/ – LLM configuration
• main.py – FastAPI app bootstrap
• Dockerfile/docker-compose.yml – Containerization
• generated_audio/ & Audio/ – Local audio assets
Key Insights from README
• Offline-first with local caching & cloud sync (Sync Agent, Firestore).
• Multilingual/dialect voice output (VoiceTutorAgent, dialect maps).
• Teacher dashboards, course planning, analytics (PredictiveAnalyticsAgent, etc.).
a. Main Components
• Frontend SPA
• Backend API Server
• AI Orchestration Layer (Agents, Crewflows, Tasks, Tools)
• LLM Service(s) (e.g., OpenAI)
• Firestore Database
• Local Cache/Memory (offline mode)
• Audio Storage (generated_audio)
• External Cloud Services (GCP for sync, storage)
b. Relationships & Interactions
1. User (Teacher/Student) interacts with Frontend UI →
2. Frontend makes HTTPS calls to Backend API (routes/firestore_routes.py + other routers).
3. Backend routes delegate to Service Layer (tasks/*) → Agent Layer (agents/*) + Crewflows orchestrator.
4. Agents invoke Tools/prompts → llms calls to external LLM API.
5. Results returned through tasks → routes → Frontend.
6. Backend reads/writes persistent data via Firestore Connector (firestore/*).
7. Offline-first: Frontend caches data locally (IndexedDB, service worker) and syncs via SyncAgent.
8. Voice output: Agents call TTS tool → generate audio files → stored in generated_audio → served to Frontend.
c. Architectural Patterns & Principles
• Layered Architecture:
• Presentation (React UI)
• API/Controller (routes/)
• Service (tasks/)
• Domain/Orchestration (agents/, crewflows/)
• Integration (tools/, llms/)
• Data (firestore/)
• Separation of Concerns: clear modular boundaries.
• Offline-First with Synchronization Pattern.
• Plugin-style AI tooling (each Agent/Tool is a pluggable module).
d. Key Technologies & Frameworks
• Frontend: React, TypeScript, Tailwind, Vite, Axios
• Backend: Python 3.x, FastAPI (main.py), Firestore SDK
• AI: Prompt-based agents, OpenAI (or equivalent) via llms/llm_config
• Caching: local memory handler (crewflows/memory/local_memory_handler)
• Voice: Audio files, dialect adapter
• Containerization: Docker, docker-compose, Google Cloud deployment (app.yaml)