Inspiration

We were inspired by a common problem that happens after visiting a doctor. Patients often receive handwritten prescriptions, but sometimes the writing is difficult to read or understand. This can cause confusion about the medicine name, dosage, and how often it should be taken. Because prescription mistakes can affect patient safety, we wanted to create a solution that makes prescriptions easier to understand.

What it does

ResafeDoc allows users to upload or scan a photo of a doctor’s prescription. The image is processed by AI to extract the handwritten text and convert it into structured information. The result is then matched with medicine data to help validate the medicine name, dosage, and usage instructions.

The system also gives a confidence level. When the writing is unclear or the result cannot be validated, ResafeDoc will warn the user instead of giving an uncertain answer. The AI is only used to assist the reading process, not to replace doctors or pharmacists

How we built it

  1. Project Planning: We defined the project's end goals and scope.
  2. Frontend Development: Used Next.js for content rendering, leveraging its support for both SSR (Server-Side Rendering) and CSR (Client-Side Rendering).
  3. Styling: Chose Tailwind CSS for styling the application and Shadcn library

Challenges we ran into

  • Faced frontend configuration problems, especially in the package.json file.
  • Some dependencies were not compatible and caused errors during development.
  • Google Gemini sometimes responded slowly or experienced a timeout.
  • Worked under tight time constraints and had to focus on the most important features.
  • Had to make several strategic sacrifices to finish the main product flow.
  • Making the website responsive across different screen sizes was challenging.
  • Encountered Git problems such as merge conflicts, branch differences, and push errors.
  • Handwritten prescriptions were difficult to process because every doctor has a different writing style.
  • Blurry, dark, tilted, or incomplete images affected the AI results.
  • Had to make sure users would not blindly trust uncertain AI output.

Accomplishments that we're proud of

  • Improved teamwork while handling frontend, AI, design, and Git issues.
  • Turned a real patient-safety problem into a working digital solution.
  • Successfully integrated Google Gemini with the web application.
  • Converted prescription images into structured and readable information.
  • Applied a safety-first approach by not making AI the final decision-maker.

What we learned

Through this project, we learned that building a healthcare application is not only about making the technology work. The information must also be presented carefully because incorrect results can affect real users.

We learned how to integrate generative AI into a web application, process image input, create structured JSON output, and match the extracted information with medicine data.

We also improved our skills in frontend development, responsive design, debugging, Git collaboration, API integration, and project management.

Most importantly, we learned that AI should not always be treated as the final decision-maker. In a safety-related system, AI results need additional validation, confidence checking, and clear warnings.

What's next for ResafeDoc

  • Improve handwritten prescription recognition accuracy.
  • Test the system using more prescription samples and different handwriting styles.
  • Add image preprocessing to improve blurry, dark, or tilted images.
  • Expand the medicine database with more complete information.
  • Integrate trusted medicine data from official health or government sources.
  • Add medicine dosage and usage validation.
  • Add detection for possible drug interactions.

Built With

Share this project:

Updates