├── api ├── .gitignore ├── datasets │ ├── faiss_index.index │ ├── care.csv │ └── meditation.csv ├── requirements.txt ├── main.py └── func.py ├── ayuvritt ├── public │ └── name.png ├── src │ ├── app │ │ ├── favicon.ico │ │ ├── fonts.ts │ │ ├── globals.css │ │ ├── layout.tsx │ │ ├── naturopathy │ │ │ ├── page.tsx │ │ │ ├── routines │ │ │ │ └── page.tsx │ │ │ └── bucketlist │ │ │ │ └── page.tsx │ │ ├── medicine-information │ │ │ └── page.tsx │ │ ├── beauty-care │ │ │ └── page.tsx │ │ ├── yoga-therapies │ │ │ └── page.tsx │ │ ├── events │ │ │ └── page.tsx │ │ ├── meditation │ │ │ └── page.tsx │ │ ├── page.tsx │ │ ├── rising-tree │ │ │ └── page.tsx │ │ ├── get-started │ │ │ └── page.tsx │ │ ├── prescription-analysis │ │ │ └── page.tsx │ │ ├── learn-more │ │ │ └── page.tsx │ │ └── medicine-recommendations │ │ │ └── page.tsx │ └── components │ │ ├── back-button.tsx │ │ ├── search-bar.tsx │ │ ├── leaves.tsx │ │ ├── footer.tsx │ │ └── naturopathy-icons.tsx ├── postcss.config.mjs ├── next.config.ts ├── eslint.config.mjs ├── .gitignore ├── tailwind.config.js ├── package.json ├── tsconfig.json └── README.md └── README.md /api/.gitignore: -------------------------------------------------------------------------------- 1 | __pycache__ 2 | -------------------------------------------------------------------------------- /ayuvritt/public/name.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xditya/camel_case/main/ayuvritt/public/name.png -------------------------------------------------------------------------------- /api/datasets/faiss_index.index: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xditya/camel_case/main/api/datasets/faiss_index.index -------------------------------------------------------------------------------- /ayuvritt/src/app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xditya/camel_case/main/ayuvritt/src/app/favicon.ico -------------------------------------------------------------------------------- /api/requirements.txt: -------------------------------------------------------------------------------- 1 | sanic 2 | pandas 3 | sentence-transformers 4 | sanic-cors 5 | faiss-cpu 6 | opencv-python 7 | easyocr -------------------------------------------------------------------------------- /ayuvritt/postcss.config.mjs: -------------------------------------------------------------------------------- 1 | const config = { 2 | plugins: ["@tailwindcss/postcss"], 3 | }; 4 | 5 | export default config; 6 | -------------------------------------------------------------------------------- /ayuvritt/next.config.ts: -------------------------------------------------------------------------------- 1 | import type { NextConfig } from "next"; 2 | 3 | const nextConfig: NextConfig = { 4 | /* config options here */ 5 | }; 6 | 7 | export default nextConfig; 8 | -------------------------------------------------------------------------------- /ayuvritt/src/app/fonts.ts: -------------------------------------------------------------------------------- 1 | import { Geist, Geist_Mono } from "next/font/google"; 2 | 3 | export const geistSans = Geist({ 4 | variable: "--font-geist-sans", 5 | subsets: ["latin"], 6 | }); 7 | 8 | export const geistMono = Geist_Mono({ 9 | variable: "--font-geist-mono", 10 | subsets: ["latin"], 11 | }); 12 | -------------------------------------------------------------------------------- /ayuvritt/eslint.config.mjs: -------------------------------------------------------------------------------- 1 | import { dirname } from "path"; 2 | import { fileURLToPath } from "url"; 3 | import { FlatCompat } from "@eslint/eslintrc"; 4 | 5 | const __filename = fileURLToPath(import.meta.url); 6 | const __dirname = dirname(__filename); 7 | 8 | const compat = new FlatCompat({ 9 | baseDirectory: __dirname, 10 | }); 11 | 12 | const eslintConfig = [ 13 | ...compat.extends("next/core-web-vitals", "next/typescript"), 14 | ]; 15 | 16 | export default eslintConfig; 17 | -------------------------------------------------------------------------------- /ayuvritt/src/app/globals.css: -------------------------------------------------------------------------------- 1 | @import "tailwindcss"; 2 | 3 | :root { 4 | --background: #ffffff; 5 | --foreground: #171717; 6 | } 7 | 8 | @theme inline { 9 | --color-background: var(--background); 10 | --color-foreground: var(--foreground); 11 | --font-sans: var(--font-geist-sans); 12 | --font-mono: var(--font-geist-mono); 13 | } 14 | 15 | @media (prefers-color-scheme: dark) { 16 | :root { 17 | --background: #0a0a0a; 18 | --foreground: #ededed; 19 | } 20 | } 21 | 22 | body { 23 | background: var(--background); 24 | color: var(--foreground); 25 | font-family: Arial, Helvetica, sans-serif; 26 | } 27 | -------------------------------------------------------------------------------- /ayuvritt/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.* 7 | .yarn/* 8 | !.yarn/patches 9 | !.yarn/plugins 10 | !.yarn/releases 11 | !.yarn/versions 12 | 13 | # testing 14 | /coverage 15 | 16 | # next.js 17 | /.next/ 18 | /out/ 19 | 20 | # production 21 | /build 22 | 23 | # misc 24 | .DS_Store 25 | *.pem 26 | 27 | # debug 28 | npm-debug.log* 29 | yarn-debug.log* 30 | yarn-error.log* 31 | .pnpm-debug.log* 32 | 33 | # env files (can opt-in for committing if needed) 34 | .env* 35 | 36 | # vercel 37 | .vercel 38 | 39 | # typescript 40 | *.tsbuildinfo 41 | next-env.d.ts 42 | -------------------------------------------------------------------------------- /ayuvritt/tailwind.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('tailwindcss').Config} */ 2 | module.exports = { 3 | content: [ 4 | "./src/pages/**/*.{js,ts,jsx,tsx,mdx}", 5 | "./src/components/**/*.{js,ts,jsx,tsx,mdx}", 6 | "./src/app/**/*.{js,ts,jsx,tsx,mdx}", 7 | ], 8 | theme: { 9 | extend: { 10 | colors: { 11 | sage: { 12 | 50: "#f6f7f6", 13 | // Add more shades if needed 14 | }, 15 | emerald: { 16 | 50: "#ecfdf5", 17 | 100: "#d1fae5", 18 | 600: "#059669", 19 | 700: "#047857", 20 | 900: "#064e3b", 21 | }, 22 | }, 23 | }, 24 | }, 25 | plugins: [], 26 | }; 27 | -------------------------------------------------------------------------------- /ayuvritt/src/components/back-button.tsx: -------------------------------------------------------------------------------- 1 | import Link from "next/link"; 2 | 3 | export function BackButton({ href }: { href: string }) { 4 | return ( 5 | 10 | 19 | 20 | 21 | 22 | 23 | ); 24 | } 25 | -------------------------------------------------------------------------------- /ayuvritt/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ayuvritt", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "next dev", 7 | "build": "next build", 8 | "start": "next start", 9 | "lint": "next lint" 10 | }, 11 | "dependencies": { 12 | "framer-motion": "^12.4.10", 13 | "next": "15.2.1", 14 | "react": "^19.0.0", 15 | "react-dom": "^19.0.0" 16 | }, 17 | "devDependencies": { 18 | "@eslint/eslintrc": "^3", 19 | "@tailwindcss/postcss": "^4", 20 | "@types/node": "^20", 21 | "@types/react": "^19", 22 | "@types/react-dom": "^19", 23 | "eslint": "^9", 24 | "eslint-config-next": "15.2.1", 25 | "tailwindcss": "^4", 26 | "typescript": "^5" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ayuvritt/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "ES2017", 4 | "lib": ["dom", "dom.iterable", "esnext"], 5 | "allowJs": true, 6 | "skipLibCheck": true, 7 | "strict": true, 8 | "noEmit": true, 9 | "esModuleInterop": true, 10 | "module": "esnext", 11 | "moduleResolution": "bundler", 12 | "resolveJsonModule": true, 13 | "isolatedModules": true, 14 | "jsx": "preserve", 15 | "incremental": true, 16 | "plugins": [ 17 | { 18 | "name": "next" 19 | } 20 | ], 21 | "paths": { 22 | "@/*": ["./src/*"] 23 | } 24 | }, 25 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], 26 | "exclude": ["node_modules"] 27 | } 28 | -------------------------------------------------------------------------------- /ayuvritt/src/app/layout.tsx: -------------------------------------------------------------------------------- 1 | import type { Metadata } from "next"; 2 | import { Inter } from "next/font/google"; 3 | import "./globals.css"; 4 | import { Footer } from "@/components/footer"; 5 | 6 | const inter = Inter({ subsets: ["latin"] }); 7 | 8 | export const metadata: Metadata = { 9 | title: "AyuVritt", 10 | description: "Your Ayurvedic Health Companion", 11 | }; 12 | 13 | export default function RootLayout({ 14 | children, 15 | }: { 16 | children: React.ReactNode; 17 | }) { 18 | return ( 19 | 20 | 21 |
22 |
{children}
23 |
25 | 26 | 27 | ); 28 | } 29 | -------------------------------------------------------------------------------- /ayuvritt/src/components/search-bar.tsx: -------------------------------------------------------------------------------- 1 | interface SearchBarProps { 2 | query: string; 3 | setQuery: (query: string) => void; 4 | handleSearch: () => void; 5 | loading: boolean; 6 | placeholder?: string; 7 | } 8 | 9 | export function SearchBar({ 10 | query, 11 | setQuery, 12 | handleSearch, 13 | loading, 14 | placeholder = "Search...", 15 | }: SearchBarProps) { 16 | return ( 17 |
18 |
19 | setQuery(e.target.value)} 23 | onKeyDown={(e) => e.key === "Enter" && handleSearch()} 24 | placeholder={placeholder} 25 | className="flex-1 p-3 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-emerald-500 text-black" 26 | /> 27 | 34 |
35 |
36 | ); 37 | } 38 | -------------------------------------------------------------------------------- /ayuvritt/README.md: -------------------------------------------------------------------------------- 1 | This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). 2 | 3 | ## Getting Started 4 | 5 | First, run the development server: 6 | 7 | ```bash 8 | npm run dev 9 | # or 10 | yarn dev 11 | # or 12 | pnpm dev 13 | # or 14 | bun dev 15 | ``` 16 | 17 | Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. 18 | 19 | You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. 20 | 21 | This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. 22 | 23 | ## Learn More 24 | 25 | To learn more about Next.js, take a look at the following resources: 26 | 27 | - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. 28 | - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. 29 | 30 | You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome! 31 | 32 | ## Deploy on Vercel 33 | 34 | The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. 35 | 36 | Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details. 37 | -------------------------------------------------------------------------------- /ayuvritt/src/components/leaves.tsx: -------------------------------------------------------------------------------- 1 | const Leaf1 = () => ( 2 | 3 | 7 | 8 | ); 9 | 10 | const Leaf2 = () => ( 11 | 12 | 16 | 17 | ); 18 | 19 | const Leaf3 = () => ( 20 | 21 | 25 | 29 | 30 | ); 31 | 32 | const SmallLeaf = () => ( 33 | 34 | 38 | 39 | ); 40 | 41 | export { Leaf1, Leaf2, Leaf3, SmallLeaf }; 42 | -------------------------------------------------------------------------------- /ayuvritt/src/components/footer.tsx: -------------------------------------------------------------------------------- 1 | import { SmallLeaf } from "./leaves"; 2 | 3 | export function Footer() { 4 | return ( 5 | 41 | ); 42 | } 43 | -------------------------------------------------------------------------------- /ayuvritt/src/app/naturopathy/page.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import { BackButton } from "@/components/back-button"; 4 | import { Leaf1, Leaf2, SmallLeaf } from "@/components/leaves"; 5 | import Image from "next/image"; 6 | import Link from "next/link"; 7 | import { RoutineIcon, ChecklistIcon } from "@/components/naturopathy-icons"; 8 | 9 | export default function NaturopathyPage() { 10 | return ( 11 |
12 | {/* Decorative Leaves */} 13 |
14 |
15 | 16 |
17 |
18 |
19 |
20 | 21 |
22 |
23 | 24 |
25 |
26 |
27 | 28 |
29 |
30 | AyuVritt (window.location.href = "/")} 37 | className="cursor-pointer" 38 | /> 39 |
40 |

41 | Naturopathy Guide 42 |

43 |

44 | Explore daily routines and essential supplies for natural healing 45 |

46 |
47 | 48 | {/* Cards Grid */} 49 |
50 | {/* Daily Routines Card */} 51 | 55 |
56 |
57 | 58 |
59 |

60 | Daily Routines 61 |

62 |

63 | Discover a structured daily schedule for optimal health and 64 | well-being through natural practices. 65 |

66 |
67 | View Schedule → 68 |
69 |
70 | 71 | 72 | {/* Supplies Checklist Card */} 73 | 77 |
78 |
79 | 80 |
81 |

82 | Supplies Checklist 83 |

84 |

85 | Get a comprehensive list of essential items needed for your 86 | naturopathy journey. 87 |

