← nawaz.ca ▶ Watch the build on YouTube

nawaz.builds — MedTrak Pro

Professional Build Package

Stitch · Supabase · Claude Code · GitHub · Vercel · PWA

1 · Stitch Prompts
2 · Database (mt_)
3 · Claude Code Brief
4 · Workflow Order
5 · Intro + Outro
💡 Stitch generates 5 screens per run. Run these 3 prompts separately at stitch.withgoogle.com. Use Experimental Mode (Gemini 2.5 Pro) for all three. After all screens are done, export DESIGN.md — drop it in your repo root before starting Claude Code.

Batch 1 — Auth + Onboarding (5 screens)

Sign InSign UpSetup ChoiceCreate GroupJoin Group
Stitch Prompt — Batch 1
Design a mobile app UI for MedTrak, a family medication tracker. Generate 5 interconnected auth and onboarding screens. DESIGN SYSTEM: Warm white background #f8f7f4. Card background #ffffff. Primary navy #0f2d56. Text #111111. Success green #16a34a. Warning amber #d97706. Alert red #dc2626. Card border radius 12px. Button border radius 8px. Minimum 56px touch targets. Minimum 16px font size everywhere. Sans-serif typography — clean and readable. Not clinical. Trustworthy and warm. SCREEN 1 — Sign In Centered card layout on warm white background. MedTrak wordmark at top with a small navy pill icon. Email input field and password field with floating labels. Large full-width navy "Sign In" button. "Don't have an account? Sign Up" text link below. "Forgot password?" link in small text. No clutter. SCREEN 2 — Sign Up Same centered card. Fields: Full name, Email, Password, Confirm Password. Full-width navy "Create Account" button. "Already have an account? Sign In" link below. Clean single-column layout. SCREEN 3 — Onboarding: Setup Choice Post-signup landing. Headline: "Set up your family" in large text. Subtitle: "Choose how you want to get started." Two large tappable cards stacked vertically. Card 1 (filled navy): icon, "Start a family group", subtitle "You'll manage medications and share an invite code." Card 2 (outlined): icon, "Join a family group", subtitle "Enter an invite code from your caretaker." Friendly and approachable. SCREEN 4 — Create Family Group Single input field with label "Family group name" and placeholder "e.g. The Khan Family". Below: generated invite code displayed in a large bold monospace-style box — 6 uppercase characters — with a copy icon. Small note: "Share this code with family members." Large navy "Create Group" button at bottom. SCREEN 5 — Join Family Group Prominent invite code entry: large spaced character input field. Below: role selection — two full-width selectable cards side by side or stacked. Card 1: Patient icon, "Patient", subtitle "I take medications". Card 2: Caretaker icon, "Caretaker", subtitle "I manage medications for others." Selected state shows navy border and light navy fill. Large "Join Family" button at bottom.

Batch 2 — Patient Screens (5 screens)

