How raviyaa27/counterfeit-medicine-checker works
Counterfeit Medicine Checker is a blockchain-backed medicine-authenticity product. Manufacturers register batches, the regulator approves or recalls them, supply-chain participants transfer custody, pharmacies record sales, and patients check pack serials and custody without a wallet. The frontend has role-specific pages and a public verification view; the Solidity registry is the shared on-chain source of truth. The source excerpts show verification and custody reads, transaction submission, and shared UI components; other page-to-contract actions are represented from the README’s workflow descriptions.
Main entry points: MedicineRegistry.sol Medicine registry · page.tsx Regulator page · tx.ts Transaction submission · SupplyPanel.tsx Batch transfers
Components 25
Web application
- Regulator page
frontend/app/admin/page.tsx - Batch approval
frontend/components/BatchAdmin.tsx - Participant management
frontend/components/RegisterParticipantForm.tsx - Participant list
frontend/components/ParticipantList.tsx - Organization names
frontend/components/OrgName.tsx - Wallet and query providers
frontend/app/providers.tsx - Transaction submission
frontend/lib/tx.ts - Chain configuration
frontend/lib/config.ts - Registry interface
frontend/lib/registryAbi.ts
Supply operations
- Manufacturer page
frontend/app/manufacturer/page.tsx - Batch registration
frontend/components/NewBatchForm.tsx - Supply page
frontend/app/supply/page.tsx - Batch transfers
frontend/components/SupplyPanel.tsx - Custody trail
frontend/components/CustodyTrail.tsx - Pharmacy page
frontend/app/pharmacy/page.tsx - Record sale
frontend/components/DispenseForm.tsx
Patient verification
- Verify page
frontend/app/verify/page.tsx - Verification result
frontend/components/VerifyResult.tsx
On-chain registry
- Medicine registry
contracts/src/MedicineRegistry.sol
Other components
- Manufacturer
- NMRA regulator
- Distributor
- Pharmacy
- Patient
- Ethereum network
Connections 30
- Manufacturer → Manufacturer page: registers batch
README.md - Manufacturer page → Batch registration: registers through
- Batch registration → Medicine registry: registers batch
README.md - NMRA regulator → Regulator page: manages registry
README.md - Regulator page → Batch approval: approves or recalls
- Batch approval → Medicine registry: approves or recalls
README.md - Regulator page → Participant management: registers participants
- Participant management → Medicine registry: registers participants
README.md - Regulator page → Participant list: views participants
- Distributor → Supply page: ships batches
README.md - Supply page → Batch transfers: shows transfers
- Batch transfers → Medicine registry: transfers batches
README.md - Batch transfers → Custody trail: renders trail
frontend/components/SupplyPanel.tsx - Batch transfers → Transaction submission: submits transfer
frontend/components/SupplyPanel.tsx - Pharmacy → Pharmacy page: records sale
README.md - Pharmacy page → Record sale: marks packs sold
- Record sale → Medicine registry: records sale
README.md - Patient → Verify page: scans pack code
README.md - Verify page → Verification result: shows verdict
- Verification result → Medicine registry: reads verification
frontend/components/VerifyResult.tsx - Verification result → Custody trail: renders trail
frontend/components/VerifyResult.tsx - Custody trail → Medicine registry: reads custody history
frontend/components/CustodyTrail.tsx - Custody trail → Organization names: renders organizations
frontend/components/CustodyTrail.tsx - Verification result → Organization names: renders organization
frontend/components/VerifyResult.tsx - Batch approval → Organization names: renders organizations
frontend/components/BatchAdmin.tsx - Transaction submission → Chain configuration: uses chain settings
frontend/lib/tx.ts - Transaction submission → Registry interface: encodes calls
frontend/lib/tx.ts - Transaction submission → Medicine registry: submits transactions
frontend/lib/tx.ts - Medicine registry → Ethereum network: stores registry state
README.md - Wallet and query providers → Chain configuration: configures wallet
frontend/app/providers.tsx