A React-based frontend application for the blockchain-based Pharmaceutical Supply Chain Management System.
This frontend application provides a user-friendly interface to interact with the pharmaceutical supply chain management smart contracts. It allows stakeholders to register entities, manage medicines, track batches, and monitor the movement of drugs through the supply chain with complete transparency and security.
- Stakeholder Management: Register, view, and manage different supply chain entities
- Medicine Registry: Create, approve, and track pharmaceutical products
- Batch Operations: Create and monitor medicine batches with production and expiry date tracking
- Transfer Workflows: Transfer medicine ownership between stakeholders
- Dispensing System: Record medicines dispensed to patients
- Supply Chain History: View complete medicine history through the supply chain
- Authentication: Secure wallet-based authentication
- Framework: React with TypeScript
- Styling: Tailwind CSS with ShadCN UI components
- Blockchain Interaction: wagmi, viem
- Form Management: react-hook-form with zod validation
- Notifications: sonner toast system
- Routing: react-router
- Data Management: React Query
- Node.js v16 or later
- npm or yarn
- MetaMask or another Web3 wallet
-
Clone the repository
git clone https://github.com/UmesiQueen/pharm-x-frontend.git cd pharm-x-chain-frontend -
Install dependencies
npm install
-
Start the development server
npm run dev
-
Open your browser and navigate to
http://localhost:5173
The application connects to the Base Sepolia testnet. You'll need:
- A wallet extension like MetaMask configured for Base Sepolia
- Test ETH in your wallet (available from Base Sepolia faucets)
The frontend interacts with three main smart contracts:
- GlobalRegistry: Manages entity registration and verification
- DrugRegistry: Handles medicine registration, approval, and batch management
- SupplyChainRegistry: Tracks medicine transfers throughout the supply chain
Contract addresses are configured in src/lib/constants.ts.
Different dashboard features are available based on the connected wallet's role:
- Regulator: Can approve medicines and entities
- Manufacturer: Can register medicines and create batches
- Supplier: Can distribute medicines to pharmacies
- Pharmacy: Can dispense medicines to patients
Built with ❤️ by Queen