Today (default)Today (confirmed)Dose detailHistoryNotification prompt
Stitch Prompt — Batch 2
Design 5 mobile app screens for the MedTrak patient interface. Same design system as Batch 1: warm white background #f8f7f4, navy primary #0f2d56, green #16a34a, amber #d97706, red #dc2626. Bottom navigation on all screens except the detail drawer. Minimum 56px touch targets. Minimum 16px font. Clean and accessible for all ages. SCREEN 1 — Patient: Today (Default State) Bottom navigation bar with 3 tabs: Today (active, navy), History, Settings. Header area: "Good morning, [Name]" in medium text, today's date below. Progress bar: thin horizontal bar with "2 of 5 doses taken today" label. Medications grouped by time sections: Morning, Afternoon, Evening. Each section has a label header. Each medication row is a card: left side shows pill/capsule icon, medication name in bold 16px+, dosage and form below in smaller text. Right side: large navy confirm button ("Take" or "Confirm") — minimum 56px tall, clear and tappable. Show 4 medications across 2 time sections. SCREEN 2 — Patient: Today (Confirmed States) Same layout as Screen 1 but showing multiple confirmation states. Confirmed medication: green checkmark icon replaces the button, "Taken 8:32 AM" in green text below the medication name. One medication pending (amber dot indicator, navy button still visible). One missed (past time, red indicator, "Missed" label). One upcoming (greyed out, future time). Shows the full range of real states a patient would see. SCREEN 3 — Medication Detail Bottom Sheet Bottom drawer sliding up from bottom (60% screen height visible). Handle bar at top. Medication name in large bold text. Details section: form type, dosage amount and unit, scheduled times with clock icon. "Last taken: Yesterday 8:15 AM" in small text. Note input field: "Add a note (optional)" with text area. Two buttons at bottom: "Confirm Taken" (navy, full width) and "Close" (ghost button). Background slightly dimmed. SCREEN 4 — Patient: History Bottom navigation visible, History tab active. Month/year header with left/right arrows to navigate months. Calendar grid: full month view with each date showing a small colored dot. Green dot: all doses taken. Amber dot: partial. Red dot: missed. Grey dot: no medications that day. Empty: future dates. Below calendar: selected date's log list — each medication with status chip (Taken / Missed / Skipped) and time. SCREEN 5 — Push Notification Permission Centered card on warm white background. Large navy circle icon with bell at top. Headline: "Never miss a dose" in large text. Body: "Allow MedTrak to send you reminders when it's time to take your medications." Two buttons stacked: "Allow Notifications" (navy, full width), "Maybe Later" (ghost text button). Simple, friendly, no pressure design.

Batch 3 — Caretaker Screens (5 screens)

