Skip to content
Meditrack

Meditrack

Own your health story

Created on 5th December 2025

•

Meditrack

Meditrack

Own your health story

The problem Meditrack solves

First time builder
AWS Builder id- [email protected]

MediTrack is a digital platform designed to store a patient’s entire lifetime medical history in one secure and accessible place. The goal is to ensure patients have full ownership and control over their health data.

Key Features and Functionality:

Digital Lifetime Medical Record: Records and stores all prescriptions, reports, doctor visits, and treatments permanently.

Easy Upload of Past History: Patients can scan or upload images of handwritten prescriptions and old reports.

AI-Based Medical Summary: Automatically summarizes old records for doctors to understand cases quickly.

Challenges we ran into

The most significant and time-consuming hurdle encountered while setting up the MediTrack project was dealing with the AWS S3 Cross-Origin Resource Sharing (CORS) Policy and initially, a related Browser Stream Incompatibility error during file uploads.`
Error Message: TypeError: readableStream.getReader is not a function

Cause: This occurred because the AWS SDK v3 (used in the browser) struggled to interpret the browser's native File object (which you were passing as the request body) as a readable stream needed for operations like flexible checksums or chunked encoding.
Error Message: Access to fetch at 'https://medical-records-storage-bucket.s3.us-west-2.amazonaws.com/...' from origin 'http://localhost:8090' has been blocked by CORS policy.

Cause: This is a fundamental web security feature. The browser blocked the upload because the S3 bucket's Permissions were not configured to explicitly allow requests (the "preflight" check) originating from your local development domain (http://localhost:8090). AWS S3 buckets are configured to deny cross-origin requests by default.
We get over it by :-

  1. Fixing the Stream Incompatibility (Code-Level Fix)
    The issue was resolved by changing how the file data was prepared before being sent to the AWS SDK:

Solution: We modified the aws-s3.service.ts function to convert the input File object into a raw binary format, specifically an ArrayBuffer, before sending it.

Code Change: Instead of passing the raw file object to the PutObjectCommand, we used: const fileBuffer = await file.arrayBuffer(); and passed new Uint8Array(fileBuffer) as the request body. This bypasses the stream compatibility issue entirely, as the SDK handles raw binary data reliably in the browser.

  1. Fixing the CORS Block (Infrastructure-Level Fix)
    This required accessing the AWS Console and was the non-code hurdle that took the most time to diagnose and resolve:

Solution: The CORS configuration was updated directly in the AWS S3 Management Console.

Action Taken: We navigated to the S3 Bucket's Permissions tab and added a JSON configuration block to the Cross-origin resource sharing (CORS) settings. This configuration explicitly whitelists the local development environment.
3. The Temporary Workaround (The Mock Service)
When initial AWS errors occurred, we temporarily created a Mock Storage Service that simulated a successful upload by generating a local blob: URL. This allowed the team to immediately proceed with building and testing the downstream features (QR code generation, Doctor Scanning, and the Review Interface) without being blocked by AWS credential or configuration issues.

Tracks Applied (1)

Best AWS Hack

Amazon Web Services

Discussion

Builders also viewed

See more projects on Devfolio