Skip to content

lakshitsoni26/MediTech

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MediChain - Prescription Security Platform

A blockchain-based prescription security platform that combines AI-powered verification with immutable blockchain records to ensure prescription authenticity and prevent fraud.

Features

  • 🔐 Blockchain Security: Immutable prescription records stored on the blockchain
  • 🤖 AI Verification: Advanced AI algorithms for prescription authenticity detection
  • 👥 Multi-Role Access: Secure access control for doctors, pharmacists, and administrators
  • 📱 Modern UI: Beautiful, responsive interface built with React and Tailwind CSS
  • 🔒 End-to-End Encryption: Military-grade encryption for sensitive patient data
  • 📊 Real-time Analytics: Comprehensive dashboard with statistics and activity tracking

Tech Stack

Backend

  • Node.js with Express.js
  • PostgreSQL with Prisma ORM
  • Redis for caching and job queues
  • JWT for authentication
  • Blockchain integration with Ethereum/Polygon
  • AI Services integration

Frontend

  • React 19 with TypeScript
  • Vite for build tooling
  • Tailwind CSS for styling
  • React Router for navigation
  • Lucide React for icons

Prerequisites

  • Node.js 18+
  • PostgreSQL 12+
  • Redis 6+
  • npm or yarn

Quick Start

1. Clone the Repository

git clone <repository-url>
cd MediChain

2. Backend Setup

cd backend

# Install dependencies
npm install

# Copy environment file
cp env.example .env

# Edit .env with your configuration
# DATABASE_URL, REDIS_URL, JWT_SECRET, etc.

# Set up database
npm run db:generate
npm run db:migrate

# Start the server
npm run dev

The backend will be running on http://localhost:4000

3. Frontend Setup

cd Frontend-BlockChain

# Install dependencies
npm install

# Copy environment file
cp env.example .env

# Edit .env with your backend API URL
# VITE_API_BASE_URL=http://localhost:4000/api/v1

# Start the development server
npm run dev

The frontend will be running on http://localhost:5173

Environment Configuration

Backend (.env)

# Database
DATABASE_URL="postgresql://username:password@localhost:5432/medichain_db"

# JWT Secrets
JWT_SECRET="your-super-secret-jwt-key-here"
REFRESH_SECRET="your-super-secret-refresh-key-here"

# Redis
REDIS_URL="redis://localhost:6379"

# AI Service
GEMINI_API_KEY="your-gemini-api-key-here"

# AWS S3 (optional)
S3_BUCKET="medichain-prescriptions"
S3_REGION="us-east-1"
S3_ACCESS_KEY="your-s3-access-key"
S3_SECRET_KEY="your-s3-secret-key"

# Blockchain
RPC_URL="https://polygon-mumbai.infura.io/v3/your-project-id"
WALLET_PRIVATE_KEY="your-wallet-private-key"
CONTRACT_ADDRESS="your-smart-contract-address"

# CORS
CORS_ORIGIN="http://localhost:5173"

# Server
PORT=4000
NODE_ENV="development"

Frontend (.env)

VITE_API_BASE_URL=http://localhost:4000/api/v1

API Endpoints

Authentication

  • POST /api/v1/auth/login - User login
  • POST /api/v1/auth/register/doctor - Doctor registration
  • POST /api/v1/auth/register/pharmacist - Pharmacist registration
  • POST /api/v1/auth/logout - User logout
  • GET /api/v1/auth/me - Get current user

Prescriptions

  • POST /api/v1/prescriptions/upload - Upload prescription
  • GET /api/v1/prescriptions - Get prescriptions
  • POST /api/v1/verify/prescription/:id - Verify prescription

AI Services

  • POST /api/v1/ai/generate-prescription - Generate prescription

Users

  • GET /api/v1/users - Get all users
  • GET /api/v1/users/doctors - Get verified doctors

User Roles

Doctor

  • Generate digital prescriptions
  • Upload prescription images
  • View prescription history
  • Access doctor directory

Pharmacist

  • Upload prescription images
  • Verify prescription authenticity
  • View verification history
  • Access doctor directory

Admin

  • All doctor and pharmacist permissions
  • User management
  • System analytics
  • Admin panel access

Development

Backend Development

cd backend

# Run tests
npm test

# Database operations
npm run db:studio    # Open Prisma Studio
npm run db:migrate   # Run migrations
npm run db:generate  # Generate Prisma client

# Linting
npm run lint

Frontend Development

cd Frontend-BlockChain

# Build for production
npm run build

# Preview production build
npm run preview

Docker Support

Backend Docker

cd backend

# Build and run with Docker Compose
docker-compose up -d

# Or build manually
docker build -t medichain-backend .
docker run -p 4000:4000 medichain-backend

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For support and questions, please open an issue in the GitHub repository or contact the development team.

Roadmap

  • Mobile app development
  • Advanced AI verification features
  • Integration with more blockchain networks
  • Real-time notifications
  • Advanced analytics and reporting
  • API rate limiting and monitoring
  • Multi-language support

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors