A modern, multi-tenant Hospital Management System built with Next.js 15, TypeScript, and Prisma. This application is designed to streamline hospital operations, managing everything from patient registration to billing and lab reports.
- Multi-Tenancy: Support for multiple hospitals/clinics on a single instance using subdomains.
- Role-Based Access Control (RBAC): Granular permissions for Admins, Doctors, Nurses, Receptionists, Pharmacists, and Lab Technicians.
- Patient Management: Comprehensive patient records, history, and OPD/IPD status.
- Doctor & Staff Management: Manage profiles, schedules, and specializations.
- Appointments: Easy scheduling and management of patient appointments.
- Prescriptions: Digital prescription generation and management.
- Pharmacy & Inventory: Track medicine stock and manage pharmacy sales.
- Lab Reports: Manage pathology and radiology reports with AI-powered analysis integration.
- Billing & Invoicing: Integrated billing system with Razorpay support for payments.
- Authentication: Secure login with email/password and phone number support via NextAuth.js.
- Framework: Next.js 15 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS & Shadcn UI
- Database: PostgreSQL (via Neon)
- ORM: Prisma
- Auth: NextAuth.js (v5)
- Forms: React Hook Form + Zod
- Payments: Razorpay
- Node.js 18+
- PostgreSQL Database
-
Clone the repository:
git clone https://github.com/vikasboura/hospital-hms.git cd hospital-hms -
Install dependencies:
npm install
-
Set up Environment Variables: Copy
.env.exampleto.envand fill in your details:cp .env.example .env
DATABASE_URL: Your PostgreSQL connection string.AUTH_SECRET: Generate a random secret (e.g.,openssl rand -base64 32).RESEND_API_KEY: For email notifications.RAZORPAY_KEY_ID&SECRET: For payments.
-
Database Setup:
npx prisma generate npx prisma db push npx prisma db seed # Seeds default roles and admin -
Run the development server:
npm run dev
Open http://localhost:3000 in your browser.
/app: Next.js App Router pages and layouts./components: Reusable UI components (Shadcn UI)./lib: Utility functions and shared logic./prisma: Database schema and seed scripts./actions: Server actions for data mutation./types: TypeScript type definitions.
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.
Prerequisites: Node.js
- Install dependencies:
npm install - Set the
GEMINI_API_KEYin .env.local to your Gemini API key - Run the app:
npm run dev