Advanced AI-driven fitness companion that tracks your workouts, analyzes form, and visualizes progress in 3D. Proudly participating in GirlScript Summer of Code 2026!
Features • Tech Stack • Installation • Usage • FAQ • Contributing • License
SpectraX is a cutting-edge fitness application that uses MediaPipe Pose Detection and Three.js to provide real-time workout tracking and form analysis. It doesn't just track your body; it understands your movement, counts reps (like squats), detects mistakes, and provides immersive 3D visual feedback.
The project features a full-stack architecture with a React frontend and an Express/Socket.io backend for real-time data processing and cross-device synchronization.
- 🏋️ Intelligent Rep Counting: Automatically detects and counts exercises like squats, pushups, and more.
- 📐 Form Analysis: Real-time feedback on exercise posture and "rep scores" based on accuracy.
- 🎥 3D Body Mapping: Immersive 3D skeleton rendering with WebGL/Three.js.
- 🔍 Auto-Exercise Detection: Uses AI to detect which exercise you are performing without manual selection.
- 📊 Workout Summary: Detailed post-workout analytics including rep streaks, duration, and accuracy.
- 🔄 Replay System: Review your performance with our built-in replay feature.
- ⚡ Real-Time Sync: Low-latency communication between frontend and backend via WebSockets.
The SpectraX landing page — initialize your session or view workout history.
Select from 5 exercises. Live camera preview updates as you choose.
Real-time pose detection ready for bicep curl tracking.
Plank hold detection with live camera feed.
Push-up rep counting with form analysis.
Review past workout sessions and track your progress over time.
- Framework: React 18
- State Management: React Hooks & Context
- 3D Graphics: Three.js
- AI/ML: MediaPipe Pose, Transformers.js
- Icons: Lucide React
- Server: Express.js
- Real-Time: Socket.io
- Language: Node.js (CommonJS)
| Category | Technologies |
|---|---|
| Frontend | React 18, TypeScript, Vite |
| Backend | Node.js, Express.js, Socket.io |
| AI/ML | MediaPipe Pose, Transformers.js |
| 3D Rendering | Three.js, WebGL |
| State Management | React Context API |
| Icons | Lucide React |
SpectraX uses computer vision and real-time pose estimation to analyze body movement during workouts.
- 📷 Camera frames are captured in real time.
- 🦴 MediaPipe Pose extracts 33 body landmarks.
- 📐 Joint angles are calculated using landmark coordinates.
- 🤖 AI logic detects the current exercise automatically.
- 🔢 Rep counting algorithms track movement cycles.
- 🎯 Form analysis evaluates posture accuracy.
- 🎥 Three.js renders a live 3D body skeleton.
- ⚡ Socket.io synchronizes workout data in real time.
This pipeline allows SpectraX to deliver immersive AI-powered fitness tracking directly in the browser.
spectrax_1/
│── public/ # Static assets
│── src/
│ ├── components/ # Reusable React components
│ ├── pages/ # Application pages
│ ├── hooks/ # Custom React hooks
│ ├── context/ # Global state/context
│ ├── utils/ # Helper functions
│ ├── services/ # API and socket services
│ └── styles/ # Styling files
│
│── server/ # Express + Socket.io backend
│── assets/ # Screenshots and media
│── README.md
│── package.json-
Clone the Repo
git clone https://github.com/Somil450/spectrax_1.git cd spectrax_1 -
Setup Frontend
npm install
-
Setup Backend
cd server npm install cd ..
To run SpectraX locally, create environment variable files for both the frontend and backend.
Create a .env file in the root directory:
VITE_BACKEND_URL=http://localhost:3001Create a .env file inside the server/ directory:
PORT=3001Never commit
.envfiles to version control.
Rules are version-controlled in firestore.rules. They are not enforced until they are deployed to your Firebase project. After cloning, run:
npm install -g firebase-tools
firebase login
firebase deploy --only firestore:rulesWithout deploying these rules, the project remains in Firebase test mode (effectively open access). Always deploy them before going to production.
-
Start the Backend
cd server npm run devServer runs on
http://localhost:3001 -
Start the Frontend (In a new terminal)
npm run dev
App runs on
http://localhost:5173 -
Workout Flow
- Welcome: Choose your exercise or let SpectraX auto-detect.
- Calibration: Align yourself with the camera for optimal tracking.
- Workout: Start exercising! Watch your reps count up in real-time.
- Summary: Review your stats and see where you can improve.
Currently supported exercises:
- ✅ Bodyweight Squats
- ✅ Push-Ups
- ✅ Plank
- ✅ Bicep Curls
- Lunges
- Jumping Jacks
- Shoulder Press
- Mountain Climbers
- Burpees
| Metric | Approximate Value |
|---|---|
| Pose Detection FPS | ~30 FPS |
| Rep Counting Accuracy | ~94% |
| Detection Latency | <100ms |
| Supported Resolution | 720p / 1080p |
| Pose Landmarks | 33 Keypoints |
Performance may vary depending on device hardware and lighting conditions.
| Platform | Support |
|---|---|
| Chrome (Desktop) | ✅ Supported |
| Edge | ✅ Supported |
| Firefox | ✅ Supported |
| Android Chrome | ✅ Supported |
| Safari |
For best performance, use the latest version of Chrome with a stable internet connection.
npm run lintPlanned future improvements for SpectraX:
- AI-based calorie estimation
- Multi-person pose tracking
- Voice-guided workout assistant
- Mobile application support
- Cloud workout history sync
- Workout recommendation engine
- User authentication system
- Advanced analytics dashboard
SpectraX is a GSSoC 2026 project and we welcome contributors of all levels!
- Read our CONTRIBUTING.md for the rules of engagement.
- Check the Issues for
level1,level2, orlevel3tasks. - Use the GSSoC Task Request Template when proposing changes.
- Camera data is processed locally in the browser.
- SpectraX does not store raw video footage.
- Only workout analytics and session summaries may be saved.
- No personal biometric data is shared with third parties.
SpectraX combines AI pose estimation, biomechanical analysis, and immersive 3D rendering to create a next-generation browser-based fitness experience.
Unlike traditional fitness trackers, SpectraX provides:
- real-time posture correction
- intelligent rep tracking
- exercise auto-detection
- interactive 3D body visualization
all directly from a webcam without external hardware.
This project is licensed under the MIT License.
SpectraX - The Future of AI Fitness. Made with ❤️ by Somil Jain and our amazing contributors.