Healthcare Software / AI
AI Clinic Management System
A multi-role clinic management platform designed for Admin, Doctor, Receptionist, and Patient workflows with digital prescriptions and AI-powered plain-language explanations.
Note: This project is presented strictly as a software engineering showcase and clinic workflow management system. It does not make medical claims, provide clinical diagnoses, or replace professional medical advice.
- Project type
- Multi-Role Healthcare Workflow Software (Hackathon / Full-Stack Project)
- Status
- Live Demo & Public Repository
- Built with
- Next.js, Firebase, Redux Toolkit, Tailwind CSS
1600 × 1000
AI Clinic Management System
Overview
About AI Clinic Management System
Context
AI Clinic Management System was engineered to demonstrate how multi-role administrative software can streamline front-desk scheduling, doctor consultation records, and patient communication within a single Next.js 16 and Firebase application.
The problem
Small and mid-sized clinics often rely on disconnected paper registers for reception booking, manual prescription writing, and scattered patient histories—making it difficult for doctors to view chronological visit histories or for patients to access clear digital copies of their prescriptions.
The solution
We implemented a strict four-role software architecture backed by Firebase Auth and Firestore (`users/{uid}.role`), typed Redux Toolkit slices, automated server-side PDF prescription generation with `pdf-lib`, and an `/api/ai/explain` endpoint using Google Gemini to provide plain-language readability for prescription records.
AI Clinic Management System is a full-stack clinic operations web application built with Next.js 16, Firebase (Auth, Firestore, Storage, Admin SDK), Redux Toolkit, pdf-lib, and Google Gemini. It provides four role-specific dashboards (Admin, Doctor, Receptionist, and Patient) covering patient registration, appointment scheduling, patient history timelines, PDF prescription generation, and an AI Explain feature that translates structured prescription entries into readable plain-language summaries.
Features
What it does
- 01
Four Scoped Role Dashboards
Dedicated interfaces under /dashboard/admin, /dashboard/doctor, /dashboard/receptionist, and /dashboard/patient enforced by a custom useRequireAuth role guard hook.
- 02
Patient History Timeline & Appointment Scheduling
Receptionists and admins register patients and manage appointment slots, while doctors inspect chronological appointment timelines (/patients/[id]/history) with status filters.
- 03
Digital Prescriptions & PDF Generation (pdf-lib)
Doctors create structured prescriptions with medication and dosage entries; the server route (/api/prescriptions) generates a formatted PDF via pdf-lib and uploads it to Firebase Storage.
- 04
AI Prescription Explanation (/api/ai/explain)
Integrates Google Gemini to generate a clear, plain-language explanation of a prescription record so patients can review structured medication instructions easily.
How it works
Architecture and workflow
Built on Next.js 16 App Router combining Firebase Client SDK for real-time auth state, Firebase Admin SDK on server routes, Zod validation, and a strongly typed Redux Toolkit store (auth, user, patient, appointment, and prescription slices).
- 01
Role Authentication & Guarding
Users sign in via Firebase Auth; AuthStateListener synchronizes the user’s Firestore role (admin, doctor, receptionist, or patient) into Redux state.
- 02
Patient Registration & Appointment Booking
Receptionists register patient profiles and schedule appointments assigned to specific doctors.
- 03
Consultation & PDF Prescription Generation
Doctors review the patient’s history timeline and issue a prescription, triggering pdf-lib document creation and Firebase Storage archiving.
- 04
Patient Portal & Plain-Language Summary
Patients log into their portal to download the prescription PDF and view an AI-generated plain-language summary via the /api/ai/explain endpoint.
Technology
Tools used
Application Framework
- Next.js 16 (App Router)
- React
- TypeScript
- Tailwind CSS v4
- Zod
State Management
- Redux Toolkit (createSlice, typed AppDispatch)
- React-Redux
Backend & Cloud Infrastructure
- Firebase Authentication
- Firebase Firestore
- Firebase Storage
- firebase-admin
Document & AI Services
- pdf-lib (Server PDF Generation)
- Google Gemini API (/api/ai/explain)
Challenges
Problems we solved along the way
- Challenge 01
Enforcing strict role boundaries across four distinct user personas in a single web app
Resolution: Combined Firestore user role documents with a reusable useRequireAuth hook and role-aware Sidebar component so each role only accesses authorized routes.
- Challenge 02
Generating reliable downloadable prescription documents on serverless routes
Resolution: Used pdf-lib inside the Next.js API route to programmatically construct PDF documents in memory and persist them to Firebase Storage.
Start a project
Want something like AI Clinic Management System? Let’s talk.
Share a few details and get a clear scope and a written quote. No obligation.
- Free consultation
- Written quote
- Reply within 1 business day