- About
- Features
- Technology Stack
- Project Structure
- Prerequisites
- Installation
- Configuration
- Usage
- API Documentation
- Screenshots
- Contributing
- License
HealthX is a comprehensive doctor appointment management system built with the MERN stack. It provides a seamless experience for patients to book appointments with doctors, while offering powerful administrative tools for healthcare providers to manage their practice efficiently.
- Patient Portal: Easy appointment booking and management
- Doctor Management: Complete doctor profile management
- Admin Dashboard: Comprehensive administrative controls
- Real-time Updates: Instant appointment status updates
- Responsive Design: Optimized for all devices
- Secure Authentication: JWT-based secure login system
- β User registration and secure login
- β Browse doctors by specialty
- β View detailed doctor profiles
- β Book appointments with preferred doctors
- β Manage personal profile
- β View appointment history
- β Cancel appointments
- β Real-time appointment status updates
- β Secure admin authentication
- β Add new doctors to the system
- β Manage doctor profiles and availability
- β View all appointments
- β Cancel appointments
- β Dashboard with analytics
- β Patient management
- β System-wide settings
- β Doctor profile management
- β Availability status control
- β Appointment scheduling
- β Patient information access
- React.js 18.3.1 - Modern UI library
- Vite 5.4.1 - Fast build tool and development server
- React Router 6.26.2 - Client-side routing
- Tailwind CSS 3.4.11 - Utility-first CSS framework
- Axios 1.7.7 - HTTP client for API calls
- React Toastify 10.0.5 - Elegant notifications
- Node.js - JavaScript runtime environment
- Express.js 4.21.0 - Web application framework
- MongoDB 8.7.0 - NoSQL database with Mongoose ODM
- JWT 9.0.2 - JSON Web Tokens for authentication
- Bcrypt 5.1.1 - Password hashing
- Cloudinary 2.5.0 - Image upload and management
- Multer 1.4.5 - File upload middleware
- CORS 2.8.5 - Cross-origin resource sharing
- ESLint - Code linting and formatting
- PostCSS - CSS post-processing
- Autoprefixer - CSS vendor prefixing
- Nodemon - Development server auto-restart
HealthX/
βββ backend/ # Backend API server
β βββ config/ # Database and service configurations
β β βββ cloudinary.js # Cloudinary setup
β β βββ mongodb.js # MongoDB connection
β βββ controllers/ # Business logic controllers
β β βββ adminController.js
β β βββ doctorController.js
β β βββ userController.js
β βββ middlewares/ # Custom middleware functions
β β βββ authAdmin.js # Admin authentication
β β βββ authUser.js # User authentication
β β βββ multer.js # File upload configuration
β βββ models/ # Database models/schemas
β β βββ appointmentModel.js
β β βββ doctorModel.js
β β βββ userModel.js
β βββ routes/ # API route definitions
β β βββ adminRoute.js
β β βββ doctorRoute.js
β β βββ userRoute.js
β βββ .env # Environment variables
β βββ package.json # Backend dependencies
β βββ server.js # Main server file
β
βββ frontend/ # Patient-facing React application
β βββ src/
β β βββ assets/ # Static assets and sample data
β β βββ components/ # Reusable React components
β β β βββ Banner.jsx
β β β βββ Footer.jsx
β β β βββ Header.jsx
β β β βββ Navbar.jsx
β β β βββ RelatedDoctor.jsx
β β β βββ SpecialityMenu.jsx
β β β βββ TopDoctors.jsx
β β βββ context/ # React Context for state management
β β β βββ AppContext.jsx
β β βββ pages/ # Page components
β β β βββ About.jsx
β β β βββ Appointment.jsx
β β β βββ Contact.jsx
β β β βββ Doctors.jsx
β β β βββ Home.jsx
β β β βββ Login.jsx
β β β βββ MyAppointments.jsx
β β β βββ MyProfile.jsx
β β βββ App.jsx # Main App component
β β βββ main.jsx # Application entry point
β βββ .env # Frontend environment variables
β βββ index.html # HTML template
β βββ package.json # Frontend dependencies
β βββ tailwind.config.js # Tailwind CSS configuration
β
βββ admin/ # Admin panel React application
βββ src/
β βββ assets/ # Admin-specific assets
β βββ components/ # Admin UI components
β β βββ Navbar.jsx
β β βββ Sidebar.jsx
β βββ context/ # Admin context providers
β β βββ AdminContext.jsx
β β βββ AppContext.jsx
β β βββ DoctorContext.jsx
β βββ pages/ # Admin page components
β β βββ Login.jsx
β β βββ Admin/
β β βββ AddDoctor.jsx
β β βββ AllAppointments.jsx
β β βββ Dashboard.jsx
β β βββ DoctorsList.jsx
β βββ App.jsx # Admin App component
β βββ main.jsx # Admin entry point
βββ .env # Admin environment variables
βββ package.json # Admin dependencies
βββ tailwind.config.js # Admin Tailwind configuration
Before running this project, make sure you have the following installed:
- Node.js (v16.0.0 or higher)
- npm (v8.0.0 or higher)
- MongoDB (local installation or MongoDB Atlas account)
- Git (for cloning the repository)
git clone https://github.com/Akcthecoder200/HealthX.git
cd HealthX# Navigate to backend directory
cd backend
# Install dependencies
npm install
# Create environment file
cp .env.example .env
# Edit .env with your configuration (see Configuration section)
# Start the backend server
npm run start
# or for development with auto-restart
npm run server# Navigate to frontend directory
cd ../frontend
# Install dependencies
npm install
# Create environment file
echo "VITE_BACKEND_URL=http://localhost:4000" > .env
# Start the frontend development server
npm run dev# Navigate to admin directory
cd ../admin
# Install dependencies
npm install
# Create environment file
echo "VITE_BACKEND_URL=http://localhost:4000" > .env
# Start the admin development server
npm run dev# MongoDB Connection
MONGODB_URI=mongodb+srv://username:[email protected]
# Cloudinary Configuration (for image uploads)
CLOUDINARY_NAME=your_cloudinary_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_SECRET_KEY=your_secret_key
# JWT Secret (use a strong random string)
JWT_SECRET=your_jwt_secret_key
# Admin Credentials
ADMIN_EMAIL=[email protected]
ADMIN_PASSWORD=your_admin_password
# Server Port
PORT=4000# Backend API URL
VITE_BACKEND_URL=http://localhost:4000# Backend API URL
VITE_BACKEND_URL=http://localhost:4000- Patient Portal: http://localhost:5173
- Admin Panel: http://localhost:5174
- Backend API: http://localhost:4000
- Email: [email protected]
- Password: your_admin_password (as set in backend .env)
The system includes sample doctors in the following specialties:
- General Physician
- Gynecologist
- Dermatologist
- Pediatricians
- Neurologist
- Gastroenterologist
POST /api/user/register
Content-Type: application/json
{
"name": "John Doe",
"email": "[email protected]",
"password": "password123"
}POST /api/user/login
Content-Type: application/json
{
"email": "[email protected]",
"password": "password123"
}POST /api/admin/login
Content-Type: application/json
{
"email": "[email protected]",
"password": "admin_password"
}GET /api/doctor/listPOST /api/admin/add-doctor
Authorization: Bearer admin_token
Content-Type: multipart/form-data
{
"name": "Dr. John Smith",
"email": "[email protected]",
"password": "doctorpass",
"speciality": "General physician",
"degree": "MBBS",
"experience": "5 Years",
"about": "Experienced doctor...",
"fees": 100,
"address": {
"line1": "123 Main St",
"line2": "City, State"
},
"image": "doctor_image.jpg"
}POST /api/user/book-appointment
Authorization: Bearer user_token
Content-Type: application/json
{
"docId": "doctor_id",
"slotDate": "2024-01-15",
"slotTime": "10:00 AM"
}GET /api/user/appointments
Authorization: Bearer user_tokenPOST /api/user/cancel-appointment
Authorization: Bearer user_token
Content-Type: application/json
{
"appointmentId": "appointment_id"
}- JWT Authentication: Secure token-based authentication
- Password Hashing: Bcrypt encryption for password security
- Input Validation: Server-side validation for all inputs
- CORS Protection: Configured cross-origin resource sharing
- File Upload Security: Secure image upload with Cloudinary
- Admin Authorization: Protected admin routes and functions
- Responsive Design: Mobile-first responsive design
- Modern UI: Clean and intuitive user interface
- Loading States: Proper loading indicators
- Error Handling: User-friendly error messages
- Toast Notifications: Real-time feedback system
- Form Validation: Client-side and server-side validation
- Image Optimization: Optimized image loading and caching
npm start # Start production server
npm run server # Start development server with nodemonnpm run dev # Start development server
npm run build # Build for production
npm run preview # Preview production build
npm run lint # Run ESLintnpm run dev # Start development server
npm run build # Build for production
npm run preview # Preview production build
npm run lint # Run ESLint{
name: String (required),
email: String (required, unique),
password: String (required),
image: String (default: placeholder),
address: Object,
gender: String,
dob: String,
phone: String
}{
name: String (required),
email: String (required, unique),
password: String (required),
image: String (required),
speciality: String (required),
degree: String (required),
experience: String (required),
about: String (required),
available: Boolean (default: true),
fees: Number (required),
address: Object (required),
date: Number (required),
slots_booked: Object (default: {})
}{
userId: ObjectId (required),
docId: ObjectId (required),
slotDate: String (required),
slotTime: String (required),
userData: Object (required),
docData: Object (required),
amount: Number (required),
date: Number (required),
cancelled: Boolean (default: false),
payment: Boolean (default: false),
isCompleted: Boolean (default: false)
}- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Akcthecoder200 - Initial work - GitHub
- React.js community for excellent documentation
- MongoDB team for the robust database solution
- Tailwind CSS for the utility-first CSS framework
- Cloudinary for image management services
- All contributors who helped in making this project better
If you have any questions or need help with setup, please:
- Check the Issues page
- Create a new issue if your problem isn't already listed
- Contact the maintainer through GitHub
Made with β€οΈ for better healthcare management