A complete, highly-optimized, and production-ready Clinic Management System built with HTML, CSS, Vanilla JS, and Firebase.
| Feature | Description |
|---|---|
| Professional SEO & Branding | Fully optimized with SEO tags, Open Graph meta tags, and a custom logo/favicon |
| Auth & Roles | Firebase Email/Password Auth with role-based access (Admin, Doctor, Receptionist) |
| Patient Management | Full CRUD, search/filter, patient profile with medical timeline |
| Appointment Management | Book, edit, filter by date/status, inline status updates |
| Prescription System | Multi-medicine prescriptions, jsPDF generation, Cloudinary PDF upload |
| Medical Timeline | Chronological history of appointments and prescriptions |
| Dashboard Statistics | Real-time stats per role with animated counters |
| Responsive Design | Mobile-friendly with sidebar toggle |
| Security Rules | Firestore role-based security rules included |
clinicflow/
βββ assets/
β βββ css/
β β βββ main.css β All styles (medical theme)
β βββ js/
β βββ utils.js β Shared utilities (toast, modal, etc.)
βββ pages/
β βββ login.html
β βββ admin-dashboard.html
β βββ doctor-dashboard.html
β βββ receptionist-dashboard.html
β βββ patients.html
β βββ appointments.html
β βββ prescriptions.html
βββ firebase-config.js β Firebase + Cloudinary config
βββ auth.js β Auth logic & route guards
βββ firestore.js β Firestore CRUD operations
βββ app.js β PDF generation & Cloudinary upload
βββ firestore.rules β Security rules to deploy
βββ README.md
- Go to Firebase Console and create a new project.
- Enable Authentication β Email/Password.
- Create a Firestore Database (Start in test mode, then apply rules).
- Get your Web App config from Project Settings.
- Sign up at cloudinary.com.
- Go to Settings β Upload β Upload Presets.
- Create an Unsigned upload preset (e.g.,
clinicflow_unsigned). - Note your Cloud Name.
Open firebase-config.js and replace the placeholders:
const firebaseConfig = {
apiKey: "YOUR_API_KEY",
authDomain: "YOUR_AUTH_DOMAIN",
projectId: "YOUR_PROJECT_ID",
storageBucket: "YOUR_STORAGE_BUCKET",
messagingSenderId: "YOUR_MESSAGING_SENDER_ID",
appId: "YOUR_APP_ID"
};
export const CLOUDINARY_CONFIG = {
cloudName: "YOUR_CLOUD_NAME",
uploadPreset: "YOUR_UPLOAD_PRESET",
apiUrl: "https://api.cloudinary.com/v1_1/YOUR_CLOUD_NAME/raw/upload"
};You can create demo users two ways:
Option A β Firebase Console (Recommended for first setup):
- Go to Firebase Console β Authentication β Add User
- Add email/password
- Then go to Firestore β users collection β Add document with the user's UID as the document ID:
{ "name": "Admin User", "email": "admin@clinicflow.com", "role": "admin", "createdAt": <timestamp> }
Option B β Browser Console (After initial setup): Open the app, open browser console, and run:
import { seedDemoUser } from './auth.js';
await seedDemoUser('admin@clinicflow.com', 'Admin@123', 'Admin User', 'admin');
await seedDemoUser('doctor@clinicflow.com', 'Doctor@123', 'Dr. Sarah Ahmed', 'doctor');
await seedDemoUser('reception@clinicflow.com', 'Recep@123', 'Ali Hassan', 'receptionist');# Install Firebase CLI
npm install -g firebase-tools
# Login
firebase login
# Initialize Firestore in your project folder
firebase init firestore
# Deploy rules
firebase deploy --only firestore:rules# Install CLI
npm install -g firebase-tools
# Login & init
firebase login
firebase init hosting
# Set public directory to: . (current folder)
# Configure as single-page app: No
# Deploy
firebase deploy --only hosting- Drag and drop your project folder to netlify.com/drop
- Done! Netlify gives you a live URL immediately.
- Push your code to GitHub
- Go to repository Settings β Pages
- Set source to the main branch
- Your site will be live at
https://username.github.io/repo-name
β οΈ Important: If using GitHub Pages or Netlify, update Firebase Authorized Domains in Firebase Console β Authentication β Settings β Authorized Domains.
| Action | Admin | Doctor | Receptionist |
|---|---|---|---|
| View Dashboard | β | β | β |
| Add/Edit/Delete Patients | β | β | β |
| View Patients | β | β | β |
| Book Appointments | β | β | β |
| Update Appointment Status | β | β | β |
| Write Prescriptions | β | β | β |
| View Prescriptions | β | β | β |
| Manage Users | β | β | β |
{
"id": "uid",
"name": "Dr. Sarah Ahmed",
"email": "doctor@clinic.com",
"role": "doctor",
"createdAt": "timestamp"
}{
"id": "auto-id",
"name": "John Doe",
"age": 35,
"gender": "male",
"phone": "03001234567",
"address": "House #5, Lahore",
"createdBy": "userId",
"createdAt": "timestamp"
}{
"id": "auto-id",
"patientId": "patientDocId",
"doctorId": "doctorUserId",
"date": "2025-02-28",
"status": "Pending | Confirmed | Completed | Cancelled",
"createdAt": "timestamp"
}{
"id": "auto-id",
"patientId": "patientDocId",
"doctorId": "doctorUserId",
"medicines": [
{ "name": "Paracetamol", "dosage": "500mg", "duration": "5 days" }
],
"notes": "Take after meals",
"pdfUrl": "https://res.cloudinary.com/...",
"createdAt": "timestamp"
}| Technology | Purpose |
|---|---|
| HTML5 | Markup structure |
| CSS3 (Vanilla) | Styling, animations, responsive layout |
| JavaScript (ES Modules) | Application logic |
| Firebase Authentication | User login/logout |
| Cloud Firestore | Real-time NoSQL database |
| Cloudinary | PDF storage & CDN delivery |
| jsPDF | Client-side PDF generation |
| Google Fonts (Inter) | Modern typography |
- Chrome 80+ β
- Firefox 75+ β
- Safari 14+ β
- Edge 80+ β
MIT License β Free to use for personal and commercial projects.
Built with β€οΈ using Firebase, Cloudinary, and jsPDF.
ClinicFlow v1.0 β Smart Clinic Management System