Sign inSign up

krrishmahar/hims

By krrishmahar

•Updated about 8 hours ago

Hospital Information Management System (HIMS) with LIS integration & BullMQ background workers

Image
Message queues
Web servers
Databases & storage
1

143

krrishmahar/hims repository overview

⁠Medsphere — Hospital Information Management System (HIMS)

Next.js Prisma PostgreSQL Redis Healthcare HIMS BullMQ Laboratory

Docker Pulls Docker Image Size Version

Medsphere HIMS is an enterprise-grade Hospital Information and Management System built with Next.js 16, React 19, Prisma 7, PostgreSQL, and BullMQ. It features full electronic medical records (EMR), patient admission-discharge-transfer (ADT), outpatient/inpatient workflows, pharmacy inventory, billing, Razorpay integration, and bidirectional LIS integration via Labsync.


⁠Features

  • Clinical & EMR: Inpatient/Outpatient management, vital signs recording, prescriptions, electronic diagnosis, discharge summaries.
  • OT & Bed Management: Real-time bed occupancy tracking, ward allocation, and operation theatre scheduling.
  • Pharmacy & Inventory: Drug dispensing, batch tracking, expiry alerts, and stock management.
  • Laboratory Integration (Labsync): Secure bidirectional integration with Labsphere LIS, HMAC request signing, SSO ticket exchange, and automated test result synchronization.
  • Billing & Payments: Invoicing, insurance claim processing, and automated payment reconciliation via Razorpay.
  • Asynchronous Workers: High-performance background jobs powered by Redis and BullMQ (notifications, automated reporting, database backups).
  • Hardened Security: Multi-stage Alpine container, non-root execution (nextjs:nodejs), Zero known CVE vulnerabilities (npm audit clean).

⁠Quick Start

⁠Run with Docker CLI
docker run -d \
  --name hims-app \
  -p 3000:3000 \
  -e DATABASE_URL="postgresql://user:password@postgres:5432/hims?schema=public" \
  -e NEXTAUTH_SECRET="your-32-char-random-secret" \
  -e NEXTAUTH_URL="http://localhost:3000" \
  krrishmahar/hims:0.2.0

⁠Docker Compose Example

A complete deployment with PostgreSQL and Redis:

version: '3.8'

services:
  postgres:
    image: postgres:16-alpine
    restart: unless-stopped
    environment:
      POSTGRES_USER: hims_user
      POSTGRES_PASSWORD: hims_password
      POSTGRES_DB: hims
    volumes:
      - postgres_data:/var/lib/postgresql/data
    ports:
      - "5432:5432"

  redis:
    image: redis:7-alpine
    restart: unless-stopped
    ports:
      - "6379:6379"
    volumes:
      - redis_data:/data

  hims-web:
    image: krrishmahar/hims:0.2.0
    restart: unless-stopped
    depends_on:
      - postgres
      - redis
    ports:
      - "3000:3000"
    environment:
      - NODE_ENV=production
      - PORT=3000
      - HOSTNAME=0.0.0.0
      - DATABASE_URL=postgresql://hims_user:hims_password@postgres:5432/hims?schema=public
      - NEXTAUTH_URL=http://localhost:3000
      - NEXTAUTH_SECRET=generate_a_secure_random_key_here
      - REDIS_URL=redis://redis:6379
      # Optional: Labsphere LIS integration
      - LABSPHERE_APP_URL=https://labsphere-med.vercel.app
      - LABSPHERE_SSO_AUDIENCE=https://labsphere-med.vercel.app
      - HIMS_TO_LABSPHERE_SSO_SECRET=your_shared_sso_secret

  # Background Queue Worker Dyno (BullMQ)
  hims-worker:
    image: krrishmahar/hims:0.2.0
    restart: unless-stopped
    command: ["node", "workers/runner.js"]
    depends_on:
      - postgres
      - redis
    environment:
      - NODE_ENV=production
      - DATABASE_URL=postgresql://hims_user:hims_password@postgres:5432/hims?schema=public
      - REDIS_URL=redis://redis:6379

volumes:
  postgres_data:
  redis_data:

⁠Key Environment Variables

VariableRequiredDescription
DATABASE_URLYesPostgreSQL connection string (postgresql://...)
NEXTAUTH_SECRETYesRandom 32+ character string for JWT session encryption
NEXTAUTH_URLYesPublic canonical URL of the application
REDIS_URLOptionalRedis connection URL for BullMQ job processing
LABSPHERE_APP_URLOptionalEndpoint URL for the connected Labsphere LIS instance
LABSPHERE_SSO_AUDIENCEOptionalSSO Audience domain for laboratory ticket validation
HIMS_TO_LABSPHERE_SSO_SECRETOptionalShared HMAC secret for cross-application single sign-on
RAZORPAY_KEY_IDOptionalRazorpay payment gateway Key ID
RAZORPAY_KEY_SECRETOptionalRazorpay payment gateway Key Secret

⁠Image Tags

TagNotes
0.2.0, latestStable release with Zod 4, Next.js 16.4.3 standalone bundle, zero CVE vulnerabilities
0.2.0-0b85d80Pinned git commit release 0b85d80
0.1.0Initial release

⁠Architecture & Security

  • Base Image: node:22-alpine (Minimal musl-based container footprint)
  • User: Non-root system account (nextjs:nodejs, UID 1001)
  • Prisma Schema: Embedded in image at /app/prisma for zero-downtime runtime migration execution (npx prisma migrate deploy)
  • Standalone Build: Standalone Next.js distribution eliminating non-production node_modules overhead

Tag summary

Content type

Image

Digest

sha256:275acb4bb…

Size

100.4 MB

Last updated

about 8 hours ago

docker pull krrishmahar/hims