88 |
89 | View Checklist → 90 |
91 |
92 | 93 |
94 | 95 | {/* Floating Leaf */} 96 |
97 |
98 | 99 |
100 |
101 |
102 |
103 | ); 104 | } 105 | -------------------------------------------------------------------------------- /api/main.py: -------------------------------------------------------------------------------- 1 | import os 2 | from sanic import Sanic, json, redirect 3 | from sanic.response import text 4 | from func import ( 5 | get_best_match, 6 | get_ocr, 7 | search_chunks, 8 | get_asanas, 9 | get_meditation, 10 | get_skincare, 11 | ) 12 | from sanic_cors import CORS 13 | 14 | app = Sanic("AyuVritt") 15 | CORS(app) 16 | 17 | 18 | @app.get("/") 19 | async def hello_world(request): 20 | return redirect("https://xditya.me") 21 | 22 | 23 | @app.get("/getMedicine") 24 | async def get_medicine(request): 25 | symptoms = request.args.get("symptoms") 26 | if not symptoms: 27 | return json({"error": "Symptoms are required"}, status=400) 28 | disease, medicine = get_best_match(symptoms) 29 | return json({"error": None, "medicine": medicine, "disease": disease}, status=200) 30 | 31 | 32 | @app.get("/medicineSearch") 33 | async def get_query(request): 34 | query = request.args.get("query") 35 | if not query: 36 | return json({"error": "Medicine name is required"}, status=400) 37 | description, heading = search_chunks(query) 38 | return json( 39 | {"error": None, "description": description, "heading": heading}, status=200 40 | ) 41 | 42 | 43 | @app.get("/yogaSearch") 44 | async def get_yoga(request): 45 | problem = request.args.get("problem") 46 | if not problem: 47 | return json({"error": "Joint Symptoms are required"}, status=400) 48 | try: 49 | problem, asana, benefits, technique, breathing, Level = get_asanas(problem) 50 | return json( 51 | { 52 | "error": None, 53 | "problem": str(problem).strip(), 54 | "asana": str(asana).strip(), 55 | "benefits": str(benefits).strip(), 56 | "technique": str(technique).strip(), 57 | "breathing": str(breathing).strip(), 58 | "Level": str(Level).strip(), 59 | }, 60 | status=200, 61 | ) 62 | except Exception as e: 63 | return json({"error": f"Failed to get yoga information: {str(e)}"}, status=500) 64 | 65 | 66 | @app.get("/meditationSearch") 67 | async def get_meditationz(request): 68 | issue = request.args.get("issue") 69 | if not issue: 70 | return json({"error": "Mind Problems are required"}, status=400) 71 | try: 72 | issue, meditate, description, duration, instruction = get_meditation(issue) 73 | return json( 74 | { 75 | "error": None, 76 | "issue": str(issue).strip(), 77 | "Meditation": str(meditate).strip(), 78 | "description": str(description).strip(), 79 | "duration": str(duration).strip(), 80 | "instruction": str(instruction).strip(), 81 | }, 82 | status=200, 83 | ) 84 | except Exception as e: 85 | return json( 86 | { 87 | "error": f"Failed to get information about the meditation techniques: {str(e)}" 88 | }, 89 | status=500, 90 | ) 91 | 92 | 93 | @app.post("/prescriptionAnalysis") 94 | async def get_prescription(request): 95 | recognized_medicines, Indications, Dose, Precautions = get_ocr(request) 96 | return json( 97 | { 98 | "error": None, 99 | "recognized_medicines": recognized_medicines, 100 | "Indications": Indications, 101 | "Dose": Dose, 102 | "Precautions": Precautions, 103 | }, 104 | status=200, 105 | ) 106 | 107 | 108 | @app.get("/beautyCare") 109 | async def get_beautycare(request): 110 | bissue = request.args.get("bissue") 111 | if not bissue: 112 | return json({"error": "Beauty Problems are required"}, status=400) 113 | try: 114 | bissue, ingredient, benefit = get_skincare(bissue) 115 | return json( 116 | { 117 | "error": None, 118 | "issue": str(bissue).strip(), 119 | "Ingridient": str(ingredient).strip(), 120 | "benefit": str(benefit).strip(), 121 | }, 122 | status=200, 123 | ) 124 | except Exception as e: 125 | return json( 126 | { 127 | "error": f"Failed to get information about the beauty care techniques: {str(e)}" 128 | }, 129 | status=500, 130 | ) 131 | 132 | 133 | port = os.getenv("PORT", 8000) 134 | 135 | if __name__ == "__main__": 136 | app.run(host="0.0.0.0", port=port) 137 | -------------------------------------------------------------------------------- /ayuvritt/src/app/medicine-information/page.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import { useState } from "react"; 4 | import { Leaf1, Leaf2, SmallLeaf } from "@/components/leaves"; 5 | import Image from "next/image"; 6 | import { BackButton } from "@/components/back-button"; 7 | import { SearchBar } from "@/components/search-bar"; 8 | 9 | interface SearchResult { 10 | heading: string; 11 | description: string; 12 | } 13 | 14 | export default function MedicineInformation() { 15 | const [query, setQuery] = useState(""); 16 | const [searchResult, setSearchResult] = useState(null); 17 | const [loading, setLoading] = useState(false); 18 | const [error, setError] = useState(""); 19 | 20 | const handleSearch = async () => { 21 | if (!query.trim()) return; 22 | 23 | setLoading(true); 24 | setError(""); 25 | try { 26 | const response = await fetch( 27 | `${ 28 | process.env.NEXT_PUBLIC_API_URL 29 | }/medicineSearch?query=${encodeURIComponent(query)}` 30 | ); 31 | const data = await response.json(); 32 | 33 | if (data.error) { 34 | setError(data.error); 35 | setSearchResult(null); 36 | } else { 37 | setSearchResult({ 38 | heading: data.heading, 39 | description: data.description, 40 | }); 41 | } 42 | } catch (err) { 43 | setError("Failed to fetch medicine information. Please try again." + err); 44 | setSearchResult(null); 45 | } finally { 46 | setLoading(false); 47 | } 48 | }; 49 | 50 | return ( 51 |
52 | {/* Decorative Leaves - Left */} 53 |
54 |
55 | 56 |
57 |
58 | 59 | {/* Decorative Leaves - Right */} 60 |
61 |
62 | 63 |
64 |
65 | 66 |
67 |
68 |
69 | 70 |
71 |
72 | AyuVritt (window.location.href = "/")} 79 | className="cursor-pointer" 80 | /> 81 |
82 |

83 | Medicine Information 84 |

85 |

86 | Search for detailed information about Ayurvedic medicines 87 |

88 |
89 | 90 | {/* Search Section */} 91 | 98 | 99 | {/* Results Section */} 100 | {error && ( 101 |
102 |

{error}

103 |
104 | )} 105 | 106 | {searchResult && ( 107 |
108 |
109 |

110 | {searchResult.heading} 111 |

112 |
113 | {searchResult.description} 114 |
115 |
116 |
117 | )} 118 | 119 | {/* Floating Leaves */} 120 |
121 |
122 | 123 |
124 |
125 |
126 |
127 | ); 128 | } 129 | -------------------------------------------------------------------------------- /ayuvritt/src/components/naturopathy-icons.tsx: -------------------------------------------------------------------------------- 1 | import { motion } from "framer-motion"; 2 | 3 | export function RoutineIcon() { 4 | return ( 5 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | ); 22 | } 23 | 24 | export function ChecklistIcon() { 25 | return ( 26 | 35 | 36 | 37 | 38 | 39 | 40 | ); 41 | } 42 | 43 | export function PlantIcon(props: React.SVGProps) { 44 | return ( 45 | 54 | {/* Pot */} 55 | 56 | 57 | 58 | {/* Main stem */} 59 | 60 | 61 | {/* Leaves */} 62 | 63 | 64 | 65 | {/* Lower leaves */} 66 | 67 | 68 | 69 | ); 70 | } 71 | 72 | export function GrowingTreeIcon({ 73 | progress = 0, 74 | ...props 75 | }: React.SVGProps & { progress?: number }) { 76 | const branchProgress = Math.max(0, (progress - 0.3) * 1.5); // Branches start after 30% stem growth 77 | 78 | return ( 79 | 88 | {/* Pot */} 89 | 90 | 91 | 92 | {/* Main stem */} 93 | 99 | 100 | {/* Branches and Leaves */} 101 | 106 | {/* Lower branches */} 107 | 108 | 109 | 110 | {/* Middle branches */} 111 | 112 | 113 | 114 | {/* Upper branches */} 115 | 116 | 117 | 118 | {/* Top */} 119 | 120 | 121 | 122 | 123 | ); 124 | } 125 | 126 | export function PrescriptionIcon(props: React.SVGProps) { 127 | return ( 128 | 137 | {/* Paper */} 138 | 139 | 140 | {/* Top lines */} 141 | 142 | 143 | 144 | {/* Rx Symbol */} 145 | 146 | 147 | 148 | {/* Bottom lines */} 149 | 150 | 151 | 152 | ); 153 | } 154 | 155 | export function SkincareIcon(props: React.SVGProps) { 156 | return ( 157 | 166 | {/* Bottle */} 167 | 168 | 169 | 170 | 171 | {/* Decorative drops */} 172 | 173 | 174 | 175 | {/* Circular cap */} 176 | 177 | 178 | ); 179 | } 180 | -------------------------------------------------------------------------------- /ayuvritt/src/app/beauty-care/page.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import { useState } from "react"; 4 | import { Leaf1, Leaf2, SmallLeaf } from "@/components/leaves"; 5 | import Image from "next/image"; 6 | import { BackButton } from "@/components/back-button"; 7 | import { SearchBar } from "@/components/search-bar"; 8 | 9 | interface SearchResult { 10 | issue: string; 11 | ingredient: string; 12 | benefit: string; 13 | } 14 | 15 | export default function SkinCarePage() { 16 | const [query, setQuery] = useState(""); 17 | const [searchResult, setSearchResult] = useState(null); 18 | const [loading, setLoading] = useState(false); 19 | const [error, setError] = useState(""); 20 | 21 | const handleSearch = async () => { 22 | if (!query.trim()) return; 23 | 24 | setLoading(true); 25 | setError(""); 26 | try { 27 | const response = await fetch( 28 | `${ 29 | process.env.NEXT_PUBLIC_API_URL 30 | }/beautyCare?bissue=${encodeURIComponent(query)}` 31 | ); 32 | const data = await response.json(); 33 | 34 | if (data.error) { 35 | setError(data.error); 36 | setSearchResult(null); 37 | } else { 38 | setSearchResult({ 39 | issue: data.issue, 40 | ingredient: data.Ingridient, 41 | benefit: data.benefit, 42 | }); 43 | } 44 | } catch (err) { 45 | setError("Failed to fetch skincare information. Please try again." + err); 46 | setSearchResult(null); 47 | } finally { 48 | setLoading(false); 49 | } 50 | }; 51 | 52 | return ( 53 |
54 | {/* Decorative Leaves - Left */} 55 |
56 |
57 | 58 |
59 |
60 | 61 | {/* Decorative Leaves - Right */} 62 |
63 |
64 | 65 |
66 |
67 | 68 |
69 |
70 |
71 | 72 |
73 |
74 | AyuVritt (window.location.href = "/")} 81 | className="cursor-pointer" 82 | /> 83 |
84 |

85 | Natural Beauty Care 86 |

87 |

88 | Search for natural remedies and ingredients for beauty care 89 |

90 |
91 | 92 | {/* Search Section */} 93 | 100 | 101 | {/* Results Section */} 102 | {error && ( 103 |
104 |

{error}

105 |
106 | )} 107 | 108 | {searchResult && ( 109 |
110 |
111 |

112 | {searchResult.issue} 113 |

114 |
115 |
116 |

117 | Recommended Ingredients 118 |

119 |

{searchResult.ingredient}

120 |
121 |
122 |

123 | Benefits 124 |

125 |

126 | {searchResult.benefit} 127 |

128 |
129 |
130 |
131 |
132 | )} 133 | 134 | {/* Floating Leaves */} 135 |
136 |
137 | 138 |
139 |
140 |
141 |
142 | ); 143 | } 144 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Define 3.0 2 | 3 | The official template repository for Define 3.0 4 | 5 | ![DefineHack 2025 Logo](https://github.com/user-attachments/assets/8173bc16-418e-4912-b500-c6427e4ba4b6) 6 | 7 | # AyuVritt 8 | 9 | > _AI driven bridging gap between ancient wisdom and modern healing._ 10 | 11 | ![Cover Image](./ayuvritt/public/icon.svg) 12 | 13 | ### Team Information 14 | 15 | - **Team Name**: camel_case 16 | - **Track**: AI in AYUSH 17 | 18 | ### Team Members 19 | 20 | | Name | Role | GitHub | LinkedIn | 21 | | --------------- | --------- | -------------------------------------------------- | ------------------------------------------------------------ | 22 | | Aditya S | Developer | [@xditya](https://github.com/xditya) | [Profile](https://linkedin.com/in/xditya) | 23 | | Akshay Ashok | Developer | [@aks-hayy](https://github.com/aks-hayy) | [Profile](https://linkedin.com/in/akshay-ashok-26844224a) | 24 | | Ann S Binil | Developer | [@annsbinil](https://github.com/annsbinil) | [Profile](https://linkedin.com/in/annsbinil) | 25 | | Anoushka L Nair | Developer | [@anoushkalnair](https://github.com/anoushkalnair) | [Profile](https://linkedin.com/in/anoushka-l-nair-331b73239) | 26 | 27 | ## Project Details 28 | 29 | ### Overview 30 | 31 | _We aim to develop an intelligent platform that combines Ayurvedic insights with allopathic analysis to create sustainable AYUSH-based formulations. By validating efficiency and side effects scientifically, the system will enhance the credibility and effectiveness of traditional medicine._ 32 | 33 | ### Problem Statement 34 | 35 | _We require a system to generate medicinal knowledge and ayurvedic insights related to allopathy, aiding in the sustainable formulation of AYUSH-based medicine to enhance efficiency and validate it scientifically with proper assessment of side effects._ 36 | 37 | ### Solution 38 | 39 | _We intend to build a interface for herbal formulation insights alongside of allopathy analysing and researching on basis of sustainable medicinal development._ 40 | 41 | ### Demo 42 | 43 | [![Project Demo](https://img.youtube.com/vi/9MlfyAhO9PA/0.jpg)](https://www.youtube.com/watch?v=9MlfyAhO9PA) 44 | 45 | ### Live Project 46 | 47 | [AyuVritt](https://camel-case.vercel.app/) 48 | 49 | ## Technical Implementation 50 | 51 | ### Technologies Used 52 | 53 | - **Frontend**: Next.js 54 | - **Backend**: Node.js 55 | - **Other Tools**: Pretrained models (Bert, Kaggle) 56 | 57 | ### Key Features 58 | 59 | - Medicine formulation analysis. 60 | - Ayurvedic insights connected with allopathic medicine. 61 | - Side effects analysis. 62 | 63 | ## Setup Instructions 64 | 65 | ### Prerequisites 66 | 67 | - Python 3.10 68 | - Node.js 69 | 70 | ### Installation 71 | 72 | ### Clone 73 | 74 | ```bash 75 | git clone https://github.com/xditya/camel_case 76 | cd camel_case 77 | ``` 78 | 79 | #### Backend 80 | 81 | ```bash 82 | cd api 83 | pip install -r requirements.txt 84 | python main.py 85 | ``` 86 | 87 | #### Frontend 88 | 89 | ```bash 90 | cd .. 91 | cd ayuvritt 92 | npm install 93 | npm run dev 94 | ``` 95 | 96 | ## Additional Resources 97 | 98 | ### Project Timeline 99 | 100 | | SL NO. | TIME | WORK DONE | 101 | | ------ | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | 102 | | 1 | 11:00 am - 1:00 pm | • Finalized the problem statement and completed initial analysis.
• Designed the product name and logo.
• Trained the model to translate local slang for medical symptoms.
• Developed the frontend landing page. | 103 | | 2 | 2:00 pm - 5:30pm | • Developed and optimized website functionality.
• Cleaned and preprocessed datasets.
• Translated Sanskrit texts to English. | 104 | | 3 | 6:00 pm - 9:00 pm | • Processed and modified datasets.
• Mapped yoga asanas to symptoms. | 105 | | 4 | 10:30 pm -12:30 am | • Designed naturopathy routines.
• Created a naturopathy bucket list. | 106 | | 5 | 1:00 am – 8:00 am | • Hosting mindfulness events.
• Created "Rising Tree" for chakra focus.
• Integrated beauty and wellness practices.
• Mapped meditation techniques to symptoms. | 107 | | 6 | 8:45 am – 11:00 am | • Finalized the product.
• Held group discussions.
• Submitted related works. | 108 | 109 | ### Challenges Faced 110 | 111 | _Sleep deprivation_ 112 | 113 | ### Future Enhancements 114 | 115 | _Customised fine tuned datasets for better results_ 116 | 117 | --- 118 | 119 | ### Submission Checklist 120 | 121 | - [x] Cover Image 122 | - [x] Completed all sections of this README 123 | - [x] Added project demo video 124 | - [x] Provided live project link 125 | - [x] Ensured all team members are listed 126 | - [x] Included setup instructions 127 | - [x] Submitted final code to repository 128 | 129 | --- 130 | 131 | © Define 3.0 | [Define 3.0](https://www.define3.xyz/) 132 | -------------------------------------------------------------------------------- /ayuvritt/src/app/yoga-therapies/page.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import { useState } from "react"; 4 | import { Leaf1, Leaf2 } from "@/components/leaves"; 5 | import Image from "next/image"; 6 | import { BackButton } from "@/components/back-button"; 7 | import { SearchBar } from "@/components/search-bar"; 8 | 9 | interface YogaResult { 10 | problem: string; 11 | asana: string; 12 | benefits: string; 13 | technique: string; 14 | breathing: string; 15 | Level: string; 16 | } 17 | 18 | export default function YogaTherapies() { 19 | const [query, setQuery] = useState(""); 20 | const [searchResult, setSearchResult] = useState(null); 21 | const [loading, setLoading] = useState(false); 22 | const [error, setError] = useState(""); 23 | 24 | const handleSearch = async () => { 25 | if (!query.trim()) return; 26 | 27 | setLoading(true); 28 | setError(""); 29 | try { 30 | const response = await fetch( 31 | `${ 32 | process.env.NEXT_PUBLIC_API_URL 33 | }/yogaSearch?problem=${encodeURIComponent(query.trim())}` 34 | ); 35 | 36 | const data = await response.json(); 37 | 38 | if (data.error) { 39 | setError(data.error); 40 | setSearchResult(null); 41 | } else { 42 | setSearchResult(data); 43 | } 44 | } catch (err) { 45 | setError("Failed to fetch yoga information. Please try again. " + err); 46 | setSearchResult(null); 47 | } finally { 48 | setLoading(false); 49 | } 50 | }; 51 | 52 | return ( 53 |
54 | {/* Decorative Leaves - Left */} 55 |
56 |
57 | 58 |
59 |
60 | 61 | {/* Decorative Leaves - Right */} 62 |
63 |
64 | 65 |
66 |
67 | 68 |
69 | 70 | {/* Header Section */} 71 |
72 |
73 | AyuVritt (window.location.href = "/")} 80 | className="cursor-pointer" 81 | /> 82 |
83 |

