🏥 MyHealthID-Core

A comprehensive healthcare clinic management system built with Next.js 14, TypeScript, and Prisma ORM.

Next.js TypeScript Prisma Tailwind CSS


📋 Table of Contents


🌟 Overview

MyHealthID-Core is a full-stack healthcare management platform designed to streamline operations across a clinic or hospital. It provides role-based portals for doctors, patients, pharmacists, lab technicians, triage nurses, and administrators — all in one unified system.

Patients are identified using a unique Health ID, which can be scanned via QR code or read using OCR (optical character recognition), making the system fast and paperless.


✨ Features

  • 🧑‍⚕️ Doctor Portal — View patient records, write prescriptions, request lab tests
  • 👤 Patient Portal — Access personal health records and visit history
  • 💊 Pharmacy Portal — Manage and dispense prescriptions
  • 🔬 Laboratory Portal — Receive and record investigation results
  • 🩺 Triage Portal — Record vital signs and assess patient urgency
  • 📋 Screening Portal — Initial patient screening and registration
  • 📊 Admin Dashboard — System-wide management and reporting
  • 🔢 Queue Management — Real-time patient queue tracking
  • 📷 QR & OCR Scanning — Instant patient identification
  • 📧 Email Notifications — Automated email support via Nodemailer
  • 📈 Charts & Analytics — Visual data with Recharts

🛠️ Tech Stack

Technology Purpose
Next.js 14 (App Router) Full-stack React framework
TypeScript Type-safe development
Tailwind CSS Utility-first styling
Prisma ORM Database access and migrations
React + Radix UI UI components
Recharts Data visualization
html5-qrcode / jsqr QR code scanning
Tesseract.js OCR — reading text from images
Nodemailer Email sending

📁 Project Structure

MyHealthID-Core-main/
├── app/                    # Next.js App Router pages & routes
│   ├── admin/              # Admin dashboard
│   ├── doctor/             # Doctor portal
│   ├── patient/            # Patient portal
│   ├── pharmacy/           # Pharmacy portal
│   ├── laboratory/         # Lab portal
│   ├── triage/             # Triage portal
│   ├── screening/          # Screening portal
│   └── queue/              # Queue management
├── components/             # Shared UI components
├── lib/                    # Utilities: AI, Prisma client, OCR, QR
├── prisma/                 # Database schema & migrations
│   └── schema.prisma
├── scripts/                # Helper/utility scripts
├── .env.example            # Example environment variables
├── middleware.ts           # Route protection middleware
└── README.md

🚀 Getting Started

Prerequisites

Make sure you have the following installed:

  • Node.js v18 or higher
  • npm v9 or higher
  • A PostgreSQL (or compatible) database

Installation

  1. Clone the repository
git clone https://github.com/your-username/MyHealthID-Core.git
cd MyHealthID-Core
  1. Install dependencies
npm install
  1. Set up environment variables
cp .env.example .env.local

Then fill in the required values (see Environment Variables).

  1. Generate Prisma client
npx prisma generate
  1. Apply the database schema
npx prisma db push
  1. Start the development server
npm run dev

Open http://localhost:3000 in your browser. 🎉


🔐 Environment Variables

Copy .env.example to .env.local and fill in the values:

# Database
DATABASE_URL="postgresql://user:password@localhost:5432/myhealthid"

# Authentication
NEXTAUTH_SECRET="your-secret-key"
NEXTAUTH_URL="http://localhost:3000"

# Email (Nodemailer)
EMAIL_HOST="smtp.example.com"
EMAIL_PORT=587
EMAIL_USER="your@email.com"
EMAIL_PASS="your-email-password"

⚠️ Never commit your .env or .env.local files to GitHub. They are already listed in .gitignore.


🗄️ Database Setup

This project uses Prisma ORM. The schema is defined in prisma/schema.prisma.

# Generate the Prisma client after schema changes
npx prisma generate

# Push schema to the database (development)
npx prisma db push

# Run migrations (production)
npx prisma migrate deploy

# Open Prisma Studio (visual DB browser)
npx prisma studio

📜 Available Scripts

Script Description
npm run dev Start development server
npm run build Build for production
npm run start Start production server
npm run lint Run ESLint checks

🏥 Portals

Portal Route Description
Admin /admin System administration
Doctor /doctor Clinical workflows
Patient /patient Patient self-service
Pharmacy /pharmacy Prescription management
Laboratory /laboratory Lab results & tests
Triage /triage Vitals & urgency triage
Screening /screening Initial registration
Queue /queue Real-time queue board

🤝 Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a new branch: git checkout -b feature/your-feature-name
  3. Make your changes and commit: git commit -m "Add your feature"
  4. Push to your fork: git push origin feature/your-feature-name
  5. Open a Pull Request

📄 License

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


Made with ❤️ for better healthcare

Built With

Share this project:

Updates