{"id":26690241,"url":"https://github.com/invincible1602/ayuryoga","last_synced_at":"2026-04-12T21:51:29.456Z","repository":{"id":263474996,"uuid":"890523785","full_name":"Invincible1602/AyurYoga","owner":"Invincible1602","description":"A comprehensive web application that provides personalized yoga recommendations and a conversational chatbot to answer questions about yoga, health, and wellness using FastAPI, React, JWT authentication, FAISS, and Hugging Face models.","archived":false,"fork":false,"pushed_at":"2025-03-17T12:37:52.000Z","size":13173,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-17T12:44:24.420Z","etag":null,"topics":["fastapi","huggingface-transformers","machine-learning","nlp","ollama","reactjs"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Invincible1602.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-18T18:04:52.000Z","updated_at":"2025-03-17T12:37:56.000Z","dependencies_parsed_at":"2024-11-18T19:23:10.024Z","dependency_job_id":"a2dfa4e0-8c36-46a7-8216-f36adee1182d","html_url":"https://github.com/Invincible1602/AyurYoga","commit_stats":null,"previous_names":["invincible1602/ayuryoga"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Invincible1602%2FAyurYoga","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Invincible1602%2FAyurYoga/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Invincible1602%2FAyurYoga/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Invincible1602%2FAyurYoga/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Invincible1602","download_url":"https://codeload.github.com/Invincible1602/AyurYoga/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245680104,"owners_count":20654965,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fastapi","huggingface-transformers","machine-learning","nlp","ollama","reactjs"],"created_at":"2025-03-26T15:26:56.254Z","updated_at":"2026-04-12T21:51:29.365Z","avatar_url":"https://github.com/Invincible1602.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AyurYoga\n\nAyurYoga is a web application that provides personalized yoga recommendations and a conversational chatbot to answer questions about yoga, health, and wellness. Built with a FastAPI backend and a React frontend, the application offers secure JWT-based authentication, efficient similarity search using FAISS, and leverages a Hugging Face model to generate dynamic responses.\n\n## Features\n\n- **User Authentication:**  \n  Secure registration and login using JWT. Protected routes are accessible only when authenticated.\n\n- **Yoga Recommendations:**  \n  Get personalized yoga asana recommendations based on your health conditions and preferences.\n\n- **Chatbot Interface:**  \n  Ask questions related to yoga, health, and wellness. The chatbot retrieves relevant context via FAISS and generates structured responses using a Hugging Face model.\n\n- **Efficient Similarity Search:**  \n  FAISS is used to quickly search and retrieve relevant context from precomputed text data.\n\n- **Yoga Image Generator:**\n  Use our image generator feature to search for yoga-related images by entering a prompt. The generator validates input using allowed keywords (e.g., \"yoga\", \"asana\", \"pranayama\",      etc.) and fetches relevant images from our FastAPI backend.\n\n- **Yoga Pose Shorts:**\n  Explore a collection of yoga poses via an interactive dropdown that displays embedded YouTube Shorts. Select a pose to watch the demonstration video directly on the page.\n\n\n\n## Tech Stack\n\n### Backend\n\n- **FastAPI** – for building the API endpoints.\n- **Python** – primary programming language.\n- **FAISS** – for efficient similarity search.\n- **SentenceTransformer** – for encoding text data.\n- **Hugging Face Inference API** – for generating dynamic responses.\n- **JWT** – for secure authentication (using jose and passlib).\n\n### Frontend\n\n- **React** – for building the user interface.\n- **React Router** – for handling client-side routing.\n- **Axios** – for making HTTP requests.\n\n\n## Installation\n\n### Prerequisites\n\n- **Backend:** Python 3.8+ and pip\n- **Frontend:** Node.js and npm\n\n### Backend Setup\n\n1. **Clone the repository and navigate to the backend directory:**\n   ```bash\n   git clone \u003crepository-url\u003e\n   cd \u003crepository-directory\u003e/backend\n   ```\n   \n\n2. **Create a virtual environment and install dependencies:**\n   ```bash\n   python -m venv venv\n   source venv/bin/activate  # On Windows: venv\\Scripts\\activate\n   pip install -r requirements.txt\n   ```\n   \n\n4. **Ensure required files are in place:**\n   - `faiss_index.pkl`\n   - `text_data.pkl`\n   - `yoga_asanas_and_diseases.csv`\n\n6. **Create a \\`.env\\` file in the backend folder with the following variables:**\n   ```env\n   SECRET_KEY=your_secret_key\n   HUGGINGFACE_API_KEY=your_huggingface_api_key\n   ```\n   \n\n7. **Run the FastAPI server:**\n   ```bash\n   uvicorn main:app --host 0.0.0.0 --port=8000 --reload\n   ```\n   \n\n### Frontend Setup\n\n1. **Navigate to the frontend directory:**\n   ```bash\n   cd ../yoga-website\n   ```\n   \n\n2. **Install frontend dependencies:**\n   ```bash\n   npm install\n   ```\n   \n\n4. **Create a \\`.env\\` file in the frontend directory with:**\n   ```env\n   REACT_APP_API_BASE_URL=http://localhost:8000\n   ```\n\n6. **Start the React development server:**\n   ```bash\n   npm start\n   ```\n   \n\n## Usage\n\n- **Signup:**  \n  Create a new account via the signup page.\n\n- **Login:**  \n  Log in with your credentials. The token will be saved in localStorage and the authentication context will update immediately—no refresh needed!\n\n- **Yoga Recommendations:**  \n  Access the recommender page to receive personalized yoga asana suggestions based on selected health conditions.\n\n- **Chatbot:**  \n  Ask any questions about yoga, health, or wellness via the chatbot page. The chatbot uses FAISS to retrieve relevant context and generates responses via a Hugging Face model.\n\n## Folder Structure\n\n```bash\n├── backend\n│   ├── main.py                     # FastAPI backend code\n│   ├── faiss_index.pkl             # FAISS index file\n│   ├── text_data.pkl               # Text data for FAISS search\n│   ├── yoga_asanas_and_diseases.csv# CSV file with asanas and diseases\n│   ├── .env                        # Environment variables for backend\n│   └── requirements.txt\n└── yoga-website\n    ├── src\n    │   ├── App.js                  # Main React app\n    │   ├── screens                 # React screens (HomePage, Recommender, Chatbot, LoginScreen, SignupScreen, About)\n    │   └── utils                   # AuthProvider, ProtectedRoute, API utilities\n    ├── public\n    └── package.json\n```\n\n\n## Troubleshooting\n\n- **Token Not Updating After Login:**  \n  Ensure the token is stored under the same key (e.g., \"token\") and that the AuthProvider decodes the token and updates the user state immediately.\n\n- **\"Could Not Validate Credentials\" Error:**  \n  Verify that your protected routes receive the token in the Authorization header or query parameters. The backend’s \\`get_current_user\\` dependency now accepts tokens from both sources.\n\n- **FAISS or Model Loading Errors:**  \n  Make sure the required FAISS index and text data files exist and are in the correct format.\n\n- **CORS Issues:**  \n  Adjust the CORS middleware in FastAPI as needed for your production environment.\n\n## License\n\nThis project is licensed under the MIT License.\n\n## Acknowledgements\n\n- [FastAPI](https://fastapi.tiangolo.com/)\n- [React](https://reactjs.org/)\n- [Hugging Face](https://huggingface.co/)\n- [FAISS](https://github.com/facebookresearch/faiss)\n- [SentenceTransformers](https://www.sbert.net/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finvincible1602%2Fayuryoga","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finvincible1602%2Fayuryoga","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finvincible1602%2Fayuryoga/lists"}