84 | Yoga Therapies 85 |

86 |

87 | Discover yoga poses and their therapeutic benefits for your specific 88 | needs 89 |

90 |
91 | 92 | {/* Search Section */} 93 | 100 | 101 | {/* Results Section */} 102 | {error && ( 103 |
104 |

{error}

105 |
106 | )} 107 | 108 | {searchResult && ( 109 |
110 |
111 |

112 | Recommended Yoga Practice for "{query.trim()}" 113 |

114 | 115 |
116 |
117 |

118 | Condition 119 |

120 |

{searchResult.problem}

121 |
122 | 123 |
124 |

125 | Recommended Asana 126 |

127 |

{searchResult.asana}

128 |
129 | 130 |
131 |

132 | Benefits 133 |

134 |

{searchResult.benefits}

135 |
136 | 137 |
138 |

139 | Technique 140 |

141 |

{searchResult.technique}

142 |
143 | 144 |
145 |

146 | Breathing 147 |

148 |

{searchResult.breathing}

149 |
150 | 151 |
152 |

153 | Difficulty Level 154 |

155 |

{searchResult.Level}

156 |
157 |
158 |
159 |
160 | )} 161 |
162 |
163 | ); 164 | } 165 | -------------------------------------------------------------------------------- /api/datasets/care.csv: -------------------------------------------------------------------------------- 1 | ,Issue,Ingredient(s),Benefits 2 | ,Hair fall,Bhringraj (Eclipta alba),"Strengthens hair roots, reduces hair fall, promotes growth" 3 | ,Dandruff,Neem (Azadirachta indica),"Anti-fungal, reduces scalp itching and flakiness" 4 | ,Dry scalp,Coconut oil (Cocos nucifera),Deeply moisturizes and nourishes the scalp 5 | ,Split ends,Amla (Indian gooseberry),"Conditions hair, prevents breakage, and repairs split ends" 6 | ,Premature graying,Bhringraj and Amla,"Delays graying, darkens hair, and improves hair texture" 7 | ,Frizzy hair,Hibiscus (Hibiscus rosa-sinensis),"Smoothens hair, reduces frizz, and adds shine" 8 | ,Scalp infections,Turmeric (Curcuma longa),"Anti-bacterial, reduces scalp infections and inflammation" 9 | ,Thinning hair,Fenugreek seeds (Trigonella foenum-graecum),Promotes hair thickness and density 10 | ,Oily scalp,Shikakai (Acacia concinna),"Cleanses excess oil, balances scalp pH" 11 | ,Hair breakage,Aloe vera,"Strengthens hair strands, reduces breakage" 12 | ,Slow hair growth,Onion juice,"Stimulates hair follicles, promotes faster growth" 13 | ,Itchy scalp,Tea tree oil,"Soothes itching, reduces scalp irritation" 14 | ,Hair thinning at crown,Rosemary oil,"Improves blood circulation, promotes hair regrowth" 15 | ,Heat damage,Brahmi (Bacopa monnieri),"Repairs heat-damaged hair, strengthens strands" 16 | ,Hair loss due to stress,Ashwagandha (Withania somnifera),"Reduces stress, promotes hair regrowth" 17 | ,Dry and brittle hair,Sesame oil (Sesamum indicum),Deeply nourishes and conditions dry hair 18 | ,Hair darkening,Henna (Lawsonia inermis),"Natural hair dye, conditions and darkens hair" 19 | ,Scalp psoriasis,Aloe vera and Neem,"Reduces inflammation, soothes scalp psoriasis" 20 | ,Hair damage from pollution,Tulsi (Holy basil),"Detoxifies scalp, protects hair from pollution" 21 | ,Lack of hair volume,Bhringraj and Hibiscus,"Adds volume, thickens hair strands" 22 | ,Hair loss due to hormonal imbalance,Shatavari (Asparagus racemosus),"Balances hormones, reduces hair loss" 23 | ,Hair dullness,Amla and Lemon juice,"Adds shine, brightens hair" 24 | ,Hair tangling,Coconut oil and Hibiscus,"Detangles hair, makes it smooth and manageable" 25 | ,Hair damage from chemicals,Bhringraj and Aloe vera,"Repairs chemical damage, restores hair health" 26 | ,Hair loss after pregnancy,Fenugreek and Amla,"Promotes regrowth, restores hair health post-pregnancy" 27 | ,Scalp acne,Neem and Tea tree oil,"Reduces scalp acne, clears clogged pores" 28 | ,Hair thinning due to aging,Ashwagandha and Bhringraj,"Rejuvenates hair, reduces age-related thinning" 29 | ,Hair loss due to dandruff,Neem and Shikakai,"Treats dandruff, reduces hair fall" 30 | ,Hair damage from hard water,Amla and Lemon juice,"Removes hard water buildup, restores hair health" 31 | ,Hair loss due to thyroid issues,Ashwagandha and Brahmi,"Balances thyroid, reduces hair loss" 32 | ,Hair dryness in winter,Coconut oil and Amla,"Prevents winter dryness, keeps hair moisturized" 33 | ,Hair loss due to vitamin deficiency,Amla and Bhringraj,"Rich in vitamins, promotes hair growth" 34 | ,Hair damage from styling tools,Brahmi and Aloe vera,Repairs heat and styling damage 35 | ,Hair loss due to alopecia,Onion juice and Rosemary oil,"Stimulates follicles, promotes regrowth" 36 | ,Hair thinning due to poor diet,Fenugreek and Ashwagandha,"Improves hair health, promotes thickness" 37 | ,Hair damage from chlorine,Coconut oil and Lemon juice,"Removes chlorine buildup, restores hair health" 38 | ,Hair loss due to scalp fungus,Neem and Tea tree oil,"Anti-fungal, treats scalp infections" 39 | ,Hair damage from over-washing,Bhringraj and Coconut oil,"Restores natural oils, prevents over-drying" 40 | ,Hair loss due to iron deficiency,Amla and Fenugreek,"Rich in iron, promotes hair growth" 41 | ,Hair damage from UV rays,Brahmi and Aloe vera,"Protects hair from UV damage, repairs sun damage" 42 | ,"Dryness, dullness",Rice bran,Cleansing and moisturizing 43 | ,"Wrinkles, fine lines",Retinols,Anti-aging 44 | ,"Dryness, aging",Argan oil,Moisturizing & anti-aging 45 | ,"Dullness, hyperpigmentation",Vitamin C,Brightening & anti-aging 46 | ,"Dryness, uneven skin tone",Vitamin B3,Moisturizing & Brightening 47 | ,"Redness, inflammation",Green tea,Anti-inflammatory & antioxidant 48 | ,"Dryness, aging",Algae extracts,Moisturizing & anti-aging 49 | ,"Dryness, aging",Ahnfeltia concha extract,Moisturizing & anti-aging 50 | ,"Inflammation, dullness",Spirulina extract,Anti-inflammatory & antioxidant 51 | ,"Redness, inflammation",Astaxanthin,Anti-inflammatory & antioxidant 52 | ,"Dryness, aging",Gigartina skottsbergii,Moisturizing & anti-aging 53 | ,"Dryness, aging",Undaria pinnatifida,Moisturizing & anti-aging 54 | ,"Dryness, aging",Brown algae,Moisturizing & anti-aging 55 | ,"Dullness, redness",Green algae,Brightening & anti-inflammatory 56 | ,"Inflammation, dullness",Chlorella,Anti-inflammatory & detoxifying 57 | ,"Dryness, redness",Jojoba oil,Moisturizing & anti-inflammatory 58 | ,"Dryness, redness",Squalane oil,Moisturizing & anti-inflammatory 59 | ,"Dryness, scars",Rosehip oil,Moisturizing & anti-inflammatory 60 | ,"Dryness, dullness",Grapeseed oil,Moisturizing & antioxidant 61 | ,"Dryness, redness",Shea butter,Moisturizing & anti-inflammatory 62 | ,"Dryness, redness",Mango butter,Moisturizing & anti-inflammatory 63 | ,"Dryness, aging",Marula oil,"Hydration, anti-aging, & anti-inflammatory" 64 | ,"Dryness, sensitivity",Olive oil,Moisturizing & antioxidant 65 | ,"Dryness, redness",Sunflower seed oil,Hydration & anti-inflammatory 66 | ,"Dryness, inflammation",Pomegranate seed oil,"Anti-inflammatory, antioxidant, &" 67 | ,"Dryness, aging",Baobab oil,"Nourishing, moisturizing, & anti-aging" 68 | ,"Dryness, scars, redness",Sea buckthorn oil,"Moisturizing, antioxidant, & anti-inflammatory" 69 | ,"Dryness, dullness",Camellia seed oil,Hydration & antioxidant 70 | ,"Dryness, aging",Meadowfoam seed oil,Moisturizing & anti-aging 71 | ,"Inflammation, scars",Tamanu oil,"Anti-inflammatory, antioxidant, &" 72 | ,"Dryness, redness",Chia seed oil,Anti-inflammatory & antioxidant 73 | ,"Dryness, sensitivity",Sweet almond oil,"Moisturizing, anti-aging, & anti-inflammatory" 74 | ,"Dryness, aging",Avocado oil,Moisturizing & anti-inflammatory 75 | ,"Redness, inflammation",Aloe vera,"Soothing, anti-inflammatory" -------------------------------------------------------------------------------- /ayuvritt/src/app/events/page.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import { Leaf1, Leaf2, SmallLeaf } from "@/components/leaves"; 4 | import Image from "next/image"; 5 | import { BackButton } from "@/components/back-button"; 6 | 7 | interface Event { 8 | id: string; 9 | title: string; 10 | date: string; 11 | time: string; 12 | location: string; 13 | description: string; 14 | category: "yoga" | "meditation" | "ayurveda" | "workshop"; 15 | instructor: string; 16 | maxParticipants: number; 17 | currentParticipants: number; 18 | } 19 | 20 | // Sample events data - replace with your actual data source 21 | const events: Event[] = [ 22 | { 23 | id: "1", 24 | title: "Morning Yoga Session", 25 | date: "2024-03-25", 26 | time: "07:00 AM - 08:30 AM", 27 | location: "Zen Garden Studio", 28 | description: 29 | "Start your day with energizing yoga poses and breathing exercises.", 30 | category: "yoga", 31 | instructor: "Sarah Wilson", 32 | maxParticipants: 20, 33 | currentParticipants: 12, 34 | }, 35 | { 36 | id: "2", 37 | title: "Meditation Workshop", 38 | date: "2024-03-26", 39 | time: "06:00 PM - 07:30 PM", 40 | location: "Peace Center", 41 | description: "Learn fundamental meditation techniques for stress relief.", 42 | category: "meditation", 43 | instructor: "David Chen", 44 | maxParticipants: 15, 45 | currentParticipants: 8, 46 | }, 47 | // Add more events as needed 48 | ]; 49 | 50 | function EventCard({ event }: { event: Event }) { 51 | const spotsLeft = event.maxParticipants - event.currentParticipants; 52 | const isAlmostFull = spotsLeft <= 3; 53 | 54 | return ( 55 |
56 |
57 |
58 |
59 |

60 | {event.title} 61 |

62 |

63 | {new Date(event.date).toLocaleDateString("en-US", { 64 | weekday: "long", 65 | year: "numeric", 66 | month: "long", 67 | day: "numeric", 68 | })} 69 |

70 |
71 | 82 | {event.category.charAt(0).toUpperCase() + event.category.slice(1)} 83 | 84 |
85 | 86 |
87 |

88 | Time: {event.time} 89 |

90 |

91 | Location: {event.location} 92 |

93 |

94 | Instructor: {event.instructor} 95 |

96 |

{event.description}

