A full-stack healthcare appointment booking and management platform built with the MERN stack (MongoDB, Express.js, React, Node.js).
- Features
- Tech Stack
- Prerequisites
- Installation
- Environment Setup
- Running the Application
- Troubleshooting
- Project Structure
- API Endpoints
- 👤 User registration and authentication
- 🔍 Browse and search doctors by speciality
- 📅 Book appointments with available time slots
- 💳 Online payment integration (Stripe & Razorpay)
- 📋 View and manage appointments
- 👨⚕️ View doctor profiles and specialities
- 💊 Medicine reminder system (set, view, and delete reminders)
- 🤖 AI Tools (coming soon - disease prediction & diagnosis)
- 🏥 Add and manage doctors
- 📊 Dashboard with analytics
- 📋 View all appointments
- ❌ Cancel appointments
- 👥 Manage doctor availability
- 📅 View assigned appointments
- ✅ Mark appointments as complete
- 💰 Track earnings
- 📊 Personal dashboard
- 🔄 Toggle availability status
Frontend:
- React 18.3
- React Router DOM 6.25
- Axios
- Tailwind CSS
- Vite
Backend:
- Node.js
- Express.js
- MongoDB (Atlas)
- Mongoose
- JWT Authentication
- Bcrypt for password hashing
Cloud Services:
- MongoDB Atlas (Database)
- Cloudinary (Image Storage)
- Stripe (Payment Gateway)
- Razorpay (Payment Gateway)
Before you begin, ensure you have the following installed:
- Node.js (v16 or higher) - Download
- npm (comes with Node.js)
- Git - Download
- MongoDB Atlas Account - Sign up
- Cloudinary Account - Sign up
# Check Node.js version
node --version
# Check npm version
npm --versiongit clone <your-repository-url>
cd prescripto-full-stackInstall Backend Dependencies:
cd backend
npm installInstall Frontend Dependencies:
cd ../frontend
npm installInstall Admin Panel Dependencies:
cd ../admin
npm install- Navigate to the
backendfolder - The
.envfile should already exist with the following structure:
# Currency
CURRENCY = "INR"
# JWT Secret (use a strong random string)
JWT_SECRET="your_jwt_secret_here"
# Admin Panel Credentials
ADMIN_EMAIL = "admin@example.com"
ADMIN_PASSWORD = "your_admin_password"
# MongoDB Atlas Setup (REQUIRED)
MONGODB_URI = "mongodb+srv://username:password@cluster.mongodb.net"
# Cloudinary Setup (REQUIRED)
CLOUDINARY_NAME = "your_cloudinary_cloud_name"
CLOUDINARY_API_KEY = "your_cloudinary_api_key"
CLOUDINARY_SECRET_KEY = "your_cloudinary_secret_key"
# Payment Gateway - Razorpay (Optional)
RAZORPAY_KEY_ID = "your_razorpay_key_id"
RAZORPAY_KEY_SECRET = "your_razorpay_key_secret"
# Payment Gateway - Stripe (Optional)
STRIPE_SECRET_KEY = "your_stripe_secret_key"Important: Replace the placeholder values with your actual credentials!
- Navigate to the
frontendfolder - The
.envfile should contain:
VITE_BACKEND_URL = 'http://localhost:4000'
VITE_RAZORPAY_KEY_ID = 'your_razorpay_key_id'- Navigate to the
adminfolder - Create a
.envfile with:
VITE_BACKEND_URL = 'http://localhost:4000'Open a new terminal and run:
cd backend
node server.jsExpected Output:
✅ Database Connected Successfully
📍 Database: remedi (MongoDB Atlas)
✅ Cloudinary Connected Successfully
🚀 Server started successfully on PORT: 4000
📡 API URL: http://localhost:4000
💚 All systems ready!
Keep this terminal running!
Open a new terminal and run:
cd frontend
npm run devExpected Output:
VITE v5.x.x ready in xxx ms
➜ Local: http://localhost:5173/
➜ Network: use --host to expose
Access: Open your browser and go to http://localhost:5173/
Open a new terminal and run:
cd admin
npm run devExpected Output:
VITE v5.x.x ready in xxx ms
➜ Local: http://localhost:5174/
➜ Network: use --host to expose
Access: Open your browser and go to http://localhost:5174/
Login with:
- Email: The
ADMIN_EMAILfrom your backend.env - Password: The
ADMIN_PASSWORDfrom your backend.env
Problem: Cannot find module or MONGODB_URI is not defined
Solution:
- Check that you're in the
backendfolder - Verify
.envfile exists inbackendfolder - Ensure all environment variables are set correctly
- Check MongoDB Atlas connection string is valid
Problem: Page doesn't load or shows errors
Solution:
# Clear localStorage
# Open browser console (F12) and run:
localStorage.clear()
# Then refresh the pageProblem: Button flickers and returns to home page
Solution:
// Open browser console (F12) and run:
localStorage.clear()
// Then refresh the pageProblem: Error when trying to add a doctor
Solution:
- Verify Cloudinary credentials in backend
.env - Ensure image file is selected
- Check that backend server is running
- Verify you're logged in as admin
Problem: Failed to connect to MongoDB Atlas
Solutions:
-
Check IP Whitelist:
- Go to MongoDB Atlas Dashboard
- Network Access → Add IP Address
- Click "Allow Access from Anywhere" (for development)
-
Check Connection String:
- Ensure no spaces in MONGODB_URI
- Verify username and password are correct
- Don't use
@symbol in password (causes issues)
-
Check Database User:
- Go to Database Access in MongoDB Atlas
- Ensure user has read/write permissions
Problem: EADDRINUSE: address already in use :::4000
Solution (Windows PowerShell):
# Find and kill the process using port 4000
Get-Process -Id (Get-NetTCPConnection -LocalPort 4000).OwningProcess | Stop-Process -ForceSolution (Mac/Linux):
# Find and kill the process using port 4000
lsof -ti:4000 | xargs kill -9Problem: running scripts is disabled on this system
Solution:
# Run PowerShell as Administrator and execute:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
# Then try running npm commands againprescripto-full-stack/
│
├── backend/ # Backend API Server
│ ├── config/ # Configuration files
│ │ ├── mongodb.js # MongoDB connection
│ │ └── cloudinary.js # Cloudinary configuration
│ ├── controllers/ # Request handlers
│ │ ├── adminController.js
│ │ ├── doctorController.js
│ │ ├── userController.js
│ │ └── reminderController.js
│ ├── middleware/ # Custom middleware
│ │ ├── authAdmin.js
│ │ ├── authDoctor.js
│ │ ├── authUser.js
│ │ └── multer.js
│ ├── models/ # Database schemas
│ │ ├── doctorModel.js
│ │ ├── userModel.js
│ │ ├── appointmentModel.js
│ │ └── reminderModel.js
│ ├── routes/ # API routes
│ │ ├── adminRoute.js
│ │ ├── doctorRoute.js
│ │ ├── userRoute.js
│ │ └── reminderRoute.js
│ ├── .env # Environment variables (DO NOT COMMIT)
│ ├── server.js # Entry point
│ └── package.json
│
├── frontend/ # User-facing application
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── pages/ # Page components
│ │ ├── context/ # React Context
│ │ ├── assets/ # Images, icons
│ │ └── App.jsx # Main app component
│ ├── .env # Frontend environment variables
│ └── package.json
│
├── admin/ # Admin panel
│ ├── src/
│ │ ├── components/ # Admin components
│ │ ├── pages/ # Admin pages
│ │ ├── context/ # Admin context
│ │ └── App.jsx
│ ├── .env # Admin environment variables
│ └── package.json
│
└── README.md # This file
POST /register- Register new userPOST /login- User loginGET /get-profile- Get user profilePOST /update-profile- Update user profilePOST /book-appointment- Book an appointmentGET /appointments- Get user appointmentsPOST /cancel-appointment- Cancel appointmentPOST /payment-stripe- Stripe paymentPOST /payment-razorpay- Razorpay payment
POST /login- Admin loginPOST /add-doctor- Add new doctorGET /all-doctors- Get all doctorsGET /appointments- Get all appointmentsPOST /cancel-appointment- Cancel appointmentPOST /change-availability- Change doctor availabilityGET /dashboard- Admin dashboard data
POST /login- Doctor loginGET /appointments- Get doctor appointmentsPOST /complete-appointment- Mark appointment completePOST /cancel-appointment- Cancel appointmentGET /dashboard- Doctor dashboardGET /profile- Get doctor profilePOST /update-profile- Update doctor profileGET /list- Get all doctors (public)
POST /add- Add new medicine reminder (requires auth)GET /list- Get all user reminders (requires auth)DELETE /:id- Delete a reminder (requires auth)
- Never commit
.envfiles to version control - Use strong passwords for admin accounts
- Keep JWT secrets complex and secure
- Regularly update dependencies for security patches
- Use HTTPS in production
- Whitelist specific IPs in MongoDB Atlas for production
-
Stop Frontend/Admin:
- Press
Ctrl + Cin the terminal running the dev server
- Press
-
Stop Backend:
- Press
Ctrl + Cin the terminal running the backend server
- Press
Your data is safe! All data is stored in MongoDB Atlas (cloud) and persists even when servers are stopped.
- Start all servers (backend + admin)
- Login to admin panel (
http://localhost:5174) - Navigate to "Add Doctor"
- Fill in all required fields
- Upload doctor image
- Click "Add Doctor"
- Start backend + frontend servers
- Go to
http://localhost:5173 - Click "Create Account"
- Fill registration form
- Password must be at least 8 characters
- Fork the repository
- Create a 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 ISC License.
Team Kasam
If you encounter any issues:
- Check the Troubleshooting section
- Verify all environment variables are correctly set
- Ensure MongoDB Atlas IP whitelist is configured
- Check that all three servers are running
- Clear browser cache and localStorage
For additional help, please open an issue in the repository.
- Node.js and npm installed
- MongoDB Atlas account created and cluster set up
- Cloudinary account created
- All dependencies installed (
npm installin all 3 folders) - Environment variables configured in all
.envfiles - Backend server running on port 4000
- Frontend server running on port 5173
- Admin panel running on port 5174
- Can access frontend in browser
- Can login to admin panel
- Can add a doctor successfully
- Can register a user successfully
🎊 Congratulations! Your Re-medi application is now running successfully!
For questions or support, contact: damnbrocrazy@gmail.com