# Hospital Management System - Quick Start Guide

## Prerequisites
1. **Node.js** (v14 or higher) - Download from https://nodejs.org/
2. **MongoDB** - Either:
   - Install MongoDB locally from https://www.mongodb.com/try/download/community
   - Or use MongoDB Atlas (cloud) - https://www.mongodb.com/cloud/atlas

## Quick Start Commands

### Step 1: Install Backend Dependencies
Open a terminal/command prompt and run:
```
bash
cd C:\Users\DIGITAL AXIS\Desktop\HMS\backend
npm install
```

### Step 2: Install Frontend Dependencies
Open a new terminal and run:
```
bash
cd C:\Users\DIGITAL AXIS\Desktop\HMS\frontend
npm install
```

### Step 3: Start MongoDB
Make sure MongoDB is running:
```
bash
# If installed locally
mongod
```

### Step 4: Start Backend Server
In the backend terminal:
```
bash
npm start
```
Backend will run on http://localhost:5000

### Step 5: Start Frontend
In the frontend terminal:
```
bash
npm run dev
```
Frontend will run on http://localhost:3000

## Login Credentials
- **Email**: admin@hms.com
- **Password**: admin123

## Features
- ✅ User Login (JWT Authentication)
- ✅ Dashboard with Statistics
- ✅ Patient Management (Add/Edit/Delete/Search)
- ✅ Doctor Management (Add/Edit/Delete/Search)
- ✅ Appointment Management (Create/Update/Delete/Status)
- ✅ Reports with Statistics

## Troubleshooting

### If npm install fails
Try running PowerShell as Administrator and execute:
```
powershell
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
```

### If MongoDB connection fails
Make sure MongoDB is running or update the connection string in `backend/.env`:
```
MONGO_URI=mongodb://localhost:27017/hospital_management
```

### If frontend shows connection errors
The frontend is configured to proxy API requests to the backend. Make sure both servers are running.
