How pitchayuttp/ai-snooker works
This is a modular snooker-training product: learners choose an exercise, check camera readiness, train against computer-vision analysis, receive feedback, and review saved results. The graph combines that documented workflow with the sampled frontend and backend composition, training, and reporting code. Several domain modules are indexed but unsampled, so their relationships are shown only where the README or source references support them.
Main entry points: main.py API composition · runtime.py Live runtime · Workspace.jsx Training workspace · training.py Training API
Components 29
Learner interface
- App and auth
frontend/ai-snooker/src/App.jsx - Training workspace
frontend/ai-snooker/src/Workspace.jsx - Training display
frontend/ai-snooker/src/pages/TrainingPage.jsx - UI components
frontend/ai-snooker/src/components/ui.jsx
Exercise setup
- Exercise setup
frontend/ai-snooker/src/pages/SetupPage.jsx - Camera configuration
frontend/ai-snooker/src/components/CameraSetup.jsx - Module settings
frontend/ai-snooker/src/lib/moduleSettings.js
Training analysis
- Live runtime
backend/app/runtime.py - Vision processing
backend/app/vision.py - M1 assessment
backend/app/m1_assessment.py - M2 follow-through
backend/app/m2_follow_through.py - M3 monitoring
backend/app/m3_monitor.py - Assessment protocol
backend/app/protocol.py - Criteria templates
backend/app/criteria_templates.py - Ball colour detection
backend/app/colour.py
Backend services
- API client
frontend/ai-snooker/src/lib/api.js - API composition
backend/app/main.py - Authentication
backend/app/auth.py - Exercise catalog
backend/app/api/catalog.py - Camera API
backend/app/api/cameras.py - Training API
backend/app/api/training.py
Results and history
- Training database
backend/app/database.py - Reports API
backend/app/api/reports.py - Report assembly
backend/app/services/reporting.py - Progress queries
backend/app/repositories/report_queries.py - History and progress
frontend/ai-snooker/src/pages/HistoryPage.jsx - Lesson feedback
backend/app/lessons.py - Evidence recordings
backend/app/recordings.py
Other components
- Learner
Connections 33
- Learner → App and auth: uses
- App and auth → Training workspace: opens
frontend/ai-snooker/src/App.jsx - Training workspace → Exercise setup: presents setup
frontend/ai-snooker/src/Workspace.jsx - Training workspace → Training display: presents training
frontend/ai-snooker/src/Workspace.jsx - Training workspace → API client: requests data
frontend/ai-snooker/src/Workspace.jsx - Exercise setup → Camera configuration: renders
frontend/ai-snooker/src/pages/SetupPage.jsx - Exercise setup → Module settings: configures
frontend/ai-snooker/src/pages/SetupPage.jsx - Camera configuration → API client: sends settings
frontend/ai-snooker/src/components/CameraSetup.jsx - API client → API composition: calls API
- API composition → Authentication: registers router
backend/app/main.py - API composition → Exercise catalog: registers router
backend/app/main.py - API composition → Camera API: registers router
backend/app/main.py - API composition → Training API: registers router
backend/app/main.py - API composition → Reports API: registers router
backend/app/main.py - Exercise catalog → Training database: reads catalog
backend/app/api/catalog.py - Training API → Live runtime: controls session
backend/app/api/training.py - Camera API → Live runtime: controls camera
backend/app/api/cameras.py - Live runtime → Vision processing: processes frames
backend/app/runtime.py - Live runtime → M1 assessment: uses assessment
backend/app/runtime.py - Live runtime → M2 follow-through: uses monitor
backend/app/runtime.py - Live runtime → M3 monitoring: uses monitor
backend/app/runtime.py - Training API → Training database: stores results
backend/app/api/training.py - Training API → Assessment protocol: evaluates attempts
backend/app/api/training.py - Reports API → Report assembly: assembles detail
backend/app/api/reports.py - Report assembly → Training database: reads measurements
backend/app/services/reporting.py - Report assembly → Lesson feedback: gets feedback
backend/app/services/reporting.py - Progress queries → Training database: queries progress
backend/app/repositories/report_queries.py - Reports API → Progress queries: uses queries
backend/app/repositories/report_queries.py - History and progress → API client: loads history
- Reports API → Evidence recordings: serves evidence
backend/app/api/reports.py - Assessment protocol → Criteria templates: uses templates
backend/app/protocol.py - Vision processing → Ball colour detection: detects balls
- Training display → UI components: renders controls