DashboardPatient detailManage medsAdd medicationInventory
Stitch Prompt — Batch 3
Design 5 mobile app screens for the MedTrak caretaker interface. Same design system: warm white background #f8f7f4, navy primary #0f2d56, green #16a34a, amber #d97706, red #dc2626. Bottom navigation on all main screens. Professional, clean, accessible. SCREEN 1 — Caretaker Dashboard Bottom navigation: Overview (active), Patients, Inventory, Settings. If low stock: red alert banner at very top "2 medications running low — tap to review" with chevron. Main content: "Today's Overview" section header. Patient summary cards — one per patient. Each card: patient name in bold, colored avatar circle with initials, today's date, dose progress "3 of 5 taken" with thin progress bar, status chip on the right: "On Track" in green, "Attention" in amber, or "Missed" in red. Tap entire card to view that patient. Show 2-3 patient cards. At bottom: "Last updated just now" in small grey text. SCREEN 2 — Patient Detail (Caretaker View) Header: back arrow, patient name, small "Viewing as caretaker" label. Same grouped-by-time medication layout as patient today screen. But each confirm button says "Confirm for [Name]" instead. Each medication has a small note icon — tap to add a note on behalf of the patient. Confirmed items show green state with "Confirmed by you at 9:14 AM" in small text. Missed items show red indicator. Feels like the patient view but with caretaker authority indicated clearly. SCREEN 3 — Manage Medications Header: "Medications". Patient selector at top — horizontal scrollable chips showing each patient name (one selected/highlighted). Below: list of that patient's medications. Each row is a card: medication name bold, dosage and schedule summary in smaller text (e.g. "10mg tablet — Morning, Evening"), active/inactive toggle on the right. Tap to edit. Floating navy + button bottom right to add new medication. Empty state: illustration + "No medications added yet" + "Add First Medication" button. SCREEN 4 — Add/Edit Medication Form Header: "Add Medication" with back arrow. Single column scroll form. Fields in order: Text input "Medication name". Form type — horizontal scrollable chip selector: Tablet, Capsule, Syrup, Injection, Drops, Patch, Other (one selected at a time, navy fill when selected). Two fields side by side: numeric input "Amount" and dropdown/chip "Unit" (mg, g, ml, mcg, units). Schedule section: toggle rows for Morning, Afternoon, Evening, Night — each with time picker inline when toggled on. Quantity input per schedule row. Frequency chips: Daily, Alternate Days, Weekly. Save button full width at bottom — navy. SCREEN 5 — Inventory Management Header: "Inventory". Summary row at top if alerts: red row "2 items below threshold" with warning icon. Medication list sorted by urgency. Each row: medication name, patient name below in small text, stock level displayed as "14 days remaining" with a horizontal progress bar — green when above threshold, amber when approaching, red when below. Tap row: expands inline to show current quantity field (numeric text input) and "Low stock alert at" field (text input showing number of days). Update button inline. No dropdown anywhere — all text inputs.
After Stitch — Critical Step
1
Export DESIGN.md from StitchAfter all 3 batches are done, look for the DESIGN.md export option. This file contains your full design system — colors, fonts, spacing, radii. Claude Code reads it automatically.
2
Export screen images or HTML from StitchExport each screen as PNG or HTML. These become reference files you pass to Claude Code when building each component.
3
Drop DESIGN.md into the repo rootBefore you give Claude Code any design instruction, the DESIGN.md needs to be in the project. It auto-applies your tokens to every component.
📌 Run this in Supabase SQL Editor after dropping all existing tables. This is the complete production schema — RLS policies, indexes, triggers, and helper functions included.
Complete mt_ Schema — Production Grade
-- ============================================ -- MedTrak Production Schema -- Prefix: mt_ -- ============================================ -- Extensions CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; -- ============================================ -- TABLES -- ============================================ CREATE TABLE mt_family_groups ( id UUID DEFAULT uuid_generate_v4() PRIMARY KEY, name TEXT NOT NULL, invite_code TEXT UNIQUE NOT NULL DEFAULT upper(substr(md5(random()::text), 1, 6)), created_at TIMESTAMPTZ DEFAULT NOW(), updated_at TIMESTAMPTZ DEFAULT NOW() ); CREATE TABLE mt_members ( id UUID DEFAULT uuid_generate_v4() PRIMARY KEY, user_id UUID REFERENCES auth.users(id) ON DELETE CASCADE, family_group_id UUID REFERENCES mt_family_groups(id) ON DELETE CASCADE, role TEXT NOT NULL CHECK (role IN ('patient', 'caretaker')), display_name TEXT NOT NULL, created_at TIMESTAMPTZ DEFAULT NOW(), updated_at TIMESTAMPTZ DEFAULT NOW(), UNIQUE(user_id, family_group_id) ); CREATE TABLE mt_medications ( id UUID DEFAULT uuid_generate_v4() PRIMARY KEY, patient_id UUID REFERENCES mt_members(id) ON DELETE CASCADE NOT NULL, family_group_id UUID REFERENCES mt_family_groups(id) ON DELETE CASCADE NOT NULL, name TEXT NOT NULL, form TEXT NOT NULL CHECK (form IN ('tablet','capsule','syrup','injection','drops','patch','other')), dosage_amount DECIMAL NOT NULL, dosage_unit TEXT NOT NULL CHECK (dosage_unit IN ('mg','g','ml','mcg','units','IU')), notes TEXT, is_active BOOLEAN DEFAULT TRUE, created_at TIMESTAMPTZ DEFAULT NOW(), updated_at TIMESTAMPTZ DEFAULT NOW() ); CREATE TABLE mt_schedules ( id UUID DEFAULT uuid_generate_v4() PRIMARY KEY, medication_id UUID REFERENCES mt_medications(id) ON DELETE CASCADE NOT NULL, time_label TEXT NOT NULL CHECK (time_label IN ('morning','afternoon','evening','night','custom')), scheduled_time TIME NOT NULL, quantity DECIMAL NOT NULL DEFAULT 1, frequency TEXT NOT NULL DEFAULT 'daily' CHECK (frequency IN ('daily','alternate_days','weekly','specific_days')), specific_days INTEGER[], is_active BOOLEAN DEFAULT TRUE, created_at TIMESTAMPTZ DEFAULT NOW() ); CREATE TABLE mt_inventory ( id UUID DEFAULT uuid_generate_v4() PRIMARY KEY, medication_id UUID REFERENCES mt_medications(id) ON DELETE CASCADE NOT NULL UNIQUE, quantity_remaining DECIMAL NOT NULL DEFAULT 0, unit TEXT NOT NULL DEFAULT 'units', low_stock_threshold_days INTEGER NOT NULL DEFAULT 10, last_restocked_at TIMESTAMPTZ, created_at TIMESTAMPTZ DEFAULT NOW(), updated_at TIMESTAMPTZ DEFAULT NOW() ); CREATE TABLE mt_logs ( id UUID DEFAULT uuid_generate_v4() PRIMARY KEY, schedule_id UUID REFERENCES mt_schedules(id) ON DELETE CASCADE NOT NULL, patient_id UUID REFERENCES mt_members(id) ON DELETE CASCADE NOT NULL, confirmed_by_id UUID REFERENCES mt_members(id), log_date DATE NOT NULL DEFAULT CURRENT_DATE, status TEXT NOT NULL DEFAULT 'pending' CHECK (status IN ('pending','taken','missed','skipped')), taken_at TIMESTAMPTZ, quantity_taken DECIMAL, notes TEXT, created_at TIMESTAMPTZ DEFAULT NOW(), updated_at TIMESTAMPTZ DEFAULT NOW(), UNIQUE(schedule_id, log_date) ); CREATE TABLE mt_notification_prefs ( id UUID DEFAULT uuid_generate_v4() PRIMARY KEY, member_id UUID REFERENCES mt_members(id) ON DELETE CASCADE NOT NULL UNIQUE, push_enabled BOOLEAN DEFAULT FALSE, push_endpoint TEXT, push_p256dh TEXT, push_auth TEXT, reminder_minutes INTEGER DEFAULT 0, missed_dose_alerts BOOLEAN DEFAULT TRUE, low_stock_alerts BOOLEAN DEFAULT TRUE, created_at TIMESTAMPTZ DEFAULT NOW(), updated_at TIMESTAMPTZ DEFAULT NOW() ); -- ============================================ -- UPDATED_AT TRIGGERS -- ============================================ CREATE OR REPLACE FUNCTION mt_set_updated_at() RETURNS TRIGGER AS $$ BEGIN NEW.updated_at = NOW(); RETURN NEW; END; $$ LANGUAGE plpgsql; CREATE TRIGGER mt_family_groups_updated_at BEFORE UPDATE ON mt_family_groups FOR EACH ROW EXECUTE FUNCTION mt_set_updated_at(); CREATE TRIGGER mt_members_updated_at BEFORE UPDATE ON mt_members FOR EACH ROW EXECUTE FUNCTION mt_set_updated_at(); CREATE TRIGGER mt_medications_updated_at BEFORE UPDATE ON mt_medications FOR EACH ROW EXECUTE FUNCTION mt_set_updated_at(); CREATE TRIGGER mt_inventory_updated_at BEFORE UPDATE ON mt_inventory FOR EACH ROW EXECUTE FUNCTION mt_set_updated_at(); CREATE TRIGGER mt_logs_updated_at BEFORE UPDATE ON mt_logs FOR EACH ROW EXECUTE FUNCTION mt_set_updated_at(); CREATE TRIGGER mt_notification_prefs_updated_at BEFORE UPDATE ON mt_notification_prefs FOR EACH ROW EXECUTE FUNCTION mt_set_updated_at(); -- ============================================ -- PERFORMANCE INDEXES -- ============================================ CREATE INDEX idx_mt_members_user_id ON mt_members(user_id); CREATE INDEX idx_mt_members_family_group_id ON mt_members(family_group_id); CREATE INDEX idx_mt_medications_patient_id ON mt_medications(patient_id); CREATE INDEX idx_mt_medications_family_group_id ON mt_medications(family_group_id); CREATE INDEX idx_mt_medications_is_active ON mt_medications(is_active); CREATE INDEX idx_mt_schedules_medication_id ON mt_schedules(medication_id); CREATE INDEX idx_mt_schedules_is_active ON mt_schedules(is_active); CREATE INDEX idx_mt_inventory_medication_id ON mt_inventory(medication_id); CREATE INDEX idx_mt_logs_schedule_id ON mt_logs(schedule_id); CREATE INDEX idx_mt_logs_patient_id ON mt_logs(patient_id); CREATE INDEX idx_mt_logs_log_date ON mt_logs(log_date); CREATE INDEX idx_mt_logs_status ON mt_logs(status); -- ============================================ -- HELPER FUNCTIONS (for RLS) -- ============================================ CREATE OR REPLACE FUNCTION mt_my_family_groups() RETURNS SETOF UUID AS $$ SELECT family_group_id FROM mt_members WHERE user_id = auth.uid(); $$ LANGUAGE sql SECURITY DEFINER STABLE; CREATE OR REPLACE FUNCTION mt_is_caretaker_in(group_id UUID) RETURNS BOOLEAN AS $$ SELECT EXISTS ( SELECT 1 FROM mt_members WHERE user_id = auth.uid() AND family_group_id = group_id AND role = 'caretaker' ); $$ LANGUAGE sql SECURITY DEFINER STABLE; CREATE OR REPLACE FUNCTION mt_my_member_id(group_id UUID) RETURNS UUID AS $$ SELECT id FROM mt_members WHERE user_id = auth.uid() AND family_group_id = group_id LIMIT 1; $$ LANGUAGE sql SECURITY DEFINER STABLE; -- ============================================ -- ROW LEVEL SECURITY -- ============================================ ALTER TABLE mt_family_groups ENABLE ROW LEVEL SECURITY; ALTER TABLE mt_members ENABLE ROW LEVEL SECURITY; ALTER TABLE mt_medications ENABLE ROW LEVEL SECURITY; ALTER TABLE mt_schedules ENABLE ROW LEVEL SECURITY; ALTER TABLE mt_inventory ENABLE ROW LEVEL SECURITY; ALTER TABLE mt_logs ENABLE ROW LEVEL SECURITY; ALTER TABLE mt_notification_prefs ENABLE ROW LEVEL SECURITY; -- mt_family_groups policies CREATE POLICY "View own family groups" ON mt_family_groups FOR SELECT USING (id IN (SELECT mt_my_family_groups())); CREATE POLICY "Any auth user can create a group" ON mt_family_groups FOR INSERT WITH CHECK (auth.uid() IS NOT NULL); CREATE POLICY "Caretakers can update group" ON mt_family_groups FOR UPDATE USING (mt_is_caretaker_in(id)); -- mt_members policies CREATE POLICY "View members in same family" ON mt_members FOR SELECT USING (family_group_id IN (SELECT mt_my_family_groups())); CREATE POLICY "Users insert themselves" ON mt_members FOR INSERT WITH CHECK (user_id = auth.uid()); CREATE POLICY "Users update their own record" ON mt_members FOR UPDATE USING (user_id = auth.uid()); -- mt_medications policies CREATE POLICY "Family members view medications" ON mt_medications FOR SELECT USING (family_group_id IN (SELECT mt_my_family_groups())); CREATE POLICY "Caretakers manage medications" ON mt_medications FOR ALL USING (mt_is_caretaker_in(family_group_id)); -- mt_schedules policies CREATE POLICY "Family members view schedules" ON mt_schedules FOR SELECT USING ( medication_id IN ( SELECT id FROM mt_medications WHERE family_group_id IN (SELECT mt_my_family_groups()) ) ); CREATE POLICY "Caretakers manage schedules" ON mt_schedules FOR ALL USING ( medication_id IN ( SELECT id FROM mt_medications WHERE mt_is_caretaker_in(family_group_id) ) ); -- mt_inventory policies CREATE POLICY "Family members view inventory" ON mt_inventory FOR SELECT USING ( medication_id IN ( SELECT id FROM mt_medications WHERE family_group_id IN (SELECT mt_my_family_groups()) ) ); CREATE POLICY "Caretakers manage inventory" ON mt_inventory FOR ALL USING ( medication_id IN ( SELECT id FROM mt_medications WHERE mt_is_caretaker_in(family_group_id) ) ); -- mt_logs policies CREATE POLICY "Family members view logs" ON mt_logs FOR SELECT USING ( patient_id IN ( SELECT id FROM mt_members WHERE family_group_id IN (SELECT mt_my_family_groups()) ) ); CREATE POLICY "Patients log own doses" ON mt_logs FOR INSERT WITH CHECK ( patient_id IN (SELECT id FROM mt_members WHERE user_id = auth.uid()) ); CREATE POLICY "Caretakers log for patients" ON mt_logs FOR INSERT WITH CHECK ( patient_id IN ( SELECT m.id FROM mt_members m WHERE m.family_group_id IN ( SELECT family_group_id FROM mt_members WHERE user_id = auth.uid() AND role = 'caretaker' ) ) ); CREATE POLICY "Update own logs" ON mt_logs FOR UPDATE USING ( patient_id IN (SELECT id FROM mt_members WHERE user_id = auth.uid()) OR confirmed_by_id IN (SELECT id FROM mt_members WHERE user_id = auth.uid()) ); -- mt_notification_prefs policies CREATE POLICY "Manage own notification prefs" ON mt_notification_prefs FOR ALL USING ( member_id IN (SELECT id FROM mt_members WHERE user_id = auth.uid()) ); -- ============================================ -- ENABLE REALTIME -- ============================================ ALTER PUBLICATION supabase_realtime ADD TABLE mt_logs; ALTER PUBLICATION supabase_realtime ADD TABLE mt_inventory;
📌 Paste this into Claude Code as the opening brief. Have your Supabase URL, anon key, and Stitch DESIGN.md ready before you start. Claude Code will ask for them.
Claude Code — Opening Brief
You are building MedTrak — a production-grade family medication tracker as a PWA. This is a YouTube tutorial recording, so the build must be clean, complete, and free of errors. STACK: - Next.js 14 with App Router and TypeScript - Tailwind CSS - Supabase (auth + database + realtime) - next-pwa for service worker and PWA manifest - Deployed to Vercel (project already exists) - GitHub repository (already created — I will provide the remote URL) ENVIRONMENT VARIABLES (ask me for values before starting): - NEXT_PUBLIC_SUPABASE_URL - NEXT_PUBLIC_SUPABASE_ANON_KEY DESIGN SYSTEM: The project root will contain DESIGN.md exported from Google Stitch. Read it and apply those tokens to every component. Core values for reference: - Background: #f8f7f4 - Card: #ffffff - Primary: #0f2d56 (navy) - Text: #111111 - Success: #16a34a - Warning: #d97706 - Danger: #dc2626 - Border radius cards: 12px, buttons: 8px - Touch targets: 56px minimum height - Font size: 16px minimum everywhere - Bottom navigation on all app screens - I will provide Stitch screen exports as reference images for each component DATABASE: All tables use the mt_ prefix. Schema is already deployed in Supabase. Tables: - mt_family_groups (id, name, invite_code, created_at, updated_at) - mt_members (id, user_id, family_group_id, role, display_name) - mt_medications (id, patient_id, family_group_id, name, form, dosage_amount, dosage_unit, notes, is_active) - mt_schedules (id, medication_id, time_label, scheduled_time, quantity, frequency, specific_days, is_active) - mt_inventory (id, medication_id, quantity_remaining, unit, low_stock_threshold_days, last_restocked_at) - mt_logs (id, schedule_id, patient_id, confirmed_by_id, log_date, status, taken_at, quantity_taken, notes) - mt_notification_prefs (id, member_id, push_enabled, push_endpoint, push_p256dh, push_auth, reminder_minutes, missed_dose_alerts, low_stock_alerts) RLS is enabled. Realtime is enabled on mt_logs and mt_inventory. USER ROLES: 1. Patient — sees only their own medications and confirms doses 2. Caretaker — manages all patients in the family group, handles setup and monitoring ROUTES: Public: - /auth/sign-in - /auth/sign-up - /auth/forgot-password Onboarding (auth, no family group): - /onboarding — create or join choice - /onboarding/create — create family group (role becomes caretaker) - /onboarding/join — enter invite code, select role Patient (role = patient): - /patient/today — medications grouped by morning/afternoon/evening/night, confirm button per dose - /patient/history — calendar view, monthly, color-coded compliance dots - /patient/settings — profile, notifications Caretaker (role = caretaker): - /caretaker/dashboard — patient overview cards, low stock alerts - /caretaker/patients — list of patients - /caretaker/patients/[patientId] — patient detail, caretaker can confirm on their behalf - /caretaker/medications — medication list per patient - /caretaker/medications/add — add medication form - /caretaker/medications/[medId] — edit medication and schedule - /caretaker/inventory — stock levels, low stock warnings, inline editing - /caretaker/settings — family group info, invite code display, member list AUTH MIDDLEWARE: - Protect all /patient/* and /caretaker/* and /onboarding/* routes - After login: check if user has mt_members record - If yes: redirect to role home (/patient/today or /caretaker/dashboard) - If no: redirect to /onboarding - Store role in session/context — use to determine layout and permissions KEY FEATURE SPECS: Patient Today Screen: - Group mt_schedules by time_label (morning, afternoon, evening, night) - For each schedule: check mt_logs for today's log_date - Status: pending (no log yet), taken (status = taken), missed (past scheduled_time with no log) - Confirm button: inserts or updates mt_logs row, sets status = taken, taken_at = NOW(), quantity_taken = schedule.quantity - Subscribe to mt_logs realtime for this patient — update UI instantly if caretaker confirms Caretaker Dashboard: - For each patient in family group: count today's schedules vs taken logs - Show summary card with progress fraction and status chip - Alert banner if any medication below inventory threshold - Pull low stock calculation: quantity_remaining / (sum of daily quantities) = days remaining Inventory: - Days remaining = quantity_remaining divided by total daily doses for that medication - Color: green if days > threshold, amber if days between threshold/2 and threshold, red if days < threshold/2 - Threshold is stored as low_stock_threshold_days in mt_inventory — editable as a plain number text input PWA CONFIGURATION: - manifest.json: name MedTrak, short_name MedTrak, theme_color #0f2d56, background_color #f8f7f4, display standalone, start_url / - Icons: generate at 192x192 and 512x512 (navy circle with white M pill icon) - Service worker via next-pwa: cache patient today screen for offline fallback - Add to home screen prompt on first authenticated visit - Push notification setup: request permission after first login, store endpoint in mt_notification_prefs SUPABASE REALTIME: - mt_logs: patient today screen subscribes by patient_id and log_date - mt_inventory: caretaker dashboard subscribes to show live stock updates VERCEL CONFIG: - vercel.json with correct build settings for Next.js - Environment variables set in Vercel dashboard (I will do this) - Edge runtime for middleware BUILD ORDER: 1. Initialize Next.js 14 project with TypeScript, Tailwind, ESLint 2. Install: @supabase/supabase-js @supabase/ssr next-pwa 3. Set up Supabase server and client helpers 4. Set up auth middleware 5. Set up app layout with bottom navigation 6. Auth screens (sign-in, sign-up) 7. Onboarding flow 8. Patient today screen (core feature) 9. Patient history screen 10. Caretaker dashboard 11. Caretaker patient detail 12. Medication management (list, add, edit) 13. Inventory management 14. Settings screens 15. PWA configuration 16. Final testing and error cleanup Before you write any code, ask me for: 1. Supabase URL and anon key 2. GitHub remote repository URL 3. Confirm you have read DESIGN.md from the project root Ask these one at a time. Do not start coding until all three are confirmed.
📌 Run all four tracks simultaneously. While Stitch is generating, you're setting up the database and creating the repo. By the time Stitch finishes, everything else is ready for Claude Code.
Parallel Workflow — Do These Simultaneously
A
Stitch — Start Batch 1 immediatelyOpen stitch.withgoogle.com. Paste Batch 1 prompt. Let it run in the background. Start Batch 2 and 3 while it processes. Stitch is slow — kick it off first.
B
Supabase — Run the database scriptSQL Editor → paste the mt_ schema → run. Takes under 30 seconds. Done independently of everything else.
C
GitHub — Create the repositoryNew repo on GitHub. Name: medtrak. Private. No template. Copy the remote URL for Claude Code.
D
Vercel — Create the projectImport the GitHub repo into Vercel. Framework: Next.js. Add NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY in environment variables. Do not deploy yet.
E
Stitch — Export DESIGN.md + screensOnce all 3 Stitch batches are done: export DESIGN.md, export all screens as PNG. You will drop DESIGN.md into the repo root before starting Claude Code.
F
Claude Code — Start the buildEverything above is done. Paste the Claude Code brief. Provide Supabase credentials, GitHub URL, and confirm DESIGN.md is in the project root. Build starts.
What to Say on Camera — Opening
Today we're building MedTrak. The full version. Professional stack. Supabase for the database. Next.js for the app. Deployed to Vercel. All connected through GitHub. And it's a PWA — installs on any phone, no App Store. I'm running four things at once. While Google Stitch generates the UI, I'm setting up the database, the repo, and the Vercel project. By the time the designs are ready, everything else is already in place. Then we hand it all to Claude Code and build. Let's go.
📌 YouTube long-form only. Spoken to camera. Intro is ~90 seconds. Outro is ~45 seconds. No filler. No hype. Your voice.
🎙️ Intro Script — ~90 seconds
For the last few weeks I've been building micro apps on my phone. One prompt. Ten minutes. Done. You've been watching. Today is different. Today we build a real app. Full stack. Production grade. Something you can put in front of your family and hand them a phone. This is MedTrak. A medication tracker for families. Patients tap to confirm their doses. Caretakers manage medications, track inventory, and monitor the whole family in real time. Two interfaces. One shared database. Multi-user. Persistent data. Installable on any phone. Here's the stack. Google Stitch generates the UI designs. Supabase is the database — already running with full security policies in place. GitHub holds the code. Vercel deploys it. Claude Code builds the entire application. I'm running four of these simultaneously. While Stitch is generating the screens, the database is already live. The repo is set up. Vercel is connected. By the time you finish watching this video, you'll have seen a production app go from zero to deployed. End to end. The prompts, the database schema, the Claude Code brief — everything I used today is at nawaz.ca/builds. Let's go.
🎙️ Outro Script — ~45 seconds
That's MedTrak. Built and deployed. Patients have their screen. Caretakers have theirs. The database is live. Inventory is tracked. You can install it on your phone right now. Everything I used today — the Stitch prompts, the database schema, the Claude Code brief — it's all at nawaz.ca/builds. Download it. Use it. Build your own version or modify it for something else entirely. If you want to see how I build at this level regularly, subscribe. New builds every week. And if you haven't watched the micro apps series — that's where this all started. Ten apps, ten prompts, all on a phone. Link is below. Build now.
Timing Guide
1
Intro — shoot first, before anything is on screen Face to camera. No screen recording yet. Sets context before the build starts. 90 seconds max.
2
Build — the main content Switch to screen recording. Follow the parallel workflow in Tab 4. Edit out wait times and dead air. Target 20–25 minutes finished.
3
Outro — shoot after the build is live on Vercel Face to camera again. Show the deployed URL on screen behind you if possible. 45 seconds. End on "Build now."