How naga-balaji/dawa-find-frontend works
Dawa-Find is a React frontend for finding nearby pharmacies and medicines, viewing shop inventory, scanning prescriptions for medicine matches, and supporting pharmacy partners and administrators. Users search or browse from the map, refine by radius, and open a pharmacy detail page; prescription scans upload an image and location context for analysis and nearby stock results. Authentication stores a JWT for API requests, while role-gated routes expose pharmacy and admin areas. The README documents these capabilities; partner-page implementation details were not sampled, so their API wiring is not inferred.
Main entry points: App.jsx Routes and navigation · client.js HTTP client and JWT · RequireRole.jsx Role route gate · auth.js Session helpers
Components 17
Pharmacy discovery
- Map and medicine search
src/pages/Home.jsx - Pharmacy inventory detail
src/pages/PharmacyDetail.jsx
Identity and access
- HTTP client and JWT
src/api/client.js - Session helpers
src/auth.js - Role route gate
src/components/RequireRole.jsx - Login
src/pages/Login.jsx - Registration
src/pages/Register.jsx
Prescription scan
- Prescription scan
src/pages/Prescription.jsx
Pharmacy operations
- Partner shop
src/pages/PartnerShop.jsx - Partner inventory
src/pages/PartnerInventory.jsx - Pharmacy verification
src/pages/AdminPharmacies.jsx
Other components
- Medicine seeker
- Pharmacy partner
- Platform administrator
- React entry
src/main.jsx - Routes and navigation
src/App.jsx - Dawa-Find API
Connections 26
- React entry → Routes and navigation: mounts
- Routes and navigation → Map and medicine search: routes
- Routes and navigation → Pharmacy inventory detail: routes
- Routes and navigation → Prescription scan: routes
- Routes and navigation → Login: routes
- Routes and navigation → Registration: routes
- Routes and navigation → Role route gate: guards routes
- Role route gate → Partner shop: allows pharmacy
- Role route gate → Partner inventory: allows pharmacy
- Role route gate → Pharmacy verification: allows admin
- Medicine seeker → Map and medicine search: searches nearby
- Map and medicine search → HTTP client and JWT: requests pharmacies
- Pharmacy inventory detail → HTTP client and JWT: loads shop inventory
- Prescription scan → HTTP client and JWT: submits scan
- Pharmacy verification → HTTP client and JWT: loads and updates
- Routes and navigation → HTTP client and JWT: logs out
- Login → Session helpers: sets session
- Registration → Session helpers: sets session
- Routes and navigation → Session helpers: reads session
- Role route gate → Session helpers: checks role
- HTTP client and JWT → Session helpers: clears expired session
- HTTP client and JWT → Dawa-Find API: sends API requests
- Dawa-Find API → HTTP client and JWT: returns responses
- Pharmacy partner → Partner shop: manages shop
- Pharmacy partner → Partner inventory: updates stock
- Platform administrator → Pharmacy verification: reviews pharmacies