HEAD
A full-stack web application for managing doctor-patient appointments with role-based access control, medical records management, and real-time appointment tracking.
- Registration & Authentication: Secure patient registration and login
- Appointment Booking: Book appointments with available doctors
- Appointment Management: View, cancel, and reschedule appointments
- Medical Profile: Manage personal information and medical details
- Vitals Tracking: Update and track health vitals (weight, height, heart rate)
- Medical History: View personal medical records and prescriptions
- Secure Login: Doctor authentication with specialized credentials
- Appointment Management: Accept, reject, reschedule, and complete appointments
- Patient Records: View and update patient medical records
- Prescription Management: Create and manage patient prescriptions
- Vitals Monitoring: Track and update patient vitals
- Medical History: Comprehensive patient medical history management
- React 18 with Vite for fast development
- Material-UI (MUI) for modern, responsive UI components
- React Router for client-side routing
- React Query for server state management
- React Hook Form for form handling
- Notistack for notifications
- Recharts for data visualization
- Node.js with Express.js framework
- MongoDB with Mongoose ODM
- JWT for authentication and authorization
- bcryptjs for password hashing
- Express Validator for input validation
- Helmet for security headers
- CORS for cross-origin requests
- Rate Limiting for API protection
DR_DESAI_FINAL_WEBSITE/
├── client/ # React Frontend
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ ├── pages/ # Page components
│ │ ├── context/ # Authentication context
│ │ ├── services/ # API services
│ │ └── utils/ # Utility functions
│ ├── public/ # Static assets
│ └── package.json # Frontend dependencies
├── server/ # Node.js Backend
│ ├── controllers/ # Route controllers
│ ├── models/ # Mongoose models
│ ├── middleware/ # Authentication middleware
│ ├── routes/ # API routes
│ ├── config/ # Database configuration
│ └── package.json # Backend dependencies
└── README.md # Project documentation
- Node.js (v16 or higher)
- MongoDB (local or cloud instance)
- npm or yarn package manager
-
Clone the repository
git clone <repository-url> cd DR_DESAI_FINAL_WEBSITE
-
Install dependencies
# Install root dependencies npm install # Install server dependencies cd server npm install # Install client dependencies cd ../client npm install
-
Environment Setup
Create a
.envfile in the server directory:PORT=5000 MONGODB_URI=mongodb://localhost:27017/dr_desai_appointments JWT_SECRET=your_super_secret_jwt_key_here NODE_ENV=development
-
Start the application
# From the root directory npm run devThis will start both the backend server (port 5000) and frontend development server (port 3000).
POST /api/auth/register- User registrationPOST /api/auth/login- User loginGET /api/auth/me- Get current user profilePUT /api/auth/profile- Update user profile
GET /api/appointments/doctors- Get available doctorsPOST /api/appointments- Book appointment (Patient only)GET /api/appointments- Get user appointmentsGET /api/appointments/:id- Get specific appointmentPUT /api/appointments/:id/status- Update appointment status (Doctor only)PUT /api/appointments/:id/reschedule- Reschedule appointmentDELETE /api/appointments/:id- Cancel appointment
POST /api/medical-records- Create medical record (Doctor only)GET /api/medical-records/patient/:patientId- Get patient medical recordsGET /api/medical-records/:id- Get specific medical recordPUT /api/medical-records/:id- Update medical record (Doctor only)PUT /api/medical-records/vitals/:patientId- Update patient vitalsGET /api/medical-records/vitals/:patientId- Get vitals historyDELETE /api/medical-records/:id- Delete medical record (Doctor only)
{
"userId": "user_id_here",
"iat": "issued_at_timestamp",
"exp": "expiration_timestamp"
}- Patient Role: Can book appointments, view own records, update vitals
- Doctor Role: Can manage appointments, create/update medical records, view patient data
{
name: String,
email: String (unique),
password: String (hashed),
role: String (enum: ['doctor', 'patient']),
phone: String,
// Doctor specific fields
specialization: String,
licenseNumber: String,
experience: Number,
// Patient specific fields
age: Number,
gender: String,
address: String,
emergencyContact: Object
}{
patient: ObjectId (ref: User),
doctor: ObjectId (ref: User),
date: Date,
time: String,
status: String (enum: ['pending', 'accepted', 'rejected', 'completed', 'cancelled']),
reason: String,
symptoms: String,
notes: String,
prescription: String,
followUpDate: Date
}{
patient: ObjectId (ref: User),
doctor: ObjectId (ref: User),
appointment: ObjectId (ref: Appointment),
vitals: {
weight: { value: Number, unit: String, date: Date },
height: { value: Number, unit: String, date: Date },
heartRate: { value: Number, unit: String, date: Date },
bloodPressure: { systolic: Number, diastolic: Number, date: Date },
temperature: { value: Number, unit: String, date: Date }
},
diagnosis: String,
symptoms: [String],
prescription: {
medications: [Object],
notes: String
},
treatment: String,
followUp: Object,
allergies: [String],
medicalHistory: [Object],
notes: String
}- Material-UI Theme: Custom medical-themed color palette
- Responsive Design: Mobile-first approach with breakpoint optimization
- Accessibility: WCAG compliant components and navigation
- Loading States: Skeleton screens and progress indicators
- Error Handling: User-friendly error messages and validation
- Navigation: Responsive sidebar with role-based menu items
- Forms: Validated input fields with real-time feedback
- Tables: Sortable and filterable data tables
- Cards: Information display with action buttons
- Modals: Confirmation dialogs and form overlays
Root Directory:
npm run dev- Start both client and server in development modenpm run server- Start only the backend servernpm run client- Start only the frontend development servernpm run build- Build the frontend for productionnpm run install-all- Install all dependencies
Server Directory:
npm run dev- Start server with nodemonnpm start- Start server in production mode
Client Directory:
npm run dev- Start Vite development servernpm run build- Build for productionnpm run preview- Preview production build
- ESLint configuration for code linting
- Prettier for code formatting
- React Query for efficient data fetching
- Error boundaries for graceful error handling
- Set environment variables for production
- Build the application:
npm run build - Deploy to your preferred hosting service (Heroku, AWS, etc.)
- Build the application:
npm run build - Deploy the
distfolder to your hosting service - Configure proxy settings for API calls
- Set up MongoDB instance (local or cloud)
- Configure connection string in environment variables
- Set up database indexes for optimal performance
- JWT Authentication: Secure token-based authentication
- Password Hashing: bcryptjs for password security
- Input Validation: Server-side validation with express-validator
- Rate Limiting: API protection against abuse
- CORS Configuration: Secure cross-origin requests
- Helmet Security: HTTP security headers
- Environment Variables: Secure configuration management
- React Query: Efficient caching and background updates
- MongoDB Indexing: Optimized database queries
- Code Splitting: Lazy loading of components
- Image Optimization: Compressed assets and lazy loading
- Bundle Optimization: Tree shaking and code splitting
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License.
For support and questions, please contact the development team or create an issue in the repository.
Dr. Desai Appointment Booking System - Modern healthcare management solution for efficient doctor-patient interactions.