How kpdhanya-lab/thethirdbyte works
TheThirdByte is a hybrid hospital-pharmacy workflow with separate patient and pharmacist portals. Patients upload prescriptions for AI extraction and submit them to the dispensary; pharmacists review the queue, verify prescriptions, and issue dispensing tokens. Patients then redeem tokens to collect medication. The sampled code supports these portal, extraction, data-access, and token-service responsibilities; some integration wiring is inferred only from function names and documented UI behavior, so uncertain links are omitted.
Main entry points: src/App.tsx Dispensary workflow · src/App.tsx Patient workflow · PrescriptionUploadView.tsx Prescription upload · DispensingBay.tsx Dispensing bay
Components 18
Patient portal
- Patient workflow
paitent-portal-frontend/src/App.tsx - Prescription upload
paitent-portal-frontend/src/components/PrescriptionUploadView.tsx - Patient data access
paitent-portal-frontend/src/utils/supabase.ts - Image extraction
paitent-portal-frontend/src/utils/gemini.ts - Dispense readiness
Pharmacist portal
- Dispensary workflow
pharmacist-portal-frontend/src/App.tsx - Prescription queue
pharmacist-portal-frontend/src/components/PrescriptionQueueView.tsx - Dispensing bay
pharmacist-portal-frontend/src/components/DispensingBay.tsx - Interaction review
pharmacist-portal-frontend/src/components/InteractionChecker.tsx - Terminal audit
pharmacist-portal-frontend/src/components/TerminalSecurityAudit.tsx - Pharmacy data access
pharmacist-portal-frontend/src/utils/supabase.ts
Dispense tokens
- Issue token
supabase/functions/create-dispense-token/index.ts - Redeem token
supabase/functions/redeem-dispense-token/index.ts - Token service
paitent-portal-frontend/src/server/dispenseTokenService.ts
External services
- Supabase
- Vision AI
Other components
- Patient
- Pharmacist
Connections 21
- Patient → Patient workflow: uses
- Patient workflow → Patient data access: looks up patient
- Patient data access → Supabase: reads / writes
- Patient workflow → Prescription upload: opens upload
- Prescription upload → Image extraction: extracts prescription
- Image extraction → Vision AI: analyzes image
- Prescription upload → Patient data access: submits prescription
- Pharmacist → Dispensary workflow: uses
- Dispensary workflow → Pharmacy data access: loads and subscribes
- Pharmacy data access → Supabase: reads / updates
- Dispensary workflow → Prescription queue: displays queue
- Dispensary workflow → Dispensing bay: opens dispensing
- Dispensary workflow → Interaction review: opens review
- Dispensing bay → Pharmacy data access: resolves prescription
- Dispensing bay → Issue token: requests token
- Issue token → Supabase: validates and stores
- Redeem token → Supabase: validates and updates
- Patient → Redeem token: presents token
- Redeem token → Dispense readiness: returns redemption result
- Token service → Supabase: manages token records
- Dispensary workflow → Terminal audit: shows audit view