Inspiration

Witnessing a family member's chronic illness showed us how hard it is to plan multiple medications. Each one has its own rules: some need an empty stomach, some need food, some can't be taken near others. We wanted to build an app that takes that burden off the patient so they can focus on healing.

What it does

MedFlow builds a daily medication schedule from your medications, doses per day, and your routine (wake-up, meals, bedtime).

  • Follows each drug's rules: empty stomach before breakfast, with food, minimum gaps between doses, and spacing between medications that interact.
  • Explains every time: each dose shows why it sits where it does.
  • Explains restrictions in plain words: powered by the Gemini API, one tap turns a medication's rules into a short, easy-to-read explanation.
  • Lets you make changes safely: click a dose and change its time. If the change breaks a rule, MedFlow refuses it and tells you exactly why, for example "Calcium Carbonate must be taken with a meal."
  • Reminds you: notifications shortly before a dose is due, with the relevant warnings, such as "avoid coffee".

How we built it

  • Frontend: React, TypeScript, Vite and Tailwind CSS. It has a sign-up and profile flow, a medication form, and a day timeline with dose cards, a details drawer, and in-app reminders.
  • Backend: Python and FastAPI. Medication rules live in a JSON database, with rule types such as before-meal, with-meal, minimum interval, and separation between medications.
  • Scheduler: it generates candidate times through the day, keeps only the ones valid for each medication, and uses backtracking to fit all doses together.
  • Edit validation: when a user moves a dose, the backend re-checks the entire schedule against every rule and returns plain-language reasons if it fails.
  • Gemini API: the backend sends the medication's rules to Gemini and asks it to explain them in simple language. It only restates the rules our own engine produced and never decides doses or times, and the key stays on the server.
  • We split the work, with one of us on the frontend and one on the backend, and agreed on the API contract early.

Challenges we ran into

  • Rules that interact. A change that is fine for one medication can break another, so every edit has to be checked against the whole schedule, not just the dose that moved.
  • Making refusals understandable. Early on, the backend only said a change was invalid. We rewrote it to explain which rule failed and by how many minutes.
  • Keeping the frontend and backend in sync. Details like medication IDs versus names, and how doses are numbered, caused bugs until we aligned on the data format.
  • Time. It was our first hackathon and first full-stack project, so we had to prioritize a working end-to-end flow before extras.

Accomplishments that we're proud of

It being our first hackathon and full-stack project, we are very proud to have created a finished product and turned our idea into something tangible.

What we learned

We learned the importance of splitting tasks clearly between team members while keeping continued communication. It helped us take autonomy over our own parts while collaborating effectively as a team toward a shared goal.

What's next for MedFlow

Advanced flexibility features for schedule creation, more medications and interaction rules, real accounts, and increased accessibility.

MedFlow is a hackathon project and is not medical advice. Always follow your prescription and ask your pharmacist or prescriber.

Built With

Share this project:

Updates

Submission history