AsanaAlign is a web-based yoga posture alignment application that helps users practice yoga with real-time pose detection. It uses the webcam to detect body posture and provides an interactive experience for improving yoga form and alignment.
- π§ Real-time yoga pose detection
- π· Webcam-based posture tracking
- π€ TensorFlow.js powered pose estimation
- βοΈ React + Vite frontend
- π Node.js + Express backend
- ποΈ MongoDB database integration
- π User authentication support
- π± Clean and responsive UI
- React.js
- Vite
- React Router DOM
- TensorFlow.js
- TensorFlow Pose Detection
- React Webcam
- Lucide React
- Node.js
- Express.js
- MongoDB
- bcryptjs
- dotenv
- CORS
AsanaAlign/
β
βββ backend/
β βββ server.js
β βββ package.json
β βββ ...
β
βββ frontend/
β βββ src/
β βββ package.json
β βββ ...
β
βββ render.yaml
βββ .gitignore
βββ README.mdgit clone https://github.com/anujsharma8d/AsanaAlign.git
cd AsanaAlignGo to the backend folder:
cd backendInstall dependencies:
npm installCreate a .env file inside the backend folder:
PORT=3000
NODE_ENV=development
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secretStart the backend server:
npm run devIf npm run dev does not work, run:
npm startThe backend server will run on:
http://localhost:3000Open a new terminal and go to the frontend folder:
cd frontendInstall dependencies:
npm installCreate a .env file inside the frontend folder:
VITE_API_URL=http://localhost:3000Start the frontend development server:
npm run devThe frontend will usually run on:
http://localhost:5173If both frontend and backend are running on the same port, change the frontend port to 5173.
In frontend/package.json, you can use:
"scripts": {
"dev": "vite --port 5173",
"start": "vite --port 5173",
"build": "vite build",
"preview": "vite preview"
}| Variable | Description |
|---|---|
PORT |
Backend server port |
NODE_ENV |
Application environment |
MONGODB_URI |
MongoDB connection string |
JWT_SECRET |
Secret key for authentication |
| Variable | Description |
|---|---|
VITE_API_URL |
Backend API URL |
Run the backend server:
npm startRun the backend server in development mode:
npm run devRun the frontend development server:
npm run devBuild the frontend for production:
npm run buildPreview the production build locally:
npm run preview- The user opens the web application.
- The app asks for webcam access.
- TensorFlow.js detects body keypoints.
- The app analyzes the yoga posture.
- The user gets visual feedback to improve posture alignment.
This project includes a render.yaml file for deployment.
Use the following settings:
Root Directory: backend
Build Command: npm install
Start Command: node server.jsAdd the required environment variables in your deployment platform:
PORT=3000
NODE_ENV=production
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secretUse the following settings:
Root Directory: frontend
Build Command: npm install && npm run build
Publish Directory: distAdd the frontend environment variable:
VITE_API_URL=your_backend_deployed_url- Add more yoga asanas
- Improve posture accuracy
- Add AI-based pose correction suggestions
- Add mobile-friendly improvements
- Add voice-based posture guidance
- Add personalized yoga plans
Contributions are welcome.
To contribute:
- Fork the repository
- Create a new branch
git checkout -b feature-name- Make your changes
- Commit your changes
git commit -m "Add feature-name"- Push to your branch
git push origin feature-name- Create a Pull Request
This project is open-source. You can add a license file to define usage permissions clearly.
Anuj Sharma
- GitHub: anujsharma8d
If you like this project, consider giving it a star β on GitHub.