Quick Start Guide
Get started with MediPact in minutes. Follow these steps to set up and run the platform.
Prerequisites
Required Software
- Node.js 18+ - Download
- Git - Download
- Hedera Testnet Account - Get Free Account
Installation
1. Clone Repository
1git clone git@github.com:najuna-brian/medipact.git
2cd medipact2. Install Dependencies
1# Install adapter dependencies
2cd adapter && npm install
3
4# Install backend dependencies
5cd ../backend && npm install
6
7# Install frontend dependencies
8cd ../frontend && npm install
9
10# Install contract dependencies
11cd ../contracts && npm installConfiguration
Environment Variables
Create .env files in each component directory. Check the environment variables in:
backend/.envfrontend/.env.localadapter/.envcontracts/.env
Frontend Configuration
1# frontend/.env.local
2NEXT_PUBLIC_API_URL="http://localhost:8080"
3NEXT_PUBLIC_HEDERA_NETWORK="testnet"Hedera Configuration
You'll need your Hedera testnet account credentials:
- Operator ID (0.0.xxxxx)
- Operator Private Key
- Network (testnet or mainnet)
Get a free testnet account at Hedera Portal
Running the Application
1. Start Backend
1cd backend
2npm startBackend runs on http://localhost:8080
2. Start Frontend
1cd frontend
2npm run devFrontend runs on http://localhost:3000
3. Start Adapter (Optional)
1cd adapter
2npm startAdapter processes EHR data and submits to Hedera
Deploy Smart Contracts
1cd contracts
2npm run deploy:testnetThis deploys the ConsentManager and RevenueSplitter contracts to Hedera testnet. Save the contract addresses for configuration.
Testing
Run Tests
1# Test contracts
2cd contracts && npm test
3
4# Validate adapter
5cd adapter && npm run validateAccess Points
Frontend
1http://localhost:3000API Documentation
1http://localhost:8080/api-docsDocumentation Site
1http://localhost:3000/docsHashScan Explorer
1https://hashscan.io/testnetNext Steps
Getting Started Checklist
- ✅ Install all dependencies
- ✅ Configure environment variables
- ✅ Deploy smart contracts to testnet
- ✅ Start backend and frontend services
- ✅ Register a test hospital account
- ✅ Register a test researcher account
- ✅ Upload sample patient data
- ✅ Query and purchase a dataset
Troubleshooting
Common Issues
Port Already in Use
If port 3000 or 8080 is already in use, change the port in your configuration or stop the conflicting service.
Hedera Connection Issues
Ensure your Hedera testnet credentials are correct and you have sufficient HBAR in your account for transactions.
Database Errors
Make sure the database file exists and has proper permissions. For PostgreSQL, ensure the database is created and accessible.