97 |
98 | 99 |
100 |
101 | 106 | {spotsLeft} spots left 107 | 108 | 109 | {" "} 110 | ({event.currentParticipants}/{event.maxParticipants}) 111 | 112 |
113 | 116 |
117 |
118 |
119 | ); 120 | } 121 | 122 | export default function EventsPage() { 123 | return ( 124 |
125 | {/* Decorative Leaves - Left */} 126 |
127 |
128 | 129 |
130 |
131 | 132 | {/* Decorative Leaves - Right */} 133 |
134 |
135 | 136 |
137 |
138 | 139 |
140 | 141 |
142 |
143 | AyuVritt (window.location.href = "/")} 150 | className="cursor-pointer" 151 | /> 152 |
153 |

154 | Upcoming Events 155 |

156 |

157 | Join our yoga, meditation, and wellness events 158 |

159 |
160 | 161 |
162 | {events.map((event) => ( 163 | 164 | ))} 165 |
166 | 167 | {/* Floating Leaves */} 168 |
169 |
170 | 171 |
172 |
173 | 174 |
175 |
176 |
177 |
178 | ); 179 | } 180 | -------------------------------------------------------------------------------- /api/func.py: -------------------------------------------------------------------------------- 1 | import warnings 2 | from sentence_transformers import SentenceTransformer, util 3 | import pandas as pd 4 | import faiss 5 | import numpy as np 6 | import easyocr 7 | import io 8 | from PIL import Image 9 | 10 | 11 | # Suppress the specific FutureWarning 12 | warnings.filterwarnings( 13 | "ignore", 14 | category=FutureWarning, 15 | message="`clean_up_tokenization_spaces` was not set", 16 | ) 17 | 18 | model = SentenceTransformer("paraphrase-MiniLM-L6-v2") 19 | data = pd.read_csv("datasets/Formulation-Indications - Formulation-Indications.csv") 20 | dataset = pd.DataFrame(data) 21 | 22 | keywords = dataset["Translated"].tolist() 23 | 24 | 25 | def get_best_match(input_text): 26 | 27 | input_embedding = model.encode(input_text, convert_to_tensor=True) 28 | keyword_embeddings = model.encode(keywords, convert_to_tensor=True) 29 | 30 | similarities = util.pytorch_cos_sim(input_embedding, keyword_embeddings) 31 | 32 | best_match_index = similarities.argmax().item() 33 | best_match = keywords[best_match_index] 34 | medicine = dataset["Name of Medicine"][best_match_index] 35 | 36 | return best_match, medicine 37 | 38 | 39 | index = faiss.read_index("datasets/faiss_index.index") 40 | model1 = SentenceTransformer("all-MiniLM-L6-v2") 41 | # Load the chunked data 42 | df = pd.read_csv("datasets/chunked_data.csv") 43 | 44 | data0 = pd.read_csv("datasets/chunked.csv") 45 | dataset0 = pd.DataFrame(data0) 46 | keywords0 = dataset0["Heading"].tolist() 47 | 48 | 49 | # Function to search for relevant chunks 50 | def search_chunks(query): 51 | # Encode the query 52 | query_embedding = model1.encode([query]) 53 | # Encode all keywords 54 | keyword_embeddings = model.encode(keywords0, convert_to_tensor=True) 55 | 56 | # Calculate similarities 57 | similarities = util.pytorch_cos_sim(query_embedding, keyword_embeddings)[ 58 | 0 59 | ] # Get first row 60 | 61 | # Get top 3 most similar matches 62 | top_k = min(3, len(similarities)) 63 | top_indices = similarities.argsort(descending=True)[:top_k] 64 | 65 | # Find best match with similarity threshold 66 | best_match_index = None 67 | best_similarity = 0 68 | 69 | for idx in top_indices: 70 | similarity = similarities[idx].item() 71 | if similarity > 0.5: # Minimum similarity threshold 72 | if similarity > best_similarity: 73 | best_similarity = similarity 74 | best_match_index = int(idx) # Convert tensor to int 75 | 76 | if best_match_index is None: 77 | return "No relevant information found.", "Search Results" 78 | 79 | best_match = keywords0[best_match_index] 80 | content = dataset0["Content"][best_match_index] 81 | 82 | return content, best_match 83 | 84 | 85 | data1 = pd.read_csv("datasets/asanas.csv") 86 | dataset1 = pd.DataFrame(data1) 87 | keywords1 = dataset1["Problems Solved"].tolist() 88 | 89 | 90 | def get_asanas(input_text): 91 | input_embedding = model.encode(input_text, convert_to_tensor=True) 92 | keyword_embeddings = model.encode(keywords1, convert_to_tensor=True) 93 | 94 | similarities = util.pytorch_cos_sim(input_embedding, keyword_embeddings) 95 | 96 | best_match_index = similarities.argmax().item() 97 | best_match = keywords[best_match_index] 98 | asana = dataset1["AName"][best_match_index] 99 | benefits = dataset1["Benefits"][best_match_index] 100 | technique = dataset1["Description"][best_match_index] 101 | breathing = dataset1["Breathing"][best_match_index] 102 | Level = dataset1["Level"][best_match_index] 103 | 104 | return best_match, asana, benefits, technique, breathing, Level 105 | 106 | 107 | data2 = pd.read_csv("datasets/meditation.csv") 108 | dataset2 = pd.DataFrame(data2) 109 | keywords2 = dataset2["Issue"].tolist() 110 | 111 | 112 | def get_meditation(input_text): 113 | input_embedding = model.encode(input_text, convert_to_tensor=True) 114 | keyword_embeddings = model.encode(keywords2, convert_to_tensor=True) 115 | 116 | similarities = util.pytorch_cos_sim(input_embedding, keyword_embeddings) 117 | 118 | best_match_index = similarities.argmax().item() 119 | best_match = keywords2[best_match_index] 120 | Meditate = dataset2["Name"][best_match_index] 121 | Description = dataset2["Description"][best_match_index] 122 | Duration = dataset2["Duration"][best_match_index] 123 | Instructions = dataset2["Instructions"][best_match_index] 124 | 125 | return best_match, Meditate, Description, Duration, Instructions 126 | 127 | 128 | data3 = pd.read_csv("datasets/Formulation-Indications - Formulation-Indications.csv") 129 | dataset3 = pd.DataFrame(data) 130 | keywords3 = dataset["Name of Medicine"].tolist() 131 | 132 | 133 | def get_ocr(request): 134 | reader = easyocr.Reader(["en"]) 135 | 136 | if "image" not in request.files: 137 | return None, None, None, None 138 | 139 | image_file = request.files.get("image") # Get the first file 140 | if not image_file: 141 | return None, None, None, None 142 | 143 | # Read the file data 144 | image_data = image_file.body 145 | image = Image.open(io.BytesIO(image_data)) 146 | 147 | # Convert the image to RGB (if necessary) 148 | if image.mode != "RGB": 149 | image = image.convert("RGB") 150 | 151 | image_np = np.array(image) 152 | results = reader.readtext(image_np) 153 | extracted_text = " ".join([result[1] for result in results]) 154 | 155 | input_embedding = model.encode(extracted_text, convert_to_tensor=True) 156 | keyword_embeddings = model.encode(keywords, convert_to_tensor=True) 157 | similarities = util.pytorch_cos_sim(input_embedding, keyword_embeddings) 158 | best_match_index = similarities.argmax().item() 159 | best_match = keywords3[best_match_index] 160 | recognized_medicines = best_match 161 | Indications = dataset3["Translated"][best_match_index] 162 | Dose = dataset3["Dose"][best_match_index] 163 | Precautions = dataset3["Precaution/ Contraindication"][best_match_index] 164 | 165 | return recognized_medicines, Indications, Dose, Precautions 166 | 167 | 168 | data5 = pd.read_csv("datasets/care.csv") 169 | dataset5 = pd.DataFrame(data5) 170 | keywords5 = dataset5["Issue"].tolist() 171 | 172 | 173 | def get_skincare(input_text): 174 | input_embedding = model.encode(input_text, convert_to_tensor=True) 175 | keyword_embeddings = model.encode(keywords5, convert_to_tensor=True) 176 | 177 | similarities = util.pytorch_cos_sim(input_embedding, keyword_embeddings) 178 | 179 | best_match_index = similarities.argmax().item() 180 | issue = keywords5[best_match_index] 181 | Ingredient = dataset5["Ingredient(s)"][best_match_index] 182 | Benefits = dataset5["Benefits"][best_match_index] 183 | 184 | return issue, Ingredient, Benefits 185 | -------------------------------------------------------------------------------- /ayuvritt/src/app/meditation/page.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import { BackButton } from "@/components/back-button"; 4 | import { Leaf1, Leaf2 } from "@/components/leaves"; 5 | import Image from "next/image"; 6 | import { useState } from "react"; 7 | import { SearchBar } from "@/components/search-bar"; 8 | 9 | interface MeditationResponse { 10 | error: null | string; 11 | issue: string; 12 | Meditation: string; 13 | description: string; 14 | duration: string; 15 | instruction: string; 16 | } 17 | 18 | interface MeditationResult { 19 | title: string; 20 | description: string; 21 | duration: string; 22 | steps: string[]; 23 | searchedFor: string; 24 | } 25 | 26 | export default function MeditationPage() { 27 | const [query, setQuery] = useState(""); 28 | const [loading, setLoading] = useState(false); 29 | const [searchResults, setSearchResults] = useState([]); 30 | const [error, setError] = useState(""); 31 | 32 | const handleSearch = async () => { 33 | if (!query.trim()) return; 34 | 35 | setLoading(true); 36 | setError(""); 37 | 38 | try { 39 | const response = await fetch( 40 | `${ 41 | process.env.NEXT_PUBLIC_API_URL 42 | }/meditationSearch?issue=${encodeURIComponent(query)}` 43 | ); 44 | 45 | if (!response.ok) { 46 | throw new Error("Failed to fetch results"); 47 | } 48 | 49 | const data: MeditationResponse = await response.json(); 50 | 51 | if (data.error) { 52 | setError(data.error); 53 | return; 54 | } 55 | 56 | const formattedResult: MeditationResult = { 57 | title: data.Meditation, 58 | description: data.description, 59 | duration: data.duration, 60 | steps: data.instruction.split(". ").filter((step) => step.trim()), 61 | searchedFor: data.issue, 62 | }; 63 | 64 | setSearchResults([formattedResult]); 65 | } catch (err) { 66 | setError("Failed to fetch recommendations. Please try again."); 67 | console.error("Search error:", err); 68 | } finally { 69 | setLoading(false); 70 | } 71 | }; 72 | 73 | return ( 74 |
75 | {/* Decorative Leaves */} 76 |
77 |
78 | 79 |
80 |
81 |
82 |
83 | 84 |
85 |
86 | 87 |
88 |
89 |
90 | 91 |
92 |
93 | AyuVritt (window.location.href = "/")} 100 | className="cursor-pointer" 101 | /> 102 |
103 |

104 | Meditation Guide 105 |

106 |

107 | Search for meditation techniques based on your needs 108 |

