How cmcecora/aipad works
Project type and purpose
• This is a full-stack mobile/web application built on Expo (React Native + web via expo-router) with a lightweight Node.js “sync” backend.
• Purpose: record tennis match videos, detect and analyze court lines, produce analytics and reports, and synchronize recordings via a central sync server.
File structure
Top-level:
• app/ – Expo Router pages and layout for tabs (analytics, matches, settings, calibration, record, upload, video-player, etc.)
• components/ – Reusable React Native UI components and domain‐specific engines (AIAnalysisEngine, RaydelRatingEngine, SyncManager, VideoRecorder).
• hooks/ – Custom React hooks (useFrameworkReady, useVideoRecording).
• utils/ – Pure utility modules for video processing and court-line detection.
• assets/ – Static images.
• server/ – Node.js sync server (sync-server.js), with its own package.json and README.
• config files – .env.example, tsconfig.json, app.json, .prettierrc, etc.
README insights
• Front-end is an Expo project; run with npm run dev, supports iOS/Android/web.
• Uses expo-router for filesystem-based routing.
• Server is a standalone Node.js process for synchronizing recordings (no mention of a DB, so likely file-based or in-memory).
a. Main components
1. Mobile/Web Client (Expo App)
– UI Layers: Tabs (Matches, Analytics, Settings)
– VideoRecorder component
– SyncManager component
– AIAnalysisEngine & RaydelRatingEngine (client-side processing)
2. Sync Server (Node.js)
– HTTP/WS endpoints to receive and serve video assets
3. (Optional) Storage layer
– File system or S3 bucket behind the sync server (if extended)
4. External services
– Expo Go / Device Simulators
b. Relationships & interactions
1. User interacts with Expo App UI → triggers VideoRecorder
2. VideoRecorder produces raw video data → passed to SyncManager
3. SyncManager sends video data over HTTP/WS to Sync Server
4. Sync Server stores video and returns acknowledgement or URL
5. Upon storage, AIAnalysisEngine & RaydelRatingEngine analyze the video locally or fetch data back from server
6. Results flow back into the UI (Analytics page)
7. Utilities (courtLineDetector, videoUtils) are invoked by analysis engines
c. Architectural patterns & principles
– Separation of concerns: UI vs recording vs sync vs analysis
– Filesystem-based routing (expo-router) for the client
– Modular engines (AIAnalysisEngine, RaydelRatingEngine) encapsulate domain logic
– Thin synchronization service (microservice style)
d. Key technologies/frameworks
– Expo (React Native + web) with expo-router
– React Hooks & TypeScript
– Node.js sync server (Express or built-in HTTP)
– Custom computer-vision modules in utils/components