Prescripto is a production-ready, full-stack doctor appointment booking web application. It offers three separate interfaces β a patient portal, a doctor dashboard, and an admin control panel β all powered by a single RESTful backend API.
Patients can discover doctors by speciality, pick available time slots, and complete payments securely via Stripe. Doctors manage their schedules and earnings. Admins control the entire platform from one place.
|
|
|
| Category | Technology |
|---|---|
| Frontend | React.js 18, Vite, Tailwind CSS, Context API, React Router DOM v6 |
| Backend | Node.js, Express.js |
| Database | MongoDB Atlas, Mongoose ODM |
| Auth | JSON Web Tokens (JWT), bcrypt password hashing |
| Payments | Stripe Checkout Sessions |
| File Storage | Cloudinary, Multer |
| Deployment | Vercel (Frontend + Admin), Render (Backend) |
Prescripto/
β
βββ π frontend/ # Patient-facing React app (Port 5173)
β βββ src/
β β βββ assets/ # Images, icons, SVGs
β β βββ components/ # Navbar, Footer, DoctorCard, etc.
β β βββ context/
β β β βββ AppContext.jsx # Global state β doctors, user, token
β β βββ pages/
β β βββ Home/ # Landing page
β β βββ Doctors/ # Browse by speciality
β β βββ Appointment/ # Book appointment
β β βββ MyAppointments/ # Patient's bookings
β β βββ MyProfile/ # Profile management
β β βββ About/
β β βββ Contact/
β β βββ Verify/ # Payment verification
β βββ vercel.json
β βββ .env
β
βββ π admin/ # Admin + Doctor panel (Port 5174)
β βββ src/
β β βββ context/
β β β βββ AdminContext.jsx # Admin state & API calls
β β β βββ DoctorContext.jsx # Doctor state & API calls
β β βββ pages/
β β βββ Admin/
β β β βββ Dashboard.jsx
β β β βββ AllAppointments.jsx
β β β βββ AddDoctor.jsx
β β β βββ DoctorsList.jsx
β β βββ Doctor/
β β βββ DoctorDashboard.jsx
β β βββ DoctorAppointments.jsx
β β βββ DoctorProfile.jsx
β βββ vercel.json
β βββ .env
β
βββ π backend/ # Express REST API (Port 4000)
β βββ config/
β β βββ mongodb.js # MongoDB Atlas connection
β β βββ cloudinary.js # Cloudinary setup
β βββ controllers/
β β βββ adminController.js
β β βββ doctorController.js
β β βββ userController.js
β βββ middlewares/
β β βββ authAdmin.js
β β βββ authDoctor.js
β β βββ authUser.js
β βββ models/
β β βββ userModel.js
β β βββ doctorModel.js
β β βββ appointmentModel.js
β βββ routes/
β β βββ adminRoute.js
β β βββ doctorRoute.js
β β βββ userRoute.js
β βββ server.js
β βββ .env
β
βββ .gitignore
Before you begin, make sure you have:
- β Node.js v18 or higher
- β A MongoDB Atlas free cluster
- β A Stripe account (test mode keys)
- β A Cloudinary free account
git clone https://github.com/Sahil-Mansuri-15/Prescripto.git
cd Prescriptocd backend
npm installCreate backend/.env:
MONGODB_URI=mongodb+srv://<username>:<password>@cluster.mongodb.net/prescripto
JWT_SECRET=your_super_secret_jwt_key
# Admin Credentials
ADMIN_EMAIL=[email protected]
ADMIN_PASSWORD=your_admin_password
# Cloudinary
CLOUDINARY_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_SECRET_KEY=your_api_secret
# Stripe
STRIPE_SECRET_KEY=sk_test_your_key
# Currency
CURRENCY=INRnpm run server # Starts on http://localhost:4000cd frontend
npm installCreate frontend/.env:
VITE_BACKEND_URL=http://localhost:4000npm run dev # Starts on http://localhost:5173cd admin
npm installCreate admin/.env:
VITE_BACKEND_URL=http://localhost:4000npm run dev # Starts on http://localhost:5174π€ User Routes β /api/user
| Method | Endpoint | Auth | Description |
|---|---|---|---|
POST |
/register |
β | Register new patient |
POST |
/login |
β | Login patient |
GET |
/get-profile |
β | Get user profile |
POST |
/update-profile |
β | Update name, photo, dob, etc. |
POST |
/book-appointment |
β | Book a time slot |
GET |
/appointments |
β | Get all appointments |
POST |
/cancel-appointment |
β | Cancel an appointment |
POST |
/payment-stripe |
β | Initiate Stripe payment |
POST |
/verify-stripe |
β | Verify payment status |
π©Ί Doctor Routes β /api/doctor
| Method | Endpoint | Auth | Description |
|---|---|---|---|
POST |
/login |
β | Doctor login |
GET |
/list |
β | Get all doctors (public) |
POST |
/appointments |
β | Get doctor's appointments |
POST |
/complete-appointment |
β | Mark as completed |
POST |
/cancel-appointment |
β | Cancel appointment |
GET |
/dashboard |
β | Earnings & stats |
GET |
/profile |
β | Get profile data |
POST |
/update-profile |
β | Update fees, availability |
βοΈ Admin Routes β /api/admin
| Method | Endpoint | Auth | Description |
|---|---|---|---|
POST |
/login |
β | Admin login |
POST |
/add-doctor |
β | Add doctor with image |
GET |
/all-doctors |
β | List all doctors |
POST |
/change-availability |
β | Toggle doctor availability |
GET |
/appointments |
β | All platform appointments |
POST |
/cancel-appointment |
β | Cancel any appointment |
GET |
/dashboard |
β | Platform-wide stats |
Use Stripe's test card to simulate payments:
Card Number β 4242 4242 4242 4242
Expiry β Any future date (e.g. 12/27)
CVV β Any 3 digits (e.g. 123)
ZIP β Any 5 digits (e.g. 12345)
| Service | Platform | Config |
|---|---|---|
| Patient Frontend | Vercel | Root: frontend, add VITE_BACKEND_URL |
| Admin Panel | Vercel | Root: admin, add VITE_BACKEND_URL |
| REST API | Render | Root: backend, Start: node server.js |
| Database | MongoDB Atlas | Free M0 cluster |
| Image CDN | Cloudinary | Free tier (25 GB) |
π‘ Tip: Add your Render backend URL to UptimeRobot (free) to prevent cold starts on Render's free tier.
Contributions are always welcome!
# 1. Fork the project
# 2. Create your feature branch
git checkout -b feature/YourFeature
# 3. Commit your changes
git commit -m "feat: add YourFeature"
# 4. Push and open a Pull Request
git push origin feature/YourFeature