How krupashetty004/khel-khoj-ai works
Khel-Khoj AI is a sports-video analysis product with a Next.js client, Express/MongoDB account and job API, and a Python analysis service. The documented user journey is upload, create and process a job, save analysis artifacts, then poll and display metrics and a report. The AI pipeline includes frame and pose processing, activity classification and metrics, optional similarity lookup, and report generation. Some links are based on README documentation or SOURCE INDEX references; unsampled implementation details are not inferred beyond those connections.
Main entry points: pipeline_runner.py Pipeline runner · page.tsx Video analysis UI · userController.js User profiles · main.py Analysis API
Components 29
Web app
- Video analysis UI
my-next-app/src/app/analyze/page.tsx - Athlete history
my-next-app/src/app/athletes/page.tsx - Athlete profile
my-next-app/src/app/athletes/[id]/page.tsx - Sign-in
my-next-app/src/app/login/page.tsx - Auth context
my-next-app/src/context/AuthContext.tsx
Backend API
- Express server
backend/src/server.js - Job routes
backend/src/routes/jobs.js - Job controller
backend/src/controllers/jobController.js - Job orchestration
backend/src/services/jobService.js - Analysis jobs
backend/src/models/AnalysisJob.js - User routes
backend/src/routes/users.js - User profiles
backend/src/controllers/userController.js - User records
backend/src/models/User.js - Athlete records
backend/src/models/Athlete.js
Video analysis
- Analysis API
python-api/main.py - Celery tasks
python-api/tasks.py - Pipeline runner
python-api/khelkhoj_ai/pipeline_runner.py - Frame extraction
python-api/khelkhoj_ai/pipeline/frame_extractor.py - Pose estimation
python-api/khelkhoj_ai/pipeline/pose_estimator.py - Action classifier
python-api/khelkhoj_ai/pipeline/action_classifier.py - Activity tracking
python-api/khelkhoj_ai/pipeline/activity_logic_controller.py - Exercise metrics
python-api/khelkhoj_ai/metrics/exercise.py - Motion metrics
python-api/khelkhoj_ai/metrics/motion.py - Analysis artifacts
python-api/khelkhoj_ai/storage/artifacts.py - Athlete similarity
python-api/khelkhoj_ai/vector/store.py - Report generation
python-api/khelkhoj_ai/report/generator.py - Report schema
python-api/khelkhoj_ai/report/schema.py - Report provider
python-api/khelkhoj_ai/providers/providers.py
Other components
- Athlete / coach
Connections 31
- Athlete / coach → Video analysis UI: uploads video
README.md - Video analysis UI → Job routes: creates job
README.md - Job routes → Job controller: routes requests
backend/src/routes/jobs.js - Job controller → Job orchestration: creates / polls
backend/src/controllers/jobController.js - Job orchestration → Analysis jobs: persists job
backend/src/services/jobService.js - Job orchestration → Analysis API: submits / polls
backend/src/services/jobService.js - Analysis API → Pipeline runner: runs analysis
python-api/main.py - Pipeline runner → Frame extraction: extracts frames
python-api/khelkhoj_ai/pipeline_runner.py - Pipeline runner → Pose estimation: estimates poses
python-api/khelkhoj_ai/pipeline_runner.py - Pipeline runner → Action classifier: classifies actions
python-api/khelkhoj_ai/pipeline_runner.py - Pipeline runner → Activity tracking: tracks activity
python-api/khelkhoj_ai/pipeline_runner.py - Pipeline runner → Exercise metrics: calculates metrics
python-api/khelkhoj_ai/pipeline_runner.py - Pipeline runner → Motion metrics: calculates motion
python-api/khelkhoj_ai/pipeline_runner.py - Pipeline runner → Analysis artifacts: saves artifacts
python-api/khelkhoj_ai/pipeline_runner.py - Pipeline runner → Athlete similarity: queries similarity
python-api/khelkhoj_ai/pipeline_runner.py - Pipeline runner → Report generation: generates report
python-api/khelkhoj_ai/pipeline_runner.py - Report generation → Report schema: builds report
python-api/khelkhoj_ai/report/generator.py - Report generation → Report provider: requests narrative
python-api/khelkhoj_ai/report/generator.py - Job controller → Video analysis UI: returns job status
README.md - Video analysis UI → Analysis API: polls results
README.md - Video analysis UI → Athlete history: shows history
README.md - Athlete / coach → Sign-in: signs in
README.md - Sign-in → Auth context: uses auth state
- Express server → Job routes: mounts routes
backend/src/server.js - Express server → User routes: mounts routes
backend/src/server.js - User routes → User profiles: routes requests
- User profiles → User records: reads / writes
backend/src/controllers/userController.js - User profiles → Athlete records: updates profiles
backend/src/controllers/userController.js - User profiles → Analysis jobs: lists user jobs
backend/src/controllers/userController.js - Celery tasks → Pipeline runner: runs pipeline
python-api/tasks.py - Analysis API → Celery tasks: dispatches work