Skip to content

LoganthP/Hospital-Management-System-Firebase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

HealthHub Central πŸ₯

Your integrated solution for efficient hospital management and seamless patient care.

Next.js TypeScript Tailwind CSS Firebase AI Powered

✨ Features

πŸ€– AI-Powered Healthcare Solutions

  • AI Specialist Finder: Intelligent doctor recommendations based on symptoms analysis
  • AI Prescription Generator: Automated prescription creation with structured medical protocols
  • Hospital Guide Chat: Interactive AI assistant for hospital navigation and information

πŸ“Š Comprehensive Management System

  • Role-Based Dashboards: Tailored interfaces for admins, doctors, nurses, and patients
  • Patient Data Management: Secure CRUD operations for comprehensive patient records
  • Appointment System: Advanced scheduling and management capabilities
  • Medical Records: Complete digital health record management
  • Billing & Payments: Streamlined financial management with rupee-based calculations

πŸ” Enterprise-Grade Features

  • Secure Authentication: Role-based access control
  • Real-time Analytics: Live dashboard with performance metrics
  • Responsive Design: Mobile-first approach for all devices
  • Data Visualization: Interactive charts and reporting tools

πŸ› οΈ Tech Stack

Frontend Next.js React TypeScript
Styling Tailwind shadcn/ui Radix UI
Backend & Database Firebase TanStack Query
AI & Analytics Google AI Genkit Recharts
Development Zod React Hook Form Lucide Icons

πŸš€ Quick Start

Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (18.0 or later)
  • npm or yarn
  • Git

Installation

  1. Clone the repository

    git clone https://github.com/LoganthP/Hospital-Management-System.git
    cd Hospital-Management-System
  2. Install dependencies

    npm install
    # or
    yarn install
  3. Set up environment variables

    cp .env.local.example .env.local

    Configure your environment variables:

    # AI Configuration
    GOOGLE_GENAI_API_KEY=your_google_ai_api_key
    
    # Firebase Configuration
    NEXT_PUBLIC_FIREBASE_API_KEY=your_firebase_api_key
    NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
    NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id
  4. Start the development server

    npm run dev
    # or
    yarn dev
  5. Open your browser Navigate to http://localhost:9002 to see the application.

πŸ“± Application Structure

src/
β”œβ”€β”€ app/                    # Next.js App Router pages
β”‚   β”œβ”€β”€ ai-prescriptions/   # AI prescription generator
β”‚   β”œβ”€β”€ appointments/       # Appointment management
β”‚   β”œβ”€β”€ billing/           # Billing and payments
β”‚   β”œβ”€β”€ dashboard/         # Main dashboard
β”‚   β”œβ”€β”€ doctor-data/       # Doctor management
β”‚   β”œβ”€β”€ medical-records/   # Patient medical records
β”‚   β”œβ”€β”€ patient-data/      # Patient management
β”‚   β”œβ”€β”€ search-records/    # Record search functionality
β”‚   └── specialist-finder/ # AI specialist finder
β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ layout/           # Layout components
β”‚   └── ui/               # Reusable UI components
β”œβ”€β”€ ai/
β”‚   └── flows/           # AI workflow definitions
β”œβ”€β”€ hooks/               # Custom React hooks
└── lib/                # Utility functions

System Architecture

flowchart TD
    A[User Opens HMS Web App] --> B[Frontend Interface]
    
    B --> C[Login and Registration Module]
    C --> D[Firebase Authentication]
    
    D --> E[Role Based Access Control]
    
    E --> F[Admin Dashboard]
    E --> G[Doctor Dashboard]
    E --> H[Patient Dashboard]
    
    F --> I[Manage Doctors Patients Staff]
    G --> J[View Appointments and Records]
    H --> K[Book Appointments and View Reports]
    
    I --> L[Application Service Layer]
    J --> L
    K --> L
    
    L --> M[Firebase Firestore Database]
    M --> N[Patient Records Collection]
    M --> O[Doctor Data Collection]
    M --> P[Appointments Collection]
    
    M --> Q[Real Time Data Sync]
    Q --> R[Frontend Visualization and UI Updates]