109 |
110 | 111 | 118 | 119 | {/* Results Section */} 120 | {error &&
{error}
} 121 | 122 | {searchResults.length > 0 && ( 123 |
124 | {searchResults.map((result, index) => ( 125 |
129 |
130 | 131 | Meditation for: {result.searchedFor} 132 | 133 |
134 | 135 |

136 | {result.title} 137 |

138 | 139 |

{result.description}

140 | 141 |
142 |
143 |
144 |

145 | Instructions 146 |

147 |
    148 | {result.steps.map((step, stepIndex) => ( 149 |
  1. 150 | {step} 151 |
  2. 152 | ))} 153 |
154 |
155 | 156 |
157 |

158 | Recommended Duration 159 |

160 |

{result.duration}

161 |
162 |
163 |
164 | 165 |
166 |

167 | Remember: Start with what feels comfortable and gradually 168 | increase your practice duration. 169 |

170 |
171 |
172 | ))} 173 |
174 | )} 175 | 176 | {/* Initial Info Section */} 177 | {!searchResults.length && !loading && ( 178 |
179 |

180 | Getting Started with Meditation 181 |

182 |

183 | Meditation is a powerful practice that can help reduce stress, 184 | improve focus, and promote overall well-being. Enter your specific 185 | concern above to receive personalized meditation recommendations. 186 |

187 |
188 |
189 |

Benefits

190 |
    191 |
  • • Reduced stress and anxiety
  • 192 |
  • • Improved concentration
  • 193 |
  • • Better emotional well-being
  • 194 |
  • • Enhanced self-awareness
  • 195 |
196 |
197 |
198 |

Tips

199 |
    200 |
  • • Start with short sessions
  • 201 |
  • • Find a quiet space
  • 202 |
  • • Be consistent with practice
  • 203 |
  • • Stay comfortable but alert
  • 204 |
205 |
206 |
207 |
208 | )} 209 |
210 |
211 | ); 212 | } 213 | -------------------------------------------------------------------------------- /ayuvritt/src/app/page.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import { useRouter } from "next/navigation"; 4 | import Image from "next/image"; 5 | import { Leaf1, Leaf2, Leaf3, SmallLeaf } from "@/components/leaves"; 6 | 7 | export default function Home() { 8 | const router = useRouter(); 9 | return ( 10 |
11 | {/* Decorative Leaves - Left Side */} 12 |
13 |
14 | 15 |
16 |
17 | 18 |
19 |
20 | 21 |
22 |
23 | 24 | {/* Decorative Leaves - Right Side */} 25 |
26 |
27 | 28 |
29 |
30 | 31 |
32 |
33 | 34 |
35 |
36 | 37 | {/* Hero Section */} 38 |
39 |
40 | AyuVritt 41 |
42 |
43 |

44 | Bridging Ancient Wisdom with 45 | Modern Medicine 46 |

47 |

48 | An intelligent platform combining Ayurvedic insights with allopathic 49 | analysis to create sustainable AYUSH-based formulations with 50 | scientific validation. 51 |

52 |
53 | 59 | 65 |
66 |
67 | 68 | {/* Features Grid */} 69 |
70 |
71 |
72 | 78 | 84 | 85 |
86 |

87 | Knowledge Generation 88 |

89 |

90 | Advanced AI-driven analysis of traditional Ayurvedic texts and 91 | modern medical research. 92 |

93 |
94 | 95 |
96 |
97 | 103 | 109 | 110 |
111 |

112 | Scientific Validation 113 |

114 |

115 | Rigorous analysis of formulation efficiency and potential side 116 | effects through modern methods. 117 |

118 |
119 | 120 |
121 |
122 | 128 | 134 | 135 |
136 |

137 | Sustainable Formulations 138 |

139 |

140 | Creating effective AYUSH-based medicines that combine traditional 141 | wisdom with modern standards. 142 |

143 |
144 |
145 |
146 | 147 | {/* Small Floating Leaves */} 148 |
149 |
150 | 151 |
152 |
153 | 154 |
155 |
156 | 157 |
158 |
159 | 160 |
161 |
162 | 163 | {/* Call to Action */} 164 |
165 |
166 |

167 | Ready to Transform Healthcare? 168 |

169 |

170 | Join us in revolutionizing medicine by bridging the gap between 171 | ancient wisdom and modern healing. 172 |

173 | 179 |
180 |
181 |
182 | ); 183 | } 184 | -------------------------------------------------------------------------------- /ayuvritt/src/app/rising-tree/page.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import { BackButton } from "@/components/back-button"; 4 | import { Leaf1, Leaf2 } from "@/components/leaves"; 5 | import { GrowingTreeIcon } from "@/components/naturopathy-icons"; 6 | import { motion, AnimatePresence } from "framer-motion"; 7 | import Image from "next/image"; 8 | import { useEffect, useState } from "react"; 9 | 10 | export default function RisingTreePage() { 11 | const [minutes, setMinutes] = useState(5); 12 | const [seconds, setSeconds] = useState(0); 13 | const [isRunning, setIsRunning] = useState(false); 14 | const [timeLeft, setTimeLeft] = useState(0); 15 | const [totalTime, setTotalTime] = useState(0); 16 | const [isComplete, setIsComplete] = useState(false); 17 | 18 | useEffect(() => { 19 | let interval: NodeJS.Timeout; 20 | 21 | if (isRunning && timeLeft > 0) { 22 | interval = setInterval(() => { 23 | setTimeLeft((prev) => prev - 1); 24 | }, 1000); 25 | } else if (timeLeft === 0 && isRunning) { 26 | setIsComplete(true); 27 | setIsRunning(false); 28 | } 29 | 30 | return () => clearInterval(interval); 31 | }, [isRunning, timeLeft]); 32 | 33 | const handleStart = () => { 34 | const totalSeconds = minutes * 60 + seconds; 35 | setTotalTime(totalSeconds); 36 | setTimeLeft(totalSeconds); 37 | setIsRunning(true); 38 | setIsComplete(false); 39 | }; 40 | 41 | const handleReset = () => { 42 | setIsRunning(false); 43 | setTimeLeft(0); 44 | setIsComplete(false); 45 | }; 46 | 47 | const progress = timeLeft > 0 ? 1 - timeLeft / totalTime : isComplete ? 1 : 0; 48 | 49 | return ( 50 |
51 | {/* Decorative Leaves */} 52 |
53 |
54 | 55 |
56 |
57 |
58 |
59 | 60 |
61 |
62 | 63 |
64 |
65 |
66 | 67 |
68 |
69 | AyuVritt (window.location.href = "/")} 76 | className="cursor-pointer" 77 | /> 78 |
79 |

80 | Growing Tree Timer 81 |

82 |

83 | Set your meditation time and watch the tree grow with you 84 |

85 |
86 | 87 | {/* Timer Input Section */} 88 |
89 |
90 |
91 |
92 | 95 | setMinutes(Number(e.target.value))} 101 | disabled={isRunning} 102 | className="w-full p-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-emerald-500 text-black" 103 | /> 104 |
105 |
106 | 109 | setSeconds(Number(e.target.value))} 115 | disabled={isRunning} 116 | className="w-full p-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-emerald-500 text-black" 117 | /> 118 |
119 |
120 |
121 | 132 | {(!isRunning && timeLeft > 0) || (!isRunning && isComplete) ? ( 133 | 139 | ) : null} 140 |
141 |
142 |
143 | 144 | {/* Growing Tree Animation */} 145 |
146 |
147 | 148 | 155 | 156 | 157 | {/* Timer Display */} 158 |
159 | 160 | {isComplete ? ( 161 | 167 | Time's Up! 168 | 169 | ) : ( 170 | 177 | {Math.floor(timeLeft / 60) 178 | .toString() 179 | .padStart(2, "0")} 180 | :{(timeLeft % 60).toString().padStart(2, "0")} 181 | 182 | )} 183 | 184 |
185 |
186 |
187 | 188 | {/* Instructions */} 189 |
190 |

191 | How to Use the Timer 192 |

193 |
    194 |
  1. 195 | Set your desired meditation duration using minutes and seconds 196 |
  2. 197 |
  3. Click "Start" to begin your meditation session
  4. 198 |
  5. Watch the tree grow as you progress through your meditation
  6. 199 |
  7. The timer will complete when the tree is fully grown
  8. 200 |
  9. Use the "Reset" button if you need to start over
  10. 201 |
202 |
203 |
204 |
205 | ); 206 | } 207 | -------------------------------------------------------------------------------- /ayuvritt/src/app/get-started/page.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import { useRouter } from "next/navigation"; 4 | import { Leaf1, Leaf2, Leaf3, SmallLeaf } from "@/components/leaves"; 5 | import { JSX } from "react"; 6 | import Image from "next/image"; 7 | import { 8 | PlantIcon, 9 | PrescriptionIcon, 10 | SkincareIcon, 11 | } from "@/components/naturopathy-icons"; 12 | 13 | interface FeatureCard { 14 | title: string; 15 | description: string; 16 | link: string; 17 | icon: JSX.Element; 18 | } 19 | 20 | export default function GetStarted() { 21 | const router = useRouter(); 22 | 23 | const features: FeatureCard[] = [ 24 | { 25 | title: "Symptom Analysis", 26 | description: 27 | "Get personalized Ayurvedic medicine recommendations based on your symptoms", 28 | link: "/medicine-recommendations", 29 | icon: ( 30 | 36 | 42 | 43 | ), 44 | }, 45 | { 46 | title: "Medicine Information", 47 | description: "Learn about different Ayurvedic medicines and their uses", 48 | link: "/medicine-information", 49 | icon: ( 50 | 56 | 62 | 63 | ), 64 | }, 65 | { 66 | title: "Yoga Therapies", 67 | description: 68 | "Explore traditional yoga poses and their therapeutic benefits", 69 | link: "/yoga-therapies", 70 | icon: ( 71 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | ), 89 | }, 90 | { 91 | title: "Meditation", 92 | description: "Controlling your mind through meditation", 93 | link: "/meditation", 94 | icon: ( 95 | 104 | 105 | 106 | 107 | 108 | 109 | ), 110 | }, 111 | { 112 | title: "Events", 113 | description: "Take part in mindfulness", 114 | link: "/events", 115 | icon: ( 116 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | ), 134 | }, 135 | { 136 | title: "Naturopathy", 137 | description: "Purity the inner self", 138 | link: "/naturopathy", 139 | icon: ( 140 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | ), 158 | }, 159 | { 160 | title: "Rising Tree", 161 | description: "Focusing on chakras", 162 | link: "/rising-tree", 163 | icon: , 164 | }, 165 | { 166 | title: "Prescription Analysis", 167 | description: "Analysing hand written prescriptions", 168 | link: "/prescription-analysis", 169 | icon: , 170 | }, 171 | { 172 | title: "Beauty Care", 173 | description: "Ayurvedic beauty care tips", 174 | link: "/beauty-care", 175 | icon: , 176 | }, 177 | ]; 178 | 179 | return ( 180 |
181 | {/* Decorative Leaves - Left Side */} 182 |
183 |
184 | 185 |
186 |
187 | 188 |
189 |
190 | 191 |
192 |
193 | 194 | {/* Decorative Leaves - Right Side */} 195 |
196 |
197 | 198 |
199 |
200 | 201 |
202 |
203 | 204 |
205 |
206 | 207 |
208 |
209 |
210 | AyuVritt (window.location.href = "/")} 217 | className="cursor-pointer" 218 | /> 219 |
220 |

221 | Choose Your Path to Wellness 222 |

223 |

224 | Select from our range of services to begin your journey towards 225 | holistic health 226 |

227 |
228 | 229 | {/* Features Grid */} 230 |
231 | {features.map((feature, index) => ( 232 |
router.push(feature.link)} 235 | className="p-6 bg-white rounded-xl shadow-sm hover:shadow-md transition cursor-pointer" 236 | > 237 |
238 | {feature.icon} 239 |
240 |

241 | {feature.title} 242 |

243 |

{feature.description}

244 |
245 | ))} 246 |
247 |
248 | 249 | {/* Small Floating Leaves */} 250 |
251 |
252 | 253 |
254 |
255 | 256 |
257 |
258 | 259 |
260 |
261 | 262 |
263 |
264 |
265 | ); 266 | } 267 | -------------------------------------------------------------------------------- /ayuvritt/src/app/naturopathy/routines/page.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import { BackButton } from "@/components/back-button"; 4 | import { Leaf1, Leaf2 } from "@/components/leaves"; 5 | import Image from "next/image"; 6 | 7 | interface TimeBlock { 8 | time: string; 9 | title: string; 10 | description: string; 11 | } 12 | 13 | interface RoutineSection { 14 | title: string; 15 | timeRange: string; 16 | activities: TimeBlock[]; 17 | } 18 | 19 | const routineData: RoutineSection[] = [ 20 | { 21 | title: "Morning Routine", 22 | timeRange: "5:00 AM - 9:00 AM", 23 | activities: [ 24 | { 25 | time: "5:00 AM", 26 | title: "Wake Up & Hydrate", 27 | description: 28 | "Start the day by drinking a glass of warm water with lemon or a pinch of Himalayan salt to detoxify and kickstart digestion.", 29 | }, 30 | { 31 | time: "5:15 AM", 32 | title: "Nasal Cleansing (Jala Neti)", 33 | description: 34 | "Use a neti pot with lukewarm saline water to cleanse the nasal passages. This helps improve breathing, reduce allergies, and clear the mind.", 35 | }, 36 | { 37 | time: "5:30 AM", 38 | title: "Hip Bath (Sitz Bath)", 39 | description: 40 | "Sit in a hip bath with cold or warm water (depending on your body's needs) for 15-20 minutes. This improves circulation, relieves pelvic tension, and aids in detoxification.", 41 | }, 42 | { 43 | time: "5:50 AM", 44 | title: "Spinal Bath", 45 | description: 46 | "Lie down in a shallow tub with cold water covering your spine for 10-15 minutes. This stimulates the nervous system, reduces stress, and energizes the body.", 47 | }, 48 | { 49 | time: "6:10 AM", 50 | title: "Ear Cleaning & Throat Gargle", 51 | description: 52 | "Clean your ears gently with a cotton swab or warm oil. Follow this with a throat gargle using warm saline water or herbal infusions (like neem or tulsi) to cleanse the throat and prevent infections.", 53 | }, 54 | { 55 | time: "6:30 AM", 56 | title: "Yoga & Pranayama", 57 | description: 58 | "Practice Surya Namaskar (Sun Salutation) for 10-15 minutes, followed by asanas like Bhujangasana (Cobra Pose), Paschimottanasana (Seated Forward Bend), and Vrikshasana (Tree Pose). End with Pranayama (Breathing Exercises) such as Anulom Vilom (Alternate Nostril Breathing) and Kapalbhati (Skull-Shining Breath) for 10 minutes to energize the body and calm the mind.", 59 | }, 60 | { 61 | time: "7:30 AM", 62 | title: "Natural Energy Juice", 63 | description: 64 | "Drink a fresh juice made of seasonal fruits or vegetables (e.g., carrot, beetroot, amla, or orange) to boost energy and immunity.", 65 | }, 66 | { 67 | time: "8:00 AM", 68 | title: "Mud Bath or Sun Bath", 69 | description: 70 | "Spend 20-30 minutes in a mud bath (if available) to detoxify the skin and relax the body. Alternatively, take a sun bath to absorb natural Vitamin D and improve mood.", 71 | }, 72 | { 73 | time: "8:30 AM", 74 | title: "Light Breakfast", 75 | description: 76 | "Have a light, nutritious breakfast such as soaked nuts, seeds, fruits, or a bowl of oatmeal. Keep portions controlled and avoid processed foods.", 77 | }, 78 | ], 79 | }, 80 | { 81 | title: "Midday Routine", 82 | timeRange: "9:00 AM - 12:00 PM", 83 | activities: [ 84 | { 85 | time: "9:00 AM", 86 | title: "Work or Activity", 87 | description: 88 | "Engage in productive work or activities while maintaining good posture and taking short breaks to stretch.", 89 | }, 90 | { 91 | time: "12:00 PM", 92 | title: "Lunch", 93 | description: 94 | "Have a balanced, plant-based lunch with whole grains, lentils, vegetables, and a small portion of salad. Avoid overeating and chew your food slowly for better digestion.", 95 | }, 96 | ], 97 | }, 98 | { 99 | title: "Afternoon Routine", 100 | timeRange: "12:00 PM - 4:00 PM", 101 | activities: [ 102 | { 103 | time: "12:30 PM", 104 | title: "Relaxation or Walk", 105 | description: 106 | "Take a short walk in nature or practice mindful breathing for 10-15 minutes to aid digestion and reduce stress.", 107 | }, 108 | { 109 | time: "2:00 PM", 110 | title: "Herbal Tea", 111 | description: 112 | "Sip on a cup of herbal tea (e.g., ginger, tulsi, or chamomile) to refresh and detoxify the body.", 113 | }, 114 | { 115 | time: "3:00 PM", 116 | title: "Ear Cleaning or Steam with Natural Leaves", 117 | description: 118 | "If needed, clean your ears gently or take a steam inhalation with natural leaves like eucalyptus or tulsi to clear the respiratory system.", 119 | }, 120 | ], 121 | }, 122 | { 123 | title: "Evening Routine", 124 | timeRange: "4:00 PM - 7:00 PM", 125 | activities: [ 126 | { 127 | time: "4:00 PM", 128 | title: "Evening Yoga", 129 | description: 130 | "Practice gentle yoga asanas like Balasana (Child's Pose), Viparita Karani (Legs-Up-The-Wall Pose), and Savasana (Corpse Pose) to relax the body and mind.", 131 | }, 132 | { 133 | time: "5:00 PM", 134 | title: "Juice or Snack", 135 | description: 136 | "Have a fresh juice or a light snack like roasted makhana (fox nuts) or a handful of nuts.", 137 | }, 138 | { 139 | time: "6:00 PM", 140 | title: "Mud Bath or Sun Bath (Optional)", 141 | description: 142 | "Repeat the mud bath or sun bath if needed, or simply spend time outdoors in nature.", 143 | }, 144 | ], 145 | }, 146 | { 147 | title: "Night Routine", 148 | timeRange: "7:00 PM - 10:00 PM", 149 | activities: [ 150 | { 151 | time: "7:00 PM", 152 | title: "Dinner", 153 | description: 154 | "Have a light, early dinner consisting of steamed vegetables, soups, or khichdi. Avoid heavy, fried, or processed foods.", 155 | }, 156 | { 157 | time: "8:00 PM", 158 | title: "Steam with Natural Leaves", 159 | description: 160 | "Take a steam inhalation with natural leaves like eucalyptus or mint to relax and clear the respiratory system.", 161 | }, 162 | { 163 | time: "8:30 PM", 164 | title: "Relaxation or Meditation", 165 | description: 166 | "Practice Yoga Nidra (Yogic Sleep) or Guided Meditation for 20-30 minutes to calm the mind and prepare for sleep.", 167 | }, 168 | { 169 | time: "9:00 PM", 170 | title: "Self-Care", 171 | description: 172 | "Clean your face and body with natural cleansers, and massage your feet with warm oil (e.g., sesame or coconut) to promote relaxation.", 173 | }, 174 | { 175 | time: "9:30 PM", 176 | title: "Gratitude Journaling", 177 | description: 178 | "Write down 3 things you are grateful for to end the day on a positive note.", 179 | }, 180 | { 181 | time: "10:00 PM", 182 | title: "Sleep", 183 | description: 184 | "Go to bed early and aim for 7-8 hours of restful sleep. Maintain a calm environment and avoid screens before bedtime.", 185 | }, 186 | ], 187 | }, 188 | ]; 189 | 190 | function TimelineItem({ activity }: { activity: TimeBlock }) { 191 | return ( 192 |
193 |
194 |
195 |
196 |
197 |
198 | {activity.time} 199 |
200 |

201 | {activity.title} 202 |

203 |

{activity.description}

204 |
205 |
206 | ); 207 | } 208 | 209 | function RoutineSection({ section }: { section: RoutineSection }) { 210 | return ( 211 |
212 |
213 |

{section.title}

214 |

{section.timeRange}

215 |
216 |
217 | {section.activities.map((activity, index) => ( 218 | 219 | ))} 220 |
221 |
222 | ); 223 | } 224 | 225 | export default function Naturopathy() { 226 | return ( 227 |
228 | {/* Decorative Leaves */} 229 |
230 |
231 | 232 |
233 |
234 |
235 |
236 | 237 |
238 |
239 | 240 |
241 |
242 |
243 | 244 |
245 |
246 | AyuVritt (window.location.href = "/")} 253 | className="cursor-pointer" 254 | /> 255 |
256 |

257 | Daily Naturopathy Routine 258 |

259 |

260 | A holistic approach to natural healing and wellness 261 |

262 |
263 | 264 |
265 | {routineData.map((section, index) => ( 266 | 267 | ))} 268 |
269 | 270 | {/* Key Notes Section */} 271 |
272 |

Key Notes

273 |
    274 |
  • 275 | 276 | 277 | Hydration: Drink plenty of water throughout the 278 | day, but avoid drinking large amounts during meals. 279 | 280 |
  • 281 |
  • 282 | 283 | 284 | Food Portions: Keep meals light and avoid 285 | overeating. Focus on fresh, seasonal, and natural foods. 286 | 287 |
  • 288 |
  • 289 | 290 | 291 | Mindfulness: Practice mindfulness during meals, 292 | yoga, and daily activities to stay present and reduce stress. 293 | 294 |
  • 295 |
  • 296 | 297 | 298 | Consistency: Follow this routine consistently 299 | to experience the full benefits of naturopathy. 300 | 301 |
  • 302 |
303 |
304 |
305 |
306 | ); 307 | } 308 | -------------------------------------------------------------------------------- /ayuvritt/src/app/naturopathy/bucketlist/page.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import { BackButton } from "@/components/back-button"; 4 | import { Leaf1, Leaf2 } from "@/components/leaves"; 5 | import Image from "next/image"; 6 | 7 | interface Item { 8 | name: string; 9 | quantity: string; 10 | priceINR: string; 11 | priceUSD: string; 12 | isReusable?: boolean; 13 | isOptional?: boolean; 14 | category: string; 15 | } 16 | 17 | const items: Item[] = [ 18 | { 19 | category: "Nasal Cleansing", 20 | name: "Neti Pot", 21 | quantity: "1 piece", 22 | priceINR: "₹200 - ₹300", 23 | priceUSD: "$2.50 - $4", 24 | isReusable: true, 25 | }, 26 | { 27 | category: "Nasal Cleansing", 28 | name: "Non-iodized Salt", 29 | quantity: "1 kg", 30 | priceINR: "₹20 - ₹30", 31 | priceUSD: "$0.25 - $0.40", 32 | }, 33 | { 34 | category: "Hip Bath & Spinal Bath", 35 | name: "Epsom Salt", 36 | quantity: "1 kg", 37 | priceINR: "₹150 - ₹200", 38 | priceUSD: "$2 - $3", 39 | isOptional: true, 40 | }, 41 | { 42 | category: "Hip Bath & Spinal Bath", 43 | name: "Essential Oils", 44 | quantity: "1 small bottle", 45 | priceINR: "₹200 - ₹500", 46 | priceUSD: "$2.50 - $6", 47 | isOptional: true, 48 | }, 49 | { 50 | category: "Ear Cleaning", 51 | name: "Cotton Swabs", 52 | quantity: "1 pack (100 pieces)", 53 | priceINR: "₹50 - ₹100", 54 | priceUSD: "$0.60 - $1.20", 55 | }, 56 | { 57 | category: "Ear Cleaning", 58 | name: "Warm Oil (Coconut/Sesame)", 59 | quantity: "100 ml", 60 | priceINR: "₹50 - ₹100", 61 | priceUSD: "$0.60 - $1.20", 62 | }, 63 | { 64 | category: "Throat Gargle", 65 | name: "Non-iodized Salt", 66 | quantity: "1 kg", 67 | priceINR: "₹20 - ₹30", 68 | priceUSD: "$0.25 - $0.40", 69 | }, 70 | { 71 | category: "Throat Gargle", 72 | name: "Herbal Infusions (Neem/Tulsi)", 73 | quantity: "1 pack", 74 | priceINR: "₹100 - ₹200", 75 | priceUSD: "$1.20 - $2.50", 76 | }, 77 | { 78 | category: "Yoga & Meditation", 79 | name: "Yoga Mat", 80 | quantity: "1 piece", 81 | priceINR: "₹500 - ₹1,000", 82 | priceUSD: "$6 - $12", 83 | isReusable: true, 84 | }, 85 | { 86 | category: "Yoga & Meditation", 87 | name: "Meditation Cushion", 88 | quantity: "1 piece", 89 | priceINR: "₹300 - ₹600", 90 | priceUSD: "$4 - $7", 91 | isOptional: true, 92 | isReusable: true, 93 | }, 94 | { 95 | category: "Natural Energy Juice", 96 | name: "Fresh Fruits/Vegetables", 97 | quantity: "Seasonal", 98 | priceINR: "₹1,500 - ₹2,000", 99 | priceUSD: "$18 - $24", 100 | }, 101 | { 102 | category: "Natural Energy Juice", 103 | name: "Juicer/Blender", 104 | quantity: "1 piece", 105 | priceINR: "₹1,500 - ₹3,000", 106 | priceUSD: "$18 - $36", 107 | isReusable: true, 108 | }, 109 | { 110 | category: "Mud Bath/Sun Bath", 111 | name: "Mud Powder", 112 | quantity: "1 kg", 113 | priceINR: "₹100 - ₹200", 114 | priceUSD: "$1.20 - $2.50", 115 | }, 116 | { 117 | category: "Mud Bath/Sun Bath", 118 | name: "Sunscreen (Natural)", 119 | quantity: "1 bottle", 120 | priceINR: "₹300 - ₹500", 121 | priceUSD: "$4 - $6", 122 | }, 123 | { 124 | category: "Steam with Natural Leaves", 125 | name: "Eucalyptus Leaves", 126 | quantity: "100 grams", 127 | priceINR: "₹50 - ₹100", 128 | priceUSD: "$0.60 - $1.20", 129 | }, 130 | { 131 | category: "Steam with Natural Leaves", 132 | name: "Tulsi Leaves", 133 | quantity: "100 grams", 134 | priceINR: "₹50 - ₹100", 135 | priceUSD: "$0.60 - $1.20", 136 | }, 137 | { 138 | category: "Steam with Natural Leaves", 139 | name: "Steam Inhaler", 140 | quantity: "1 piece", 141 | priceINR: "₹300 - ₹500", 142 | priceUSD: "$4 - $6", 143 | isReusable: true, 144 | }, 145 | { 146 | category: "Food & Nutrition", 147 | name: "Whole Grains", 148 | quantity: "5 kg", 149 | priceINR: "₹500 - ₹1,000", 150 | priceUSD: "$6 - $12", 151 | }, 152 | { 153 | category: "Food & Nutrition", 154 | name: "Lentils/Pulses", 155 | quantity: "5 kg", 156 | priceINR: "₹500 - ₹1,000", 157 | priceUSD: "$6 - $12", 158 | }, 159 | { 160 | category: "Food & Nutrition", 161 | name: "Nuts & Seeds", 162 | quantity: "1 kg", 163 | priceINR: "₹500 - ₹1,000", 164 | priceUSD: "$6 - $12", 165 | }, 166 | { 167 | category: "Food & Nutrition", 168 | name: "Cold-Pressed Oils", 169 | quantity: "1 liter", 170 | priceINR: "₹200 - ₹400", 171 | priceUSD: "$2.50 - $5", 172 | }, 173 | { 174 | category: "Herbal Teas", 175 | name: "Herbal Tea Bags", 176 | quantity: "30 pieces", 177 | priceINR: "₹150 - ₹300", 178 | priceUSD: "$2 - $4", 179 | isOptional: true, 180 | }, 181 | { 182 | category: "Self-Care", 183 | name: "Natural Face Cleanser", 184 | quantity: "1 bottle", 185 | priceINR: "₹200 - ₹400", 186 | priceUSD: "$2.50 - $5", 187 | }, 188 | { 189 | category: "Self-Care", 190 | name: "Warm Oil for Foot Massage", 191 | quantity: "100 ml", 192 | priceINR: "₹50 - ₹100", 193 | priceUSD: "$0.60 - $1.20", 194 | }, 195 | { 196 | category: "Gratitude Journaling", 197 | name: "Journal/Notebook", 198 | quantity: "1 piece", 199 | priceINR: "₹50 - ₹100", 200 | priceUSD: "$0.60 - $1.20", 201 | }, 202 | { 203 | category: "Gratitude Journaling", 204 | name: "Pen", 205 | quantity: "1 piece", 206 | priceINR: "₹10 - ₹20", 207 | priceUSD: "$0.10 - $0.25", 208 | }, 209 | ]; 210 | 211 | const categories = [ 212 | "Nasal Cleansing", 213 | "Hip Bath & Spinal Bath", 214 | "Ear Cleaning", 215 | "Throat Gargle", 216 | "Yoga & Meditation", 217 | "Natural Energy Juice", 218 | "Mud Bath/Sun Bath", 219 | "Steam with Natural Leaves", 220 | "Food & Nutrition", 221 | "Herbal Teas", 222 | "Self-Care", 223 | "Gratitude Journaling", 224 | ]; 225 | 226 | function CategorySection({ 227 | category, 228 | items, 229 | }: { 230 | category: string; 231 | items: Item[]; 232 | }) { 233 | const categoryItems = items.filter((item) => item.category === category); 234 | 235 | return ( 236 |
237 |

238 | {category} 239 |

240 |
241 | 242 | 243 | 244 | 247 | 250 | 253 | 256 | 257 | 258 | 259 | {categoryItems.map((item, index) => ( 260 | 261 | 278 | 281 | 284 | 287 | 288 | ))} 289 | 290 |
245 | Item 246 | 248 | Quantity 249 | 251 | Price (INR) 252 | 254 | Price (USD) 255 |
262 |
263 |
264 | {item.name} 265 | {item.isReusable && ( 266 | 267 | Reusable 268 | 269 | )} 270 | {item.isOptional && ( 271 | 272 | Optional 273 | 274 | )} 275 |
276 |
277 |
279 | {item.quantity} 280 | 282 | {item.priceINR} 283 | 285 | {item.priceUSD} 286 |
291 |
292 |
293 | ); 294 | } 295 | 296 | export default function BucketlistPage() { 297 | return ( 298 |
299 | {/* Decorative Leaves */} 300 |
301 |
302 | 303 |
304 |
305 |
306 |
307 | 308 |
309 |
310 | 311 |
312 |
313 |
314 | 315 |
316 |
317 | AyuVritt (window.location.href = "/")} 324 | className="cursor-pointer" 325 | /> 326 |
327 |

328 | Naturopathy Supplies 329 |

330 |

331 | Monthly checklist of items needed for your naturopathy routine 332 |

333 |
334 | 335 | {/* Categories */} 336 |
337 | {categories.map((category) => ( 338 | 339 | ))} 340 |
341 | 342 | {/* Total Cost Section */} 343 |
344 |

345 | Total Estimated Monthly Cost 346 |

347 |

Initial Cost

348 |
349 |
350 |
351 |

Indian Rupees (INR)

352 |

₹7,000

353 |
354 |
355 |

US Dollars (USD)

356 |

$85

357 |
358 |
359 |
360 | 361 |

362 | Remaining monthly cost same as montly expenses. 363 |

364 |
365 | 366 | {/* Notes Section */} 367 |
368 |

Notes

369 |
    370 |
  • 371 | 372 | 373 | Reusable Items: Items like the neti pot, yoga 374 | mat, juicer, and steam inhaler are one-time purchases and may 375 | not need to be replaced monthly. 376 | 377 |
  • 378 |
  • 379 | 380 | 381 | Seasonal Variations: The cost of fresh fruits 382 | and vegetables may vary depending on the season and location. 383 | 384 |
  • 385 |
  • 386 | 387 | 388 | Optional Items: Essential oils, meditation 389 | cushions, and herbal teas are optional and can be skipped if not 390 | needed. 391 | 392 |
  • 393 |
394 |
395 |
396 |
397 | ); 398 | } 399 | -------------------------------------------------------------------------------- /ayuvritt/src/app/prescription-analysis/page.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import { BackButton } from "@/components/back-button"; 4 | import { Leaf1, Leaf2 } from "@/components/leaves"; 5 | import { PrescriptionIcon } from "@/components/naturopathy-icons"; 6 | import Image from "next/image"; 7 | import { useState, useRef } from "react"; 8 | 9 | interface AnalysisResponse { 10 | error: string | null; 11 | medicines: string[]; 12 | dosage: string[]; 13 | duration: string[]; 14 | description: string; 15 | } 16 | 17 | export default function PrescriptionAnalysisPage() { 18 | const [selectedImage, setSelectedImage] = useState(null); 19 | const [imagePreview, setImagePreview] = useState(""); 20 | const [isLoading, setIsLoading] = useState(false); 21 | const [analysis, setAnalysis] = useState(null); 22 | const [error, setError] = useState(""); 23 | const videoRef = useRef(null); 24 | const [showCamera, setShowCamera] = useState(false); 25 | const [facingMode, setFacingMode] = useState<"environment" | "user">( 26 | "environment" 27 | ); 28 | 29 | const handleImageSelect = (e: React.ChangeEvent) => { 30 | const file = e.target.files?.[0]; 31 | if (file) { 32 | setSelectedImage(file); 33 | setImagePreview(URL.createObjectURL(file)); 34 | setAnalysis(null); 35 | setError(""); 36 | } 37 | }; 38 | 39 | const startCamera = async () => { 40 | try { 41 | const stream = await navigator.mediaDevices.getUserMedia({ 42 | video: { 43 | facingMode: facingMode, 44 | width: { ideal: 1280 }, 45 | height: { ideal: 720 }, 46 | }, 47 | audio: false, 48 | }); 49 | setShowCamera(true); 50 | if (videoRef.current) { 51 | videoRef.current.srcObject = stream; 52 | videoRef.current.play(); 53 | setShowCamera(true); 54 | } 55 | } catch (err) { 56 | setError("Failed to access camera, " + err); 57 | } 58 | }; 59 | 60 | const stopCamera = () => { 61 | if (videoRef.current) { 62 | const stream = videoRef.current.srcObject as MediaStream; 63 | stream?.getTracks().forEach((track) => track.stop()); 64 | setShowCamera(false); 65 | } 66 | }; 67 | 68 | const switchCamera = async () => { 69 | await stopCamera(); 70 | setFacingMode((prev) => (prev === "environment" ? "user" : "environment")); 71 | startCamera(); 72 | }; 73 | 74 | const capturePhoto = () => { 75 | if (videoRef.current) { 76 | const canvas = document.createElement("canvas"); 77 | canvas.width = videoRef.current.videoWidth; 78 | canvas.height = videoRef.current.videoHeight; 79 | const ctx = canvas.getContext("2d"); 80 | ctx?.drawImage(videoRef.current, 0, 0); 81 | 82 | canvas.toBlob((blob) => { 83 | if (blob) { 84 | const file = new File([blob], "prescription.jpg", { 85 | type: "image/jpeg", 86 | }); 87 | setSelectedImage(file); 88 | setImagePreview(URL.createObjectURL(file)); 89 | setAnalysis(null); 90 | setError(""); 91 | stopCamera(); 92 | } 93 | }, "image/jpeg"); 94 | } 95 | }; 96 | 97 | const analyzeImage = async () => { 98 | if (!selectedImage) return; 99 | 100 | setIsLoading(true); 101 | setError(""); 102 | 103 | try { 104 | const formData = new FormData(); 105 | formData.append("image", selectedImage); 106 | 107 | const response = await fetch( 108 | process.env.NEXT_PUBLIC_API_URL + "/prescriptionAnalysis", 109 | { 110 | method: "POST", 111 | body: formData, 112 | } 113 | ); 114 | 115 | const data = await response.json(); 116 | 117 | if (!response.ok) { 118 | throw new Error(data.error || "Failed to analyze prescription"); 119 | } 120 | 121 | setAnalysis({ 122 | error: data.error, 123 | medicines: [data.recognized_medicines], 124 | dosage: [data.Dose], 125 | duration: [data.Precautions], 126 | description: data.Indications, 127 | }); 128 | } catch (err) { 129 | setError(err instanceof Error ? err.message : "An error occurred"); 130 | } finally { 131 | setIsLoading(false); 132 | } 133 | }; 134 | 135 | return ( 136 |
137 | {/* Decorative Leaves */} 138 |
139 |
140 | 141 |
142 |
143 |
144 |
145 | 146 |
147 |
148 | 149 |
150 |
151 |
152 | 153 |
154 |
155 | AyuVritt (window.location.href = "/")} 162 | className="cursor-pointer" 163 | /> 164 |
165 |

166 | Prescription Analysis 167 |

168 |

169 | Upload a prescription image to analyze its contents 170 |

171 |
172 | 173 |
174 |
175 |
176 | 177 |
178 | 179 |
180 |
181 | {/* File Upload Button */} 182 | 206 | 207 | {/* Camera Button */} 208 | 233 |
234 | 235 | {/* Camera View */} 236 | {showCamera && ( 237 |
238 |
282 | )} 283 | 284 | {/* Image Preview - only show when not showing camera */} 285 | {!showCamera && imagePreview && ( 286 |
287 |
288 | Selected prescription 294 |
295 | 302 |
303 | )} 304 | 305 | {error && ( 306 |
307 | {error} 308 |
309 | )} 310 | 311 | {analysis && ( 312 |
313 |

314 | Analysis Results 315 |

316 | 317 | {analysis.medicines.map((medicine, index) => ( 318 |
319 |
{medicine}
320 |
321 | Dosage: {analysis.dosage[index]} 322 |
323 |
324 | Duration: {analysis.duration[index]} 325 |
326 |
327 | ))} 328 | 329 | {analysis.description && ( 330 |
331 |

332 | Additional Notes 333 |

334 |

{analysis.description}

335 |
336 | )} 337 |
338 | )} 339 |
340 |
341 |
342 |
343 |
344 | ); 345 | } 346 | -------------------------------------------------------------------------------- /ayuvritt/src/app/learn-more/page.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import Image from "next/image"; 4 | import { Leaf1, Leaf2, Leaf3, SmallLeaf } from "@/components/leaves"; 5 | 6 | export default function LearnMore() { 7 | return ( 8 |
9 | {/* Decorative Leaves - Left Side */} 10 |
11 |
12 | 13 |
14 |
15 | 16 |
17 |
18 | 19 |
20 |
21 | 22 | {/* Decorative Leaves - Right Side */} 23 |
24 |
25 | 26 |
27 |
28 | 29 |
30 |
31 | 32 |
33 |
34 | 35 | {/* Small Floating Leaves */} 36 |
37 |
38 | 39 |
40 |
41 | 42 |
43 |
44 | 45 |
46 |
47 | 48 |
49 |
50 | 51 |
52 | {/* Header Section */} 53 |
54 | AyuVritt (window.location.href = "/")} 60 | /> 61 |
62 |
63 |

64 | Understanding AyuVritt 65 |

66 |

67 | Discover how we're revolutionizing healthcare by combining 68 | ancient Ayurvedic wisdom with modern scientific validation. 69 |

70 |
71 | 72 | {/* Information Grid */} 73 |
74 |
75 | {/* Subtle corner leaf decoration */} 76 |
77 | 78 |
79 | 80 |

81 | Our Mission 82 |

83 |

84 | We aim to bridge the gap between traditional Ayurvedic medicine 85 | and modern healthcare through advanced AI-driven analysis and 86 | scientific validation. 87 |

88 |
    89 |
  • 90 | 96 | 102 | 103 | Validate traditional formulations with modern science 104 |
  • 105 |
  • 106 | 112 | 118 | 119 | Enhance the credibility of Ayurvedic medicine 120 |
  • 121 |
  • 122 | 128 | 134 | 135 | Create sustainable healthcare solutions 136 |
  • 137 |
138 |
139 | 140 |
141 | {/* Subtle corner leaf decoration */} 142 |
143 | 144 |
145 | 146 |

147 | Our Approach 148 |

149 |

150 | Using cutting-edge technology and rigorous scientific methods to 151 | analyze and validate traditional Ayurvedic formulations. 152 |

153 |
154 |
155 |
156 | 162 | 168 | 169 |
170 |
171 |

172 | AI-Powered Analysis 173 |

174 |

175 | Deep learning models analyze ancient texts and modern 176 | research 177 |

178 |
179 |
180 |
181 |
182 | 188 | 194 | 195 |
196 |
197 |

198 | Scientific Validation 199 |

200 |

201 | Rigorous testing and documentation of effects 202 |

203 |
204 |
205 |
206 |
207 |
208 | 209 |
210 |
211 |

212 | Key Benefits 213 |

214 |
215 |
216 |
217 | 223 | 229 | 230 |
231 |

Enhanced Safety

232 |

233 | Comprehensive analysis of potential side effects 234 |

235 |
236 |
237 |
238 | 244 | 250 | 251 |
252 |

Proven Efficacy

253 |

254 | Scientifically validated formulations 255 |

256 |
257 |
258 |
259 | 265 | 271 | 272 |
273 |

Innovation

274 |

275 | Bridging traditional wisdom with modern technology 276 |

277 |
278 |
279 |
280 |
281 | 282 | {/* CTA Section with Leaf Decoration */} 283 |
284 | = 285 |
286 |

287 | Ready to Get Started? 288 |

289 |

290 | Join us in revolutionizing healthcare by combining the best of 291 | both worlds. 292 |

293 | 301 |
302 |
303 |
304 |
305 | ); 306 | } 307 | -------------------------------------------------------------------------------- /api/datasets/meditation.csv: -------------------------------------------------------------------------------- 1 | Name,Description,Duration,Instructions,,,,,,,,,Issue 2 | Mindfulness Meditation,Focuses on being present in the moment and non-judgmentally observing your thoughts and surroundings.,10-30 minutes,"Sit in a comfortable position with your eyes closed and focus on your breath. When your mind wanders, gently bring your attention back to your breath.",,,,,,,,,Stress and Anxiety 3 | Transcendental Meditation,Uses a mantra to help quiet the mind and achieve a deep state of relaxation.,"20 minutes, twice a day",Sit in a comfortable position with your eyes closed and repeat a mantra silently to yourself. Allow your mind to become absorbed in the mantra.,,,,,,,,,Insomnia 4 | Loving-Kindness Meditation,Involves generating feelings of love and compassion towards oneself and others.,10-30 minutes,Sit in a comfortable position with your eyes closed and repeat phrases of loving-kindness to yourself and others.,,,,,,,,,Lack of Focus 5 | Body Scan Meditation,"Involves systematically bringing attention to different parts of the body, noticing sensations and relaxing tension.",10-30 minutes,Lie down or sit in a comfortable position with your eyes closed. Focus on each part of your body starting from your toes and working your way up to the top of your head.,,,,,,,,,Low Self-Esteem 6 | Vipassana Meditation,Involves observing the breath and bodily sensations to gain insight into the nature of reality.,30-60 minutes,Sit in a comfortable position with your eyes closed and observe your breath and bodily sensations without judgement.,,,,,,,,,Chronic Pain 7 | Zen Meditation,"Involves sitting in silence and focusing on the breath, often with the support of a teacher or group.",20-40 minutes,Sit in a comfortable position with your eyes half-closed and focus on your breath. Follow the instructions of your teacher.,,,,,,,,,Emotional Trauma 8 | Chakra Meditation,Involves focusing on each of the body's energy centers to balance and align them.,10-30 minutes,"Sit in a comfortable position with your eyes closed and focus on each chakra, starting from the base of your spine and working your way up to the crown of your head.",,,,,,,,,Anger and Frustration 9 | Mantra Meditation,Involves repeating a word or phrase to focus the mind and achieve a calm state.,10-30 minutes,Sit in a comfortable position with your eyes closed and repeat a mantra silently to yourself. Allow your mind to become absorbed in the mantra.,,,,,,,,,Depression 10 | Breath Counting Meditation,Involves counting each breath to maintain focus and concentration.,10-30 minutes,Sit in a comfortable position with your eyes closed and count each inhale and exhale up to 10. Start over at 1 if you get distracted.,,,,,,,,,Overthinking 11 | Walking Meditation,"Involves walking slowly and mindfully, focusing on each step and the sensations in the body.",10-30 minutes,"Find a quiet place to walk slowly. Focus on each step, the sensations in your feet and legs, and the environment around you.",,,,,,,,,Lack of Energy 12 | Visualization Meditation,Involves creating a mental image or scenario to promote relaxation and positive emotions.,10-30 minutes,Sit in a comfortable position with your eyes closed and visualize a peaceful scene or positive outcome. Engage all your senses in the visualization.,,,,,,,,,Spiritual Disconnection 13 | Yoga Nidra Meditation,Involves lying down and systematically relaxing different parts of the body to achieve a deep state of relaxation.,20-40 minutes,Lie down in a comfortable position and follow the instructions of the teacher as they guide you through relaxation of each part of the body.,,,,,,,,,Relationship Issues 14 | Sound Meditation,Involves focusing on a particular sound or a series of sounds to promote relaxation.,10-30 minutes,"Sit in a comfortable position with your eyes closed and focus on a particular sound, such as chanting, a gong, or a singing bowl.",,,,,,,,,Procrastination 15 | Qi Gong Meditation,"Involves combining movement, breath, and visualization to improve physical and mental health.",10-30 minutes,"Follow the movements and breathing exercises of a Qi Gong teacher or video, and visualize the flow of energy in your body.",,,,,,,,,Grief and Loss 16 | Kundalini Meditation,"Involves combining breathwork, movement, and mantra to awaken the energy at the base of the spine and raise it up through the chakras.",10-30 minutes,"Follow the instructions of a Kundalini teacher or video, combining breathwork, movement, and mantra.",,,,,,,,,Lack of Motivation 17 | Silent Meditation,Involves sitting in silence and observing the mind without judgment.,10-60 minutes,Sit in a comfortable position with your eyes closed and observe your thoughts and sensations without getting caught up in them.,,,,,,,,,Physical Tension 18 | Open Monitoring Meditation,Involves observing one's thoughts and feelings without judgment and allowing them to come and go.,10-30 minutes,Sit in a comfortable position with your eyes closed and observe your thoughts and feelings without trying to change or control them.,,,,,,,,,Overwhelm 19 | Focused Attention Meditation,Involves focusing on a specific object or sound to maintain concentration and develop awareness.,10-30 minutes,"Sit in a comfortable position with your eyes closed and focus on a specific object or sound, such as a candle flame or the sound of a bell.",,,,,,,,,Loneliness 20 | Metta Meditation,Involves cultivating feelings of loving-kindness and compassion towards oneself and others.,10-30 minutes,Sit in a comfortable position with your eyes closed and repeat phrases of loving-kindness to yourself and others.,,,,,,,,,Lack of Creativity 21 | Body Awareness Meditation,Involves focusing on the sensations in the body to develop awareness and relaxation.,10-30 minutes,"Sit in a comfortable position with your eyes closed and focus on the sensations in your body, such as warmth, tingling, or tension.",,,,,,,,,Fear and Uncertainty 22 | Compassion Meditation,Involves cultivating feelings of empathy and compassion towards oneself and others.,10-30 minutes,Sit in a comfortable position with your eyes closed and visualize yourself and others experiencing happiness and freedom from suffering.,,,,,,,,,Digestive Issues 23 | Breath Awareness and Body Scan Meditation,Involves combining breath awareness and body scan techniques to promote relaxation and awareness.,10-30 minutes,Lie down or sit in a comfortable position with your eyes closed and focus on your breath and the sensations in your body.,,,,,,,,,Lack of Patience 24 | Progressive Muscle Relaxation,Involves tensing and relaxing different muscle groups to promote relaxation and reduce tension.,10-30 minutes,Lie down in a comfortable position and systematically tense and then release each muscle group in your body.,,,,,,,,,Burnout 25 | Guided Meditation,Involves following the instructions of a teacher or audio recording to promote relaxation and awareness.,10-30 minutes,Sit in a comfortable position with your eyes closed and follow the instructions of the teacher or recording.,,,,,,,,,Negative Self-Talk 26 | Mindful Eating Meditation,"Involves eating slowly and mindfully, focusing on the taste, texture, and sensations of the food.",10-30 minutes,"Choose a food to eat, sit in a quiet place, and focus on the taste, texture, and sensations of each bite.",,,,,,,,,Lack of Connection with Nature 27 | Mindful Breathing Meditation,Involves focusing on the breath to promote relaxation and develop awareness.,10-30 minutes,"Sit in a comfortable position with your eyes closed and focus on your breath, observing each inhale and exhale.",,,,,,,,,Difficulty Letting Go 28 | Compassionate Mind Meditation,Involves cultivating feelings of compassion and empathy towards oneself and others.,10-30 minutes,Sit in a comfortable position with your eyes closed and visualize yourself and others experiencing happiness and freedom from suffering.,,,,,,,,,Lack of Gratitude 29 | Spiritual Meditation,Involves connecting with a higher power or spiritual practice to promote relaxation and inner peace.,10-30 minutes,Sit in a comfortable position with your eyes closed and connect with your higher power or spiritual practice through prayer or visualization.,,,,,,,,,Difficulty Sleeping 30 | Chanting Meditation,Involves repeating a sound or phrase to promote relaxation and focus.,10-30 minutes,"Sit in a comfortable position with your eyes closed and repeat a sound or phrase, such as 'Om' or 'peace'.",,,,,,,,,Lack of Self-Compassion 31 | Third Eye Meditation,Involves focusing on the area between the eyebrows to promote relaxation and develop intuition.,10-30 minutes,"Sit in a comfortable position with your eyes closed and focus on the area between your eyebrows, imagining a light or energy there.",,,,,,,,,Difficulty Managing Emotions 32 | Mudra Meditation,Involves using hand gestures to promote relaxation and focus.,10-30 minutes,"Sit in a comfortable position with your eyes closed and use a specific hand gesture, or mudra, to promote relaxation and focus.",,,,,,,,,Lack of Balance in Life 33 | Self-Inquiry Meditation,Involves asking oneself open-ended questions to promote self-awareness and understanding.,10-30 minutes,"Sit in a comfortable position with your eyes closed and ask yourself open-ended questions, such as 'Who am I?' or 'What do I really want?'.",,,,,,,,,Difficulty with Decision-Making 34 | Inner Light Meditation,Involves focusing on a bright light within oneself to promote relaxation and inner peace.,10-30 minutes,"Sit in a comfortable position with your eyes closed and imagine a bright light within yourself, focusing on its warmth and energy.",,,,,,,,,Lack of Inner Peace 35 | Mindful Movement Meditation,Involves combining movement and mindfulness to promote relaxation and awareness.,10-30 minutes,"Engage in a gentle movement practice, such as yoga or tai chi, while maintaining awareness of your body and breath.",,,,,,,,,Difficulty with Forgiveness 36 | Gratitude Meditation,Involves focusing on feelings of gratitude and appreciation to promote positivity and well-being.,10-30 minutes,"Sit in a comfortable position with your eyes closed and focus on things you are grateful for, allowing yourself to feel the emotions associated with gratitude.",,,,,,,,,Lack of Positivity 37 | Affirmation Meditation,Involves repeating positive affirmations to promote self-confidence and positivity.,10-30 minutes,"Sit in a comfortable position with your eyes closed and repeat positive affirmations to yourself, such as 'I am worthy' or 'I am capable'.",,,,,,,,,Difficulty with Self-Acceptance 38 | Compassionate Body Scan Meditation,Involves combining body scan and compassionate meditation techniques to promote relaxation and self-compassion.,10-30 minutes,"Lie down or sit in a comfortable position with your eyes closed and focus on each part of your body, sending feelings of love and compassion towards yourself.",,,,,,,,,Lack of Connection with Others 39 | Breath and Sound Meditation,Involves combining breath and sound awareness to promote relaxation and focus.,10-30 minutes,"Sit in a comfortable position with your eyes closed and focus on your breath and a specific sound, such as white noise or a mantra.",,,,,,,,,Difficulty with Relaxation 40 | Morning Meditation,Involves starting the day with a meditation practice to promote focus and positivity.,10-30 minutes,Sit in a comfortable position with your eyes closed and start the day with a meditation practice of your choice.,,,,,,,,,Lack of Clarity 41 | Evening Meditation,Involves ending the day with a meditation practice to promote relaxation and restful sleep.,10-30 minutes,Sit in a comfortable position with your eyes closed and end the day with a meditation practice of your choice.,,,,,,,,,Difficulty with Self-Reflection 42 | Breath and Body Awareness Meditation,Involves focusing on the breath and sensations in the body to promote relaxation and awareness.,10-30 minutes,Sit in a comfortable position with your eyes closed and focus on your breath and the sensations in your body.,,,,,,,,,Lack of Energy Flow 43 | Mindful Communication Meditation,Involves practicing mindful communication with oneself and others to promote understanding and connection.,10-30 minutes,Sit in a comfortable position with your eyes closed and visualize communicating mindfully with yourself and others.,,,,,,,,,Difficulty with Mindful Eating 44 | Labyrinth Meditation,Involves walking a labyrinth to promote relaxation and focus.,10-30 minutes,"Find a labyrinth and walk it slowly and mindfully, focusing on each step and the path ahead.",,,,,,,,,Lack of Emotional Balance 45 | Color Visualization Meditation,Involves visualizing different colors and their associated emotions to promote relaxation and positivity.,10-30 minutes,"Sit in a comfortable position with your eyes closed and visualize different colors, focusing on the emotions associated with each color.",,,,,,,,,Difficulty with Self-Worth 46 | Breath and Loving-Kindness Meditation,Involves combining breath awareness and loving-kindness meditation to promote relaxation and compassion.,10-30 minutes,"Sit in a comfortable position with your eyes closed and focus on your breath, while also sending feelings of love and compassion towards yourself and others.",,,,,,,,,Lack of Connection with Higher Self 47 | Gratitude Journaling Meditation,Involves journaling about things you are grateful for to promote positivity and well-being.,10-30 minutes,"Write in a journal about things you are grateful for, focusing on the emotions associated with gratitude.",,,,,,,,,Difficulty with Letting Go of Control 48 | Sitting with Difficult Emotions Meditation,Involves sitting with uncomfortable emotions to promote self-awareness and acceptance.,10-30 minutes,Sit in a comfortable position with your eyes closed and allow yourself to feel difficult emotions without judgement or resistance.,,,,,,,,,Lack of Joy 49 | Mindful Walking Meditation,"Involves walking slowly and mindfully, focusing on each step and the environment around you.",10-30 minutes,"Find a quiet place to walk slowly, focusing on each step and the environment around you.",,,,,,,,,Difficulty with Self-Discipline 50 | Gratitude Body Scan Meditation,Involves combining body scan and gratitude techniques to promote relaxation and positivity.,10-30 minutes,"Lie down or sit in a comfortable position with your eyes closed and focus on each part of your body, while also feeling gratitude for each part.",,,,,,,,,Lack of Inner Strength 51 | Breath and Body Awareness in Nature Meditation,Involves combining breath and body awareness with being in nature to promote relaxation and connection.,10-30 minutes,"Find a quiet place in nature to sit or walk, focusing on your breath and the sensations in your body.",,,,,,,,,Difficulty with Acceptance 52 | Breath and Loving-Kindness in Nature Meditation,Involves combining breath awareness and loving-kindness meditation with being in nature to promote relaxation and connection.,10-30 minutes,"Find a quiet place in nature to sit or walk, focusing on your breath and sending feelings of love and compassion towards yourself and others.",,,,,,,,,Lack of Connection with the Present Moment 53 | Compassionate Forgiveness Meditation,Involves cultivating feelings of compassion and forgiveness towards oneself and others.,10-30 minutes,Sit in a comfortable position with your eyes closed and visualize yourself and others experiencing forgiveness and freedom from past hurt.,,,,,,,,,Difficulty with Emotional Release 54 | Breath and Body Awareness with Affirmations Meditation,Involves combining breath and body awareness with positive affirmations to promoterelaxation and positivity.,10-30 minutes,"Sit in a comfortable position with your eyes closed and focus on your breath and the sensations in your body, while also repeating positive affirmations to yourself.",,,,,,,,,Lack of Inner Calm 55 | Body Awareness and Gratitude Meditation,Involves combining body awareness and gratitude techniques to promote relaxation and positivity.,10-30 minutes,"Lie down or sit in a comfortable position with your eyes closed and focus on each part of your body, while also feeling gratitude for each part.",,,,,,,,,Difficulty with Self-Expression 56 | Breath and Open Awareness Meditation,Involves focusing on the breath and open awareness of thoughts and sensations to promote relaxation and mindfulness.,10-30 minutes,"Sit in a comfortable position with your eyes closed and focus on your breath, while also allowing thoughts and sensations to come and go without judgement.",,,,,,,,,Lack of Connection with the Body 57 | Singing Bowl Meditation,Involves listening to the sound of a singing bowl to promote relaxation and focus.,10-30 minutes,"Sit in a comfortable position with your eyes closed and listen to the sound of a singing bowl, focusing on the vibrations and sensations in your body.",,,,,,,,,Difficulty with Self-Love 58 | Body Scan and Loving-Kindness Meditation,Involves combining body scan and loving-kindness techniques to promote relaxation and compassion.,10-30 minutes,"Lie down or sit in a comfortable position with your eyes closed and focus on each part of your body, while also sending feelings of love and compassion towards yourself and others.",,,,,,,,,Lack of Connection with the Universe 59 | Breath and Movement Meditation,Involves combining breath awareness and gentle movement to promote relaxation and mindfulness.,10-30 minutes,"Sit or stand in a comfortable position and focus on your breath, while also gently moving your body in a way that feels good.",,,,,,,,,Difficulty with Emotional Healing 60 | Gratitude Visualization Meditation,Involves visualizing things you are grateful for to promote positivity and well-being.,10-30 minutes,"Sit in a comfortable position with your eyes closed and visualize things you are grateful for, focusing on the emotions associated with gratitude.",,,,,,,,,Lack of Connection with the Breath 61 | Loving-Kindness Meditation,Involves sending feelings of love and compassion towards oneself and others to promote well-being.,10-30 minutes,Sit in a comfortable position with your eyes closed and focus on sending feelings of love and compassion towards yourself and others.,,,,,,,,,Difficulty with Self-Awareness 62 | Breath and Body Awareness with Mantra Meditation,Involves combining breath and body awareness with a mantra to promote relaxation and focus.,10-30 minutes,"Sit in a comfortable position with your eyes closed and focus on your breath and the sensations in your body, while also repeating a mantra to yourself.",,,,,,,,,Lack of Connection with the Heart 63 | Relaxation Meditation,Involves promoting relaxation in the body and mind through various techniques such as progressive muscle relaxation and visualization.,10-30 minutes,Lie down or sit in a comfortable position with your eyes closed and practice various relaxation techniques such as progressive muscle relaxation and visualization.,,,,,,,,,Difficulty with Emotional Balance 64 | Self-Compassion Meditation,Involves cultivating feelings of self-compassion and acceptance to promote well-being.,10-30 minutes,"Sit in a comfortable position with your eyes closed and focus on sending feelings of love, compassion, and acceptance towards yourself.",,,,,,,,,Lack of Connection with the Mind 65 | Breath and Loving-Kindness in Community Meditation,Involves combining breath awareness and loving-kindness meditation with the idea of community to promote connection and positivity.,10-30 minutes,"Sit in a comfortable position with your eyes closed and focus on your breath, while also sending feelings of love and compassion towards yourself and the community.",,,,,,,,,Difficulty with Self-Reflection 66 | Gratitude and Loving-Kindness Meditation,Involves combining gratitude and loving-kindness techniques to promote positivity and well-being.,10-30 minutes,Sit in a comfortable position with your eyes closed and focus on sending feelings of love and gratitude towards yourself and others.,,,,,,,,,Lack of Connection with the Soul 67 | Breath and Body Awareness with Chakra Meditation,Involves combining breath and body awareness with the concept of chakras to promote relaxation and balance.,10-30 minutes,"Sit in a comfortable position with your eyes closed and focus on your breath and the sensations in your body, while also visualizing the energy centers in your body known as chakras.",,,,,,,,,Difficulty with Emotional Clarity 68 | Mindful Eating Meditation,Involves practicing mindfulness while eating to promote awareness and enjoyment of food.,10-30 minutes,"Choose a food to eat mindfully, focusing on the taste, texture, and sensations in your body while eating.",,,,,,,,,Lack of Connection with the Earth 69 | Compassionate Self-Talk Meditation,Involves cultivating positive self-talk and self-compassion to promote well-being.,10-30 minutes,Sit in a comfortable position with your eyes closed and focus on cultivating positive self-talk and sending feelings of self-compassion towards yourself.,,,,,,,,,Difficulty with Self-Acceptance -------------------------------------------------------------------------------- /ayuvritt/src/app/medicine-recommendations/page.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import { useState, useEffect } from "react"; 4 | import Image from "next/image"; 5 | import { Leaf1, Leaf2 } from "@/components/leaves"; 6 | import { BackButton } from "@/components/back-button"; 7 | 8 | interface LocationResult { 9 | display_name: string; 10 | place_id: number; 11 | } 12 | 13 | interface Doctor { 14 | name: string; 15 | distance: number; 16 | address: string; 17 | type: string; 18 | } 19 | 20 | interface NominatimPlace { 21 | display_name: string; 22 | importance: number; 23 | type: string; 24 | lat: string; 25 | lon: string; 26 | } 27 | 28 | interface Coordinates { 29 | lat: number; 30 | lon: number; 31 | } 32 | 33 | export default function Start() { 34 | const [showResult, setShowResult] = useState(false); 35 | const [medicineInfo, setMedicineInfo] = useState(""); 36 | const [diseaseInfo, setDiseaseInfo] = useState(""); 37 | const [loading, setLoading] = useState(false); 38 | const [formData, setFormData] = useState({ 39 | name: "", 40 | age: "", 41 | location: "", 42 | issues: "", 43 | }); 44 | const [loadingLocation, setLoadingLocation] = useState(false); 45 | const [locationError, setLocationError] = useState(""); 46 | const [searchResults, setSearchResults] = useState([]); 47 | const [showSuggestions, setShowSuggestions] = useState(false); 48 | const [doctors, setDoctors] = useState([]); 49 | const [loadingDoctors, setLoadingDoctors] = useState(false); 50 | const [showDoctors, setShowDoctors] = useState(false); 51 | 52 | useEffect(() => { 53 | const handleClickOutside = (event: MouseEvent) => { 54 | if (!(event.target as HTMLElement).closest("#location")) { 55 | setShowSuggestions(false); 56 | } 57 | }; 58 | 59 | document.addEventListener("mousedown", handleClickOutside); 60 | return () => document.removeEventListener("mousedown", handleClickOutside); 61 | }, []); 62 | 63 | const getMedicineInfo = async ( 64 | symptoms: string 65 | ): Promise<[string | null, string | null, string | null]> => { 66 | try { 67 | const response = await fetch( 68 | `${ 69 | process.env.NEXT_PUBLIC_API_URL 70 | }/getMedicine?symptoms=${encodeURIComponent(symptoms)}` 71 | ); 72 | const data = await response.json(); 73 | if (data.error) { 74 | return [null, null, data.error]; 75 | } 76 | return [data.medicine, data.disease, null]; 77 | // eslint-disable-next-line @typescript-eslint/no-explicit-any 78 | } catch (error: any) { 79 | return [null, null, error.toString()]; 80 | } 81 | }; 82 | let disease, medicine; 83 | const handleSubmit = async (e: React.FormEvent) => { 84 | e.preventDefault(); 85 | setLoading(true); 86 | try { 87 | const res = await getMedicineInfo(formData.issues.trim()); 88 | medicine = res[0]; 89 | disease = res[1]; 90 | const error = res[2]; 91 | if (error) { 92 | alert(error); 93 | setLoading(false); 94 | return; 95 | } 96 | setMedicineInfo(medicine || ""); 97 | setDiseaseInfo(disease || ""); 98 | } catch (error) { 99 | console.error("Error in submission:", error); 100 | setMedicineInfo("paracetamol"); // Default fallback 101 | setDiseaseInfo("cold"); // Default fallback 102 | } 103 | setLoading(false); 104 | setShowResult(true); 105 | }; 106 | 107 | const getCurrentLocation = () => { 108 | setLoadingLocation(true); 109 | setLocationError(""); 110 | 111 | if (!navigator.geolocation) { 112 | setLocationError("Geolocation is not supported by your browser"); 113 | setLoadingLocation(false); 114 | return; 115 | } 116 | 117 | navigator.geolocation.getCurrentPosition( 118 | async (position) => { 119 | try { 120 | const response = await fetch( 121 | `https://nominatim.openstreetmap.org/reverse?format=json&lat=${position.coords.latitude}&lon=${position.coords.longitude}` 122 | ); 123 | const data = await response.json(); 124 | 125 | const address = data.display_name; 126 | setFormData((prev) => ({ 127 | ...prev, 128 | location: address, 129 | })); 130 | } catch (error) { 131 | setLocationError("Failed to get location details" + error); 132 | } 133 | setLoadingLocation(false); 134 | }, 135 | (error) => { 136 | setLocationError( 137 | error.code === 1 138 | ? "Please allow location access" 139 | : "Unable to get your location" 140 | ); 141 | setLoadingLocation(false); 142 | } 143 | ); 144 | }; 145 | 146 | const searchLocation = async (query: string) => { 147 | if (query.length < 3) { 148 | setSearchResults([]); 149 | return; 150 | } 151 | 152 | try { 153 | const response = await fetch( 154 | `https://nominatim.openstreetmap.org/search?format=json&q=${encodeURIComponent( 155 | query 156 | )}&limit=5` 157 | ); 158 | const data = await response.json(); 159 | setSearchResults(data); 160 | setShowSuggestions(true); 161 | } catch (error) { 162 | console.error("Search error:", error); 163 | } 164 | }; 165 | 166 | const calculateDistance = ( 167 | point1: Coordinates, 168 | point2: Coordinates 169 | ): number => { 170 | const R = 6371; // Earth's radius in km 171 | const dLat = ((point2.lat - point1.lat) * Math.PI) / 180; 172 | const dLon = ((point2.lon - point1.lon) * Math.PI) / 180; 173 | const a = 174 | Math.sin(dLat / 2) * Math.sin(dLat / 2) + 175 | Math.cos((point1.lat * Math.PI) / 180) * 176 | Math.cos((point2.lat * Math.PI) / 180) * 177 | Math.sin(dLon / 2) * 178 | Math.sin(dLon / 2); 179 | const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); 180 | return R * c; // Distance in km 181 | }; 182 | 183 | const findNearbyDoctors = async () => { 184 | setLoadingDoctors(true); 185 | try { 186 | const locationQuery = encodeURIComponent(formData.location); 187 | const geoResponse = await fetch( 188 | `https://nominatim.openstreetmap.org/search?format=json&q=${locationQuery}` 189 | ); 190 | const geoData = await geoResponse.json(); 191 | 192 | if (geoData.length > 0) { 193 | const userLocation = { 194 | lat: parseFloat(geoData[0].lat), 195 | lon: parseFloat(geoData[0].lon), 196 | }; 197 | 198 | // Try with small radius first 199 | let viewboxSize = 0.1; 200 | let data = []; 201 | 202 | // Keep expanding search radius until we find results or hit max radius 203 | while (data.length === 0 && viewboxSize <= 2) { 204 | const response = await fetch( 205 | `https://nominatim.openstreetmap.org/search?` + 206 | `format=json&` + 207 | // Modified search query to be more specific 208 | `q=ayurvedic&` + 209 | `viewbox=${userLocation.lon - viewboxSize},${ 210 | userLocation.lat - viewboxSize 211 | },${userLocation.lon + viewboxSize},${ 212 | userLocation.lat + viewboxSize 213 | }&` + 214 | `bounded=1&limit=50&` + // Increased limit 215 | `dedupe=1&` + // Remove duplicates 216 | `category=healthcare,medical` // Added category filter 217 | ); 218 | const responseData = await response.json(); 219 | data = Array.isArray(responseData) ? responseData : []; 220 | 221 | if (data.length === 0) { 222 | // Try alternative search if first attempt returns no results 223 | const altResponse = await fetch( 224 | `https://nominatim.openstreetmap.org/search?` + 225 | `format=json&` + 226 | `amenity=hospital,clinic,doctors,healthcare&` + 227 | `lat=${userLocation.lat}&` + 228 | `lon=${userLocation.lon}&` + 229 | `radius=${viewboxSize * 111000}&` + // Convert degrees to meters (roughly) 230 | `limit=50` 231 | ); 232 | const altData = await altResponse.json(); 233 | data = Array.isArray(altData) ? altData : []; 234 | } 235 | 236 | viewboxSize *= 2; 237 | } 238 | 239 | const nearbyDoctors = data 240 | .filter( 241 | (place: NominatimPlace) => 242 | place.display_name.toLowerCase().includes("hospital") || 243 | place.display_name.toLowerCase().includes("clinic") || 244 | place.display_name.toLowerCase().includes("medical") || 245 | place.display_name.toLowerCase().includes("health") || 246 | place.type === "hospital" || 247 | place.type === "clinic" 248 | ) 249 | .map((place: NominatimPlace) => { 250 | const distance = calculateDistance(userLocation, { 251 | lat: parseFloat(place.lat), 252 | lon: parseFloat(place.lon), 253 | }); 254 | return { 255 | name: place.display_name.split(",")[0], 256 | distance: Math.round(distance * 10) / 10, 257 | address: place.display_name, 258 | type: place.type || "Healthcare Facility", 259 | }; 260 | }) 261 | .sort((a: Doctor, b: Doctor) => a.distance - b.distance) 262 | .slice(0, 5); 263 | 264 | setDoctors(nearbyDoctors); 265 | setShowDoctors(true); 266 | } 267 | } catch (error) { 268 | console.error("Error finding doctors:", error); 269 | } 270 | setLoadingDoctors(false); 271 | }; 272 | 273 | const openInGoogleMaps = (address: string) => { 274 | // Encode the destination address for the URL 275 | const destination = encodeURIComponent(address); 276 | // Open Google Maps in a new tab with directions 277 | window.open( 278 | `https://www.google.com/maps/dir/?api=1&destination=${destination}`, 279 | "_blank" 280 | ); 281 | }; 282 | 283 | const randomMessages = [ 284 | 285 | After carefully analyzing your symptoms, our assessment indicates that you 286 | may be experiencing{" "} 287 | {diseaseInfo}. We 288 | recommend{" "} 289 | {medicineInfo}, a 290 | time-tested Ayurvedic remedy rooted in ancient formulations known for its 291 | natural healing properties. 292 | , 293 | 294 | Based on a detailed evaluation of your symptoms, it appears that you may 295 | have {diseaseInfo}.{" "} 296 | {medicineInfo} is a 297 | traditional Ayurvedic remedy, derived from ancient formulations, known for 298 | its effectiveness in promoting recovery. 299 | , 300 | 301 | Our thorough analysis of your symptoms suggests a likelihood of{" "} 302 | {diseaseInfo}. We 303 | recommend{" "} 304 | {medicineInfo}, an 305 | ancient Ayurvedic formulation trusted for centuries to support natural 306 | healing and balance. 307 | , 308 | 309 | Following a detailed analysis of your symptoms, the findings suggest{" "} 310 | {diseaseInfo}.{" "} 311 | {medicineInfo} is a 312 | classical Ayurvedic remedy, carefully preserved from ancient traditions to 313 | restore health and well-being. 314 | , 315 | 316 | Our evaluation points to{" "} 317 | {diseaseInfo} based on 318 | your symptoms. We suggest trying{" "} 319 | {medicineInfo}, a 320 | well-established Ayurvedic remedy from ancient texts, known for its 321 | targeted healing properties. 322 | , 323 | 324 | Based on a comprehensive analysis of your symptoms, you may be 325 | experiencing{" "} 326 | {diseaseInfo}.{" "} 327 | {medicineInfo} is a 328 | traditional Ayurvedic solution, derived from ancient wisdom, and valued 329 | for its natural effectiveness in restoring balance and health. 330 | , 331 | ]; 332 | 333 | return ( 334 |
335 | {/* Decorative Leaves - Left Side */} 336 |
337 |
338 | 339 |
340 |
341 | 342 |
343 |
344 | 345 | {/* Decorative Leaves - Right Side */} 346 |
347 |
348 | 349 |
350 |
351 | 352 |
353 |
354 | 355 |
356 | 357 | {/* Logo */} 358 |
359 | AyuVritt (window.location.href = "/")} 366 | className="cursor-pointer" 367 | /> 368 |
369 | 370 | {/* Form */} 371 |
372 |
373 |

374 | Tell Us About Yourself 375 |

376 | 377 |
378 |
379 | 385 | 390 | setFormData({ ...formData, name: e.target.value }) 391 | } 392 | className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent text-black" 393 | required 394 | /> 395 |
396 | 397 |
398 | 404 | 409 | setFormData({ ...formData, age: e.target.value }) 410 | } 411 | className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent text-black" 412 | required 413 | /> 414 |
415 | 416 |
417 | 423 |
424 |
425 |
426 | { 431 | setFormData({ 432 | ...formData, 433 | location: e.target.value, 434 | }); 435 | searchLocation(e.target.value); 436 | }} 437 | onFocus={() => { 438 | if (formData.location) { 439 | setShowSuggestions(true); 440 | } 441 | }} 442 | className="w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-transparent text-black" 443 | placeholder="Search for a location..." 444 | required 445 | autoComplete="off" 446 | /> 447 | {/* Dropdown Menu */} 448 | {showSuggestions && searchResults.length > 0 && ( 449 |
    450 | {searchResults.map((result) => ( 451 |
  • { 455 | setFormData({ 456 | ...formData, 457 | location: result.display_name, 458 | }); 459 | setShowSuggestions(false); 460 | }} 461 | > 462 | {result.display_name} 463 |
  • 464 | ))} 465 |
466 | )} 467 |
468 | {/* Current Location Button */} 469 | 522 |
523 |
524 | {locationError && ( 525 |

{locationError}

526 | )} 527 |
528 | 529 |
530 | 536 |