AWS Builder Center
Building MediTrack: A Cloud-Powered Healthcare Dashboard

Building MediTrack: A Cloud-Powered Healthcare Dashboard

Explore how I built MediTrack, a full-stack medication and health management application using React, Firebase, Amazon S3, and Amazon Bedrock, with Kiro as my AI development partner.


# Building MediTrack: A Cloud-Powered Medication & Health Dashboard
*How I built a full-stack healthcare application with React, Firebase, Amazon S3, and Amazon Bedrock — using Kiro as my AI development partner.*
---
## The Problem
Managing daily medications is harder than it sounds. Patients juggling multiple prescriptions often struggle with:
- **Remembering dose schedules** — "Did I take my morning pill or not?"
- **Tracking adherence** — No easy way to see if they're consistently taking medications on time
- **Monitoring vitals** — Blood pressure, blood sugar, and weight readings scattered across paper notes
- **Organizing medical documents** — Lab reports, prescriptions, and consultation notes buried in folders
- **Getting medication information** — Wanting quick answers about what their medicines do, without scheduling a doctor visit
I wanted to build something that solves all of these in one place — a professional, cloud-powered dashboard that feels like a real healthcare product.
## The Solution: MediTrack
MediTrack is a web application that combines five core features:
1. **Dashboard** — A daily medication schedule with real-time dose status tracking. Users can mark doses as Taken, Missed, or Skipped, with color-coded sections for Overdue, Due Now, Upcoming, and Completed doses.
2. **My Medicines** — A management interface where users add medications with dosage, form (tablet, capsule, syrup, etc.), color coding, scheduled dose times, and notes.
3. **Health Log** — Records for blood pressure (systolic/diastolic), blood sugar, and weight, with validation, history grouping by metric type, and optional notes for each reading.
4. **Weekly Summary** — Medication adherence analytics showing Taken, Missed, Skipped counts and an adherence rate percentage, with filters by medicine, status, and date.
5. **Health Trends** — Average calculations and trend direction (Up/Down/Stable) for each health metric, helping users visualize whether their vitals are improving over time.
Plus two AWS-powered features:
6. **Document Storage (Amazon S3)** — Users upload medical documents (lab reports, prescriptions, consultation notes) that are stored securely in a private S3 bucket. Each user's documents are isolated by their Firebase UID. Files are uploaded through the Express backend, stored server-side in S3, and downloaded via presigned URLs.
7. **AI Medication Assistant (Amazon Bedrock Nova Lite)** — A chat interface where users ask questions about their medications. The assistant uses Amazon Bedrock's Nova Lite model with a system prompt that includes the user's actual medication list as context. It provides general information about medication uses, common side effects, and general guidance — while clearly stating it is informational, not medical advice, and always encouraging users to consult healthcare professionals.
## Implementation
### Architecture
The application uses a three-tier architecture:
- **Frontend (React 19 + TypeScript + Vite)** — Deployed on Netlify as a static site
- **Backend (Node.js + Express)** — Deployed on Render, acts as an API proxy for AWS services
- **Firebase** — Handles authentication (email/password) and database (Firestore)
The frontend sends Firebase ID tokens with every API request. The backend verifies these tokens using Firebase Admin SDK, extracts the user's UID, and uses it to scope all data access. AWS credentials are never exposed to the frontend — they stay on the Express server.
### AWS Services
**Amazon S3** stores medical documents in a private bucket. Files are organized as `documents/{userId}/{docId}/{filename}`, ensuring complete per-user isolation. The upload flow reads files as base64 in the frontend, sends them to the Express backend, which decodes and uploads directly to S3 using the AWS SDK. Downloads use presigned URLs generated server-side with a 1-hour expiry.
**Amazon Bedrock** powers the AI Medication Assistant using the Nova Lite model (`apac.amazon.nova-lite-v1:0`) via the Converse API. The backend constructs a system prompt with the user's medication list and safety guidelines — the model never recommends dosage changes, stopping medication, or providing medical diagnoses. The inference profile routes requests across Asia Pacific regions for reliability.
### Data Security
- Firebase Firestore security rules ensure users can only read/write their own data (`users/{userId}/...`)
- S3 bucket is private — no public access
- AWS credentials are split: S3 uses the main account, Bedrock uses a separate IAM user with `AmazonBedrockFullAccess`
- Firebase ID tokens are verified on every backend request
- `.env` files are gitignored and never committed
### Kiro Usage
I built this entire application using **Kiro**, an AI-powered development environment. Kiro helped me:
- **Design the UI** — Complete frontend replacement from a basic mobile layout to a professional desktop dashboard with sidebar navigation, stat cards, and a cohesive teal-and-white healthcare design system
- **Integrate Firebase** — Set up Authentication, Firestore, and Admin SDK with proper ESM imports
- **Add AWS services** — S3 document storage with server-side uploads and Bedrock Nova Lite AI assistant
- **Debug complex issues** — Fixed Firebase Admin SDK ESM import errors, S3 CORS workarounds (switched from presigned URL browser uploads to server-side uploads), and Bedrock inference profile configuration across regions
- **Deploy** — Configured Netlify for the frontend and Render for the backend with environment variables
Kiro's ability to read and understand the entire codebase, make targeted changes, and verify builds made the development process significantly faster than traditional manual coding.
## Key Challenges & Solutions
1. **S3 CORS blocking browser uploads** — Initially used presigned URLs for direct browser-to-S3 uploads, but S3's CORS policy blocked cross-origin PUT requests. Solution: switched to server-side uploads where the file goes through Express → S3, avoiding CORS entirely.
2. **Firebase Admin SDK ESM imports** — The `firebase-admin` package's ESM export structure differs from CommonJS. `admin.credential.cert()` is undefined in ESM mode. Solution: use named imports `import { initializeApp, cert } from 'firebase-admin'` and `import { getAuth } from 'firebase-admin/auth'`.
3. **Bedrock model access and inference profiles** — Direct base model invocation returned "Operation not allowed" in `ap-southeast-2`. Solution: use the `apac.amazon.nova-lite-v1:0` inference profile which routes across Asia Pacific regions, with wildcard IAM policies to cover all routing targets.
4. **Firestore undefined values** — Firestore rejects `undefined` field values. Solution: added a `sanitize()` function that strips undefined keys from objects before writing.
## Tech Stack
| Layer | Technology |
|-------|-----------|
| Frontend | React 19, TypeScript, Vite |
| Styling | Custom CSS design system |
| Auth + Database | Firebase Authentication + Firestore |
| Backend | Node.js + Express |
| File Storage | Amazon S3 |
| AI | Amazon Bedrock (Nova Lite) |
| Frontend Hosting | Netlify |
| Backend Hosting | Render |
| AI Development | Kiro |
## Live Demo
The application is live at: https://meditrack-medicationdashboard.netlify.app
Users can create an account, add medications, track doses, log health readings, upload medical documents to S3, and chat with the AI assistant about their medications.
---
*Built as part of the AWS Builder program using Kiro AI development environment.*

Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article