How tayyabsohail/physiovision-ai-powered-physiotherapy-system works
Main Components
• Client Layer (Web Browser/Mobile App)
– React + Vite + Tailwind UI
– Video-capture module for live posture streaming
– Chat interface for RAG-based chatbot
• API Gateway / Load Balancer
– Single ingress point for all HTTP/WebSocket requests
– Routes requests to auth, chatbot, CV, progress-tracking services
• Authentication & User Management Service
– SignUp / SignIn / Forgot-Password flows
– Issues JWTs or OAuth tokens
• Chatbot Service (Adaptive RAG)
– Query Handler
– Retriever (Vector Database)
– LLM Interface (e.g., OpenAI, HuggingFace)
– Bilingual NLP / Translation submodule
• Computer Vision Service
– Inference Engine running Deep-Learning Pose-Estimation models (Leg Raises, Lunges, Squats, Warrior Pose)
– Real-time analysis & audio-visual feedback generator
• Progress Tracking & Analytics Service
– Stores session data, exercise performance, user progress metrics
– Exposes REST/WebSocket APIs for frontend dashboards
• Data Layer
– Relational or NoSQL Database (Users, Sessions, Progress)
– Vector Database (embeddings for RAG retrieval)
– Object Storage or Blob Storage (video snapshots, logs)
• External/Third-Party Services
– LLM Provider API
– CDN for static frontend assets
– Monitoring / Logging / Alerting (Prometheus, Grafana, ELK)
Relationships & Data Flows
a. User ↔ Frontend: HTTP(S) for UI, WebSocket/MediaStream for live video
b. Frontend → API Gateway: routes to
• Auth Service for login/signup
• Chatbot Service for recommendations
• CV Service for posture analysis
• Tracking Service for saving progress
c. Chatbot Service → Vector DB & LLM API: retrieval + generation
d. CV Service → Deep-Learning Models → Feedback → Frontend
e. Tracking Service → Database → Frontend dashboards
f. Shared Data Layer: all services read/write to central DB(s)
Architectural Patterns
• Microservices: each major feature is its own service; independently deployable
• API-First Design: consistent REST/WebSocket contracts
• RAG Pattern: separates retrieval (Vector DB) from generation (LLM)
• Real-Time Streaming: video frames via WebRTC or WebSockets to CV service
• Event-Driven Progress Tracking: emit events on exercise completion
Technologies & Frameworks (annotate near each component)
• Frontend: React, Vite, Tailwind CSS
• Auth: JWT / OAuth
• Chatbot: Python/NodeJS service, FAISS or Pinecone (Vector DB), OpenAI API
• CV: TensorFlow/PyTorch models, FastAPI/gRPC service
• Database: PostgreSQL/MongoDB; Redis cache (optional)
• Storage: AWS S3/GCP Cloud Storage
• Message Bus (optional): Kafka or RabbitMQ for async events