Loading

🎯 Key Features Deep Dive

πŸ₯ Dashboard Analytics

  • Real-time patient statistics
  • Appointment tracking and trends
  • Revenue analytics in Indian Rupees (β‚Ή)
  • Interactive charts and visualizations

πŸ€– AI Specialist Finder

// Example usage
const recommendation = await findSpecialist({
  symptoms: "chest pain, shortness of breath",
  urgency: "high"
});

πŸ’Š AI Prescription Generator

// Generate prescriptions automatically
const prescription = await generatePrescription({
  name: "Patient Name",
  diagnosis: "Hypertension"
});

πŸ‘₯ Role-Based Access

  • Admin: Full system access and management
  • Doctor: Patient records, prescriptions, appointments
  • Nurse: Patient care, basic record updates
  • Patient: Personal records, appointment booking

🎨 Design System

Color Palette

  • Primary: Teal (#008080) - Trust and health
  • Secondary: Light Gray (#F0F0F0) - Clean backgrounds
  • Accent: Blue (#007BFF) - Interactive elements
  • Success: Green (#28A745)
  • Warning: Orange (#FFC107)
  • Error: Red (#DC3545)

Typography

  • Font: Inter - Clean, modern sans-serif
  • Heading Scale: rem-based scaling
  • Body Text: Optimized for readability

πŸ“Š Development Scripts

# Development
npm run dev              # Start development server with Turbopack
npm run genkit:dev       # Start AI development environment
npm run genkit:watch     # Watch mode for AI flows

# Production
npm run build            # Build for production
npm run start            # Start production server

# Quality
npm run lint             # Run ESLint
npm run typecheck        # TypeScript type checking

πŸ”§ Configuration

Next.js Configuration

  • Turbopack: Enabled for faster development builds
  • TypeScript: Strict mode enabled
  • Image Optimization: Configured for external sources
  • Port: 9002 (customizable)

Tailwind CSS

  • Custom color schemes: Hospital-themed palette
  • Component library: shadcn/ui integration
  • Responsive design: Mobile-first approach
  • Dark mode: Class-based toggle support

🚦 API Endpoints

AI Flows

  • /api/ai/specialist-finder - Get doctor recommendations
  • /api/ai/prescriptions - Generate prescriptions
  • /api/ai/hospital-guide - Chat assistant

Data Management

  • /api/patients - Patient CRUD operations
  • /api/doctors - Doctor management
  • /api/appointments - Appointment scheduling
  • /api/billing - Financial operations

πŸ§ͺ Testing

# Run tests
npm test

# Run tests in watch mode
npm run test:watch

# Generate coverage report
npm run test:coverage

πŸš€ Deployment

Vercel (Recommended)

  1. Push to GitHub
  2. Connect repository to Vercel
  3. Configure environment variables
  4. Deploy automatically

Docker

# Build stage
FROM node:18-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build

# Production stage
FROM node:18-alpine AS runner
WORKDIR /app
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package.json ./package.json

EXPOSE 3000
CMD ["npm", "start"]

πŸ“ˆ Performance

  • Core Web Vitals: Optimized for excellent scores
  • Bundle Size: Minimized with tree shaking
  • Image Optimization: Next.js automatic optimization
  • Caching Strategy: Aggressive caching for static assets

πŸ”’ Security

  • Authentication: Firebase Auth integration
  • Data Validation: Zod schema validation
  • API Security: Rate limiting and input sanitization
  • HIPAA Compliance: Privacy-first design principles

Code Standards

  • ESLint: Follow the configured rules
  • Prettier: Code formatting
  • TypeScript: Strict type checking
  • Conventional Commits: For clear commit history

About

It is a full-stack healthcare web app that manages patients, appointments, and hospital records using Firebase for real-time database, authentication, and cloud data management.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages