A comprehensive full-stack healthcare appointment booking system built with React (Next.js) frontend and Node.js/Express backend with MongoDB database.
- User Registration & Authentication - Secure signup/login with email verification
- Social Login - Google and Facebook authentication
- Doctor Search & Discovery - Find doctors by specialty, location, rating
- Appointment Booking - Schedule in-person or video consultations
- Appointment Management - View, reschedule, or cancel appointments
- Health Records - Manage medical history, allergies, medications
- Notifications - Email and in-app notifications for appointments
- Payment Integration - Secure payment processing
- Rating & Reviews - Rate doctors and appointments
- Professional Profile - Detailed doctor profiles with credentials
- Availability Management - Set working hours and available time slots
- Appointment Management - View and manage patient appointments
- Patient Records - Access patient medical history during consultations
- Video Consultations - Conduct online appointments
- Prescription Management - Digital prescription generation
- User Management - Manage patients and doctors
- Appointment Oversight - Monitor all appointments
- Analytics Dashboard - System usage and performance metrics
- Content Management - Manage specialties, locations, etc.
- Framework: Next.js 15 (React 19)
- Styling: Tailwind CSS
- UI Components: Radix UI
- State Management: React Hooks + Context
- HTTP Client: Axios
- Form Handling: React Hook Form
- Validation: Zod
- Icons: Lucide React
- Runtime: Node.js
- Framework: Express.js
- Database: MongoDB with Mongoose ODM
- Authentication: JWT + Refresh Tokens
- Password Hashing: bcryptjs
- Email Service: Nodemailer
- File Upload: Multer + Cloudinary
- Validation: Express Validator
- Security: Helmet, CORS, Rate Limiting
- Development: Nodemon, Concurrently
- Testing: Jest, Supertest
- Linting: ESLint
- Environment: dotenv
- Process Management: PM2 (production)
healthcare-appointment-system/
βββ frontend/ # Next.js React frontend
β βββ app/ # Next.js app directory
β βββ components/ # Reusable UI components
β βββ lib/ # Utilities and API calls
β βββ hooks/ # Custom React hooks
β βββ styles/ # Global styles
β βββ public/ # Static assets
βββ backend/ # Node.js Express backend
β βββ src/
β β βββ controllers/ # Route controllers
β β βββ models/ # MongoDB models
β β βββ routes/ # API routes
β β βββ middleware/ # Custom middleware
β β βββ config/ # Configuration files
β β βββ utils/ # Utility functions
β β βββ database/ # Database setup and migrations
β βββ .env.example # Environment variables template
βββ README.md
- Node.js (v18 or higher)
- MongoDB (local or MongoDB Atlas)
- npm or yarn package manager
- Clone the repository
git clone <repository-url>
cd healthcare-appointment-system- Install dependencies for all packages
npm run install:all- Set up environment variables
Backend (.env):
cd backend
cp .env.example .env
# Edit .env with your configurationFrontend (.env.local):
cd frontend
cp .env.local.example .env.local
# Edit .env.local with your configuration- Set up the database
cd backend
npm run setup:db- Start the development servers
# From root directory
npm run devThis will start:
- Backend API server on http://localhost:5000
- Frontend development server on http://localhost:3000
# Server Configuration
NODE_ENV=development
PORT=5000
API_VERSION=v1
# Database
MONGODB_URI=mongodb://localhost:27017/healthcare_db
# JWT
JWT_SECRET=your_super_secret_jwt_key_here
JWT_EXPIRE=7d
JWT_REFRESH_SECRET=your_refresh_token_secret_here
JWT_REFRESH_EXPIRE=30d
# Email Configuration
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_USER=your-email@gmail.com
EMAIL_PASS=your-app-password
EMAIL_FROM=noreply@healthcare.com
# Social Authentication
GOOGLE_CLIENT_ID=your_google_client_id_here
GOOGLE_CLIENT_SECRET=your_google_client_secret_here
FACEBOOK_APP_ID=your_facebook_app_id_here
FACEBOOK_APP_SECRET=your_facebook_app_secret_here
# File Upload (Cloudinary)
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret
# Frontend URL
FRONTEND_URL=http://localhost:3000# API Configuration
NEXT_PUBLIC_API_URL=http://localhost:5000/api
NEXT_PUBLIC_FRONTEND_URL=http://localhost:3000
# Social Authentication
NEXT_PUBLIC_GOOGLE_CLIENT_ID=your_google_client_id_here
NEXT_PUBLIC_FACEBOOK_APP_ID=your_facebook_app_id_here-
Local MongoDB:
- Install MongoDB locally
- Start MongoDB service
- Create database:
healthcare_db
-
MongoDB Atlas (Cloud):
- Create account at MongoDB Atlas
- Create cluster and database
- Get connection string
- Update
MONGODB_URIin backend.env
-
Initialize Database:
cd backend
npm run setup:db # Creates indexes and initial data
npm run seed # Optional: Add sample data- Go to Google Cloud Console
- Create new project or select existing
- Enable Google+ API
- Create OAuth 2.0 credentials
- Add authorized origins and redirect URIs
- Copy Client ID to environment variables
- Go to Facebook Developers
- Create new app
- Add Facebook Login product
- Configure Valid OAuth Redirect URIs
- Copy App ID to environment variables
- Enable 2-factor authentication
- Generate app-specific password
- Use app password in
EMAIL_PASS
Update SMTP settings in backend .env:
EMAIL_HOST: SMTP serverEMAIL_PORT: SMTP portEMAIL_USER: Email usernameEMAIL_PASS: Email password
- Prepare for production:
cd backend
npm run build # If you have a build script-
Environment variables:
- Set
NODE_ENV=production - Update database URI for production
- Set secure JWT secrets
- Configure production email settings
- Set
-
Deploy to platforms:
- Heroku: Use Heroku CLI
- DigitalOcean: Use App Platform
- AWS: Use Elastic Beanstalk or EC2
- Railway: Connect GitHub repository
- Build for production:
cd frontend
npm run build- Deploy to platforms:
- Vercel:
vercel --prod - Netlify: Connect GitHub repository
- AWS S3: Upload build files
- DigitalOcean: Use App Platform
- Vercel:
cd backend
npm test # Run all tests
npm test -- --watch # Run tests in watch mode
npm test -- --coverage # Run tests with coveragecd frontend
npm test # Run component tests
npm run test:e2e # Run end-to-end testsPOST /api/auth/register- User registrationPOST /api/auth/login- User loginPOST /api/auth/social-login- Social authenticationPOST /api/auth/logout- User logoutPOST /api/auth/forgot-password- Password reset requestPATCH /api/auth/reset-password/:token- Reset passwordGET /api/auth/verify-email/:token- Email verification
GET /api/users/profile- Get user profilePUT /api/users/profile- Update user profilePOST /api/users/upload-avatar- Upload profile picturePATCH /api/users/change-password- Change password
GET /api/doctors- Get all doctorsGET /api/doctors/:id- Get doctor by IDGET /api/doctors/search- Search doctorsGET /api/doctors/specialty/:specialty- Get doctors by specialty
POST /api/appointments- Book appointmentGET /api/appointments- Get user appointmentsGET /api/appointments/:id- Get appointment detailsPUT /api/appointments/:id- Update appointmentPATCH /api/appointments/:id/cancel- Cancel appointment
- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Create an issue in the repository
- Email: support@healthcare-plus.com
- Documentation: Project Wiki
- Next.js - React framework
- Express.js - Backend framework
- MongoDB - Database
- Tailwind CSS - Styling
- Radix UI - UI components
Built with β€οΈ for better healthcare accessibility