A revolutionary blockchain-powered platform for secure, patient-controlled medical record management built with modern technologies.
This is a Turborepo monorepo with the following structure:
devjams/
βββ apps/
β βββ web/ # Next.js 14 frontend (Patient/Doctor dashboard)
β β βββ src/app/ # App router pages
β β βββ src/components/ # React components
β β βββ src/styles/ # Global styles
β βββ api/ # Express.js API server
β βββ src/routes/ # API endpoints
β βββ src/middleware/ # Auth, validation, etc.
β βββ src/index.ts # Server entry point
βββ packages/
β βββ database/ # Drizzle ORM schemas and migrations
β β βββ src/schema/ # Database tables and relations
β β βββ drizzle.config.ts # Drizzle configuration
β βββ web3/ # Blockchain integration utilities
β β βββ src/wallet.ts # Wallet operations
β β βββ src/contracts.ts # Smart contract interactions
β β βββ src/ipfs.ts # IPFS file storage
β βββ types/ # Shared TypeScript types
β βββ config/ # Shared configuration
βββ .env.example # Environment variables template
βββ setup.sh # Automated setup script
βββ turbo.json # Turborepo configuration
- Node.js 18+ - Download here
- PostgreSQL - Local installation or Neon DB cloud database
- Git - For version control
# Clone the repository
git clone <your-repo-url>
cd devjams
# Run the automated setup script
./setup.sh# Install dependencies
bun install
# Copy environment file
cp .env.example .env.local
# Update .env.local with your database URL and API keys
# Build all packages
bun run build
# Start development servers
bun run dev- Frontend: Next.js 14 (App Router), React 18, TypeScript
- Backend: Express.js, Node.js, TypeScript
- Database: PostgreSQL with Drizzle ORM
- Blockchain: Ethereum, Solidity, Ethers.js v6
- Storage: IPFS/Filecoin for decentralized file storage
- Styling: TailwindCSS, Radix UI components
- Monorepo: Turborepo for build orchestration
- π Patient-Controlled Access: Patients own and control their medical data
- βοΈ Blockchain Security: Immutable record hashes stored on-chain
- π Decentralized Storage: Medical files stored on IPFS/Filecoin
- π¨ Emergency Access: ICE mode for critical health information
- π₯ Provider Integration: APIs for healthcare providers to integrate
- π Audit Trail: Complete history of data access and sharing
bun run dev # Start all development servers
bun run build # Build all packages and apps
bun run lint # Lint all packages
bun run type-check # TypeScript type checking
bun run test # Run tests across all packages
bun run clean # Clean all build artifactsbun run db:generate # Generate database migrations
bun run db:push # Push schema changes to database
bun run db:migrate # Run pending migrations- Onboarding: Connect wallet, create profile
- Upload Records: Encrypt and store medical documents on IPFS
- Share Access: Grant temporary access to healthcare providers
- Emergency Mode: Set up ICE profile for emergencies
- Manage Access: View and revoke provider permissions
- Registration: Submit credentials for verification
- Request Access: Ask patients for record access
- View Records: Access patient data with granted permissions
- Upload Results: Add test results and reports (with consent)
- Integration: Use APIs to connect existing systems
- Provider Verification: Verify healthcare provider credentials
- System Monitoring: Monitor platform usage and security
- Compliance: Ensure HIPAA/GDPR compliance
Create a .env.local file in the root directory:
# Database Configuration
DATABASE_URL="postgresql://username:password@localhost:5432/medical_records"
# API Configuration
NEXT_PUBLIC_API_URL="http://localhost:3001"
PORT=3001
# Authentication
JWT_SECRET="your-super-secret-jwt-key-change-this-in-production"
# Blockchain Configuration
NEXT_PUBLIC_CHAIN_ID=1
NEXT_PUBLIC_RPC_URL="https://mainnet.infura.io/v3/your-infura-key"
# Smart Contract Addresses (deploy these first)
MEDICAL_RECORDS_ACCESS_CONTRACT="0x..."
MEDICAL_RECORDS_STORAGE_CONTRACT="0x..."
# IPFS Configuration
IPFS_API_URL="https://ipfs.infura.io:5001"
IPFS_GATEWAY_URL="https://ipfs.io/ipfs/"
# Pinata (for IPFS pinning)
PINATA_API_KEY="your-pinata-api-key"
PINATA_SECRET_KEY="your-pinata-secret-key"
# Environment
NODE_ENV="development"- Connect your GitHub repository to Vercel
- Set environment variables in Vercel dashboard
- Deploy automatically on git push
- Create new app on Railway or Heroku
- Connect GitHub repository
- Set environment variables
- Deploy with auto-deployments enabled
- Create PostgreSQL database on Neon or Supabase
- Update
DATABASE_URLin environment variables - Run migrations:
bun run db:push
# Deploy to testnet first
npx hardhat deploy --network sepolia
# Deploy to mainnet
npx hardhat deploy --network mainnet- Connect Wallet: Use MetaMask or WalletConnect
- Create Profile: Fill in basic information and emergency contacts
- Upload First Record: Add a medical document (PDF, image, etc.)
- Set ICE Mode: Configure emergency access information
- Share with Doctor: Grant access to a healthcare provider
- Register: Submit license and verification documents
- Wait for Approval: Admin reviews and verifies credentials
- Request Access: Ask patient for record access
- View Records: Access granted patient information
- Upload Results: Add new medical records for patients
# Run all tests
bun run test
# Run specific package tests
bun run test --filter=@aarovia/api
bun run test --filter=@aarovia/web
# Run with coverage
bun run test -- --coverage- Fork the repository
- Create a feature branch
- Make your changes
- Run tests and linting
- Submit a pull request
This project is licensed under the MIT License.