Inspiration

Navigating over-the-counter (OTC) medicines is a risky game for many individuals with chronic health issues.

  • Millions of Canadians suffer from chronic diseases like diabetes, asthma, and hypertension.
  • Yet, no personalized system currently advises them whether a medicine is safe based on their unique health profile.
  • We wanted to create a digital twin — a system that understands YOU and advises on medicine safety, preventing harmful side effects or interactions.

MediTwin was bornYour AI-powered medicine advisor.


What it does

  • Collects personalized health profiles: Chronic conditions, allergies, current medications.
  • Analyzes medicines: You simply type a drug name, and MediTwin checks whether it's safe for YOU.
  • Fetches official drug data from OpenFDA API (real warnings, side effects, interactions).
  • Generates AI-powered explanations using Google Gemini APIin plain, understandable language.
  • Provides personalized recommendations (warnings, suggestions, potential risks).
  • Gives patients the power of AI-driven personalized health insights before taking any medicine.

How we built it

Frontend (Next.js + React):

  • User-friendly forms for health profile input.
  • Medicine check interface with real-time interaction.
  • LocalStorage used for session persistence.

Backend (Python + Flask):

  • REST APIs to handle user profiles and medicine analysis.
  • Connected to OpenFDA API to fetch real medicine data.
  • Integrated with Gemini AI API for natural language, user-specific explanations.

AI + APIs:

  • Gemini API: Personalized explanation generation.
  • OpenFDA API: Official FDA drug data like warnings, interactions.
  • CORS-enabled Flask backend to bridge frontend and AI.

Challenges we ran into

  • ⚙️ Integrating OpenFDA API dynamically — different medicines have different data representations.
  • ⚙️ Gemini AI prompt engineering to generate simple but accurate medical explanations.
  • ⚙️ CORS issues when connecting frontend (Next.js) and backend (Flask) — resolved with Flask-CORS.
  • ⚙️ Handling user-specific context in AI responses to make it feel personalized.
  • ⚙️ Data flow & persistence — managing user profiles temporarily without a database (for hackathon speed).

Accomplishments that we're proud of

  • ✅ Built a fully functional AI-powered medical twin in just 36 hours.
  • ✅ Successfully integrated two major APIs (OpenFDA and Gemini).
  • ✅ Generated personalized, user-specific medicine safety reports.
  • ✅ Designed a clean and interactive frontend interface for users.
  • ✅ Enabled real-time medicine analysis based on user health profilesnever seen before in an OTC analysis app.

What we learned

  • 🌐 How to build end-to-end AI-powered apps (frontend + backend + AI APIs).
  • 🔑 Importance of accurate data sourcing (FDA's official database).
  • 🧠 Prompt engineering for better AI outputs and safer health explanations.
  • 💬 How to make AI explanations human-like and understandable.
  • 🔗 How to connect multiple technologies smoothly: Next.js, Flask, Gemini, OpenFDA.

What's next for MediTwin

  1. 🚀 Add Real-time Databases (e.g., Firebase, MongoDB) for persistent user profiles.
  2. 🤖 Integrate wearable health data (e.g., Fitbit, Apple Health) for even more personalized insights.
  3. 💊 Suggest safer alternative medications or home remedies using AI.
  4. 🧑‍⚕️ Create a Doctor's portal where physicians can validate recommendations.
  5. 📱 Launch as a mobile-first app for instant access on-the-go.
  6. 🇨🇦 Partner with Canadian healthcare systems & pharmacies to make OTC medicine safer for everyone.

Built With

Share this project:

Updates