Inspiration

In the real world, people often struggle with two major healthcare issues:

  1. Getting a proper diet plan tailored to their body, lifestyle, and medical conditions.
  2. Understanding medical reports, scans, or visible symptoms without needing immediate access to a specialist.

MedHack was inspired to solve these two everyday struggles using AI-driven personalization and medical insight, while still keeping things simple and accessible.


What it does

MedHack consists of two main AI Agents:

1. Med Scan Agent

• Users upload medical images like X-rays, skin rashes, blood reports, or prescriptions.
• The AI analyzes the uploaded content and provides:

  • Interpretation of the scan/report
  • Possible cause or condition
  • Risk level and suggestions for next steps • This does NOT replace professional diagnosis, but it provides accessible preliminary insight.

2. Diet Planner Agent

• Users enter details such as age, weight, dietary preferences, routines, and budget. • The AI asks clarifying questions to refine accuracy. • A personalized 7-day diet plan is generated. • Users can chat with the agent to modify the plan (e.g., reduce carbs, add cheat meal, etc.) • The final plan can be downloaded as a PDF or emailed directly to the user.


How we built it

• Frontend: React + Tailwind
• Backend: Node.js + Express
• AI Engine: OpenAI + Custom Prompt Orchestration
• File Handling and Image Analysis: Cloud Storage + Vision Model APIs
• Authentication and Role Management: Auth0
• Email Delivery: Resend / Nodemailer
• PDF Generation: jsPDF

We implemented Auth0 Agent Authentication:

  • Free tier users can only generate a basic diet plan.
  • Pro tier users unlock email export, PDF download, Med Scan high-accuracy mode.
  • Roles and permissions are enforced server-side using Auth0 Actions + Token Claims.

Example: Verifying user role on backend

import jwt from "jsonwebtoken";

function verifyRole(req, res, next) {
  const token = req.headers.authorization?.split(" ")[1];
  const decoded = jwt.decode(token);

  if (decoded.permissions.includes("premium_access")) {
    next();
  } else {
    return res.status(403).json({ error: "Upgrade required to access this feature." });
  }
}

Challenges we ran into

• Ensuring medical interpretation is safe and non-misleading • Balancing personalization and simplicity in the diet planner chat flow • Handling large medical image uploads efficiently • Integrating Auth0 roles + permissions cleanly with backend access control • Generating professional-looking diet plan PDFs dynamically

Accomplishments that we're proud of

• Built a dual-agent healthcare assistant that works smoothly end-to-end • Successfully implemented role-based access control using Auth0 • Designed a conversational refinement system for diet parameters • Created a clean UI/UX that makes a complex task feel simple

What we learned

• How to structure multi-step agent prompting for personalization • How to enforce secure, scalable access control with Auth0 roles and action triggers • Better understanding of medical image preprocessing and classification confidence handling • Importance of UI clarity when communicating medical suggestions

What's next for MedHack

• Integrating doctor teleconsultation handoff • Adding multilingual voice-based interaction • Improving diagnostic confidence scoring with ensemble medical models • Mobile app release

Built With

Share this project:

Updates