A professional full-stack web application that analyzes posture in real-time using AI-powered pose detection. The app can detect bad posture during squats and desk sitting, providing instant feedback to help improve form and prevent injuries
Local Development:
- Frontend: http://localhost:3000
- Backend API: http://localhost:3001
Deployed Application: https://posture.app.pitifulhawk.xyz/
Demo Video: https://youtu.be/i6ubbymcaVk
- React 19 - Modern React with hooks
- TypeScript - Type-safe development
- Tailwind CSS - Utility-first CSS framework
- Bun - Fast JavaScript runtime and package manager
- Radix UI - Accessible component primitives
- Node.js/Bun - JavaScript runtime
- Express.js - Web application framework
- TypeScript - Type-safe server development
- TensorFlow.js - Machine learning in JavaScript
- MediaPipe Models - Pose detection via @tensorflow-models/pose-detection
- TensorFlow.js - Client-side and server-side ML
- MoveNet - Lightweight pose detection model
- Rule-based Analysis - Custom posture evaluation logic
- Webcam Integration - Live camera feed with real-time posture analysis
- Instant Feedback - Immediate detection of posture issues
- Visual Indicators - Clear visual feedback for good/bad posture
- File Upload - Support for MP4, WebM, AVI, MOV formats
- Batch Processing - Analyze entire videos frame by frame
- Summary Reports - Overall posture score and detailed breakdown
- Squat Analysis
- Knee-over-toe detection
- Back angle monitoring
- Depth assessment
- Sitting Posture Analysis
- Forward head posture detection
- Slouching identification
- Neck angle monitoring
- Auto-detection - Automatically determines if user is squatting or sitting
- Manual Mode Selection - Override auto-detection for specific analysis
- Responsive Design - Works on desktop and mobile devices
- Bun (latest version) - Install Bun
- Node.js 18+ (if not using Bun)
- Git
-
Clone the repository
git clone https://github.com/PITIFULHAWK/Posture_Detection.git cd Realfy_Oasis -
Install Dependencies
Install individually:
# Backend dependencies cd backend && bun install # Frontend dependencies cd frontend && bun install
Start servers individually
# Terminal 1: Backend
cd backend && bun run dev
# Backend runs on http://localhost:3001
# Terminal 2: Frontend
cd frontend && bun run dev
# Frontend runs on http://localhost:3000Open your browser
Navigate to http://localhost:3000 to use the application
Note: If using node or npm please change the commands in the package.json
- Select "Squat" mode or use "Auto Detect"
- Position yourself sideways to the camera
- Ensure your full body is visible in the frame
- Start analysis and perform squats
- Watch for real-time feedback on:
- Knee position relative to toes
- Back straightness
- Squat depth
- Select "Sitting" mode or use "Auto Detect"
- Sit facing the camera
- Ensure your upper body is clearly visible
- Start analysis while maintaining normal posture
- Monitor feedback for:
- Forward head posture
- Slouching detection
- Neck angle
- Switch to "Upload" mode
- Select a video file (max 100MB)
- Choose posture type
- Click "Analyze Video"
- Review comprehensive analysis results
GET /health- Health check endpointPOST /api/analyze-frame- Analyze single image framePOST /api/analyze-video- Analyze uploaded video file
- Knee-over-toe: Knee should not extend beyond ankle in forward direction
- Back angle: Torso should maintain 150°+ angle with thighs
- Depth: Knee angle assessment for proper squat depth
- Neck angle: Head should not be more than 30° forward from vertical
- Back straightness: Shoulder-to-hip alignment within 20° of vertical