A full‑stack medical appointment platform with separate user (frontend), admin dashboard, and backend API.
backend/: Node.js + Express + MongoDB APIfrontend/: Patient/user web app (Vite + React + Tailwind)admin/: Admin dashboard (Vite + React + Tailwind)
- Node.js 18+ and npm 9+
- A MongoDB instance (Atlas or local)
- Cloudinary account (for image uploads)
Create a .env file in backend/ with:
PORT=4000
MONGODB_URI=<your_mongodb_connection_string_without_db_name>
CLOUDINARY_CLOUD_NAME=<your_cloud_name>
CLOUDINARY_API_KEY=<your_api_key>
CLOUDINARY_API_SECRET=<your_api_secret>
JWT_SECRET=<a_secure_random_string>
Notes:
- Database name
prescriptois appended in code, so provide the base connection string (without a trailing slash is fine). - Default API port is 4000.
Run these in parallel or one by one:
cd backend && npm icd frontend && npm icd admin && npm iIn three terminals:
# Backend (http://localhost:4000)
cd backend && npm run server# Frontend (user app, Vite dev server)
cd frontend && npm run dev# Admin (dashboard, Vite dev server)
cd admin && npm run devVite picks available ports (commonly 5173 for frontend and 5174 for admin).
cd frontend && npm run build
cd admin && npm run build- Static builds output to
frontend/dist/andadmin/dist/. - Start the API server:
cd backend && npm start- Base URL:
http://localhost:4000 - Routers:
GET /api/user/...GET /api/admin/...GET /api/doctor/...
- Backend: Express 5, Mongoose 8, JWT, Multer, Cloudinary, Razorpay
- Frontend/Admin: React 19, React Router 7, Tailwind CSS, Vite
- Backend:
npm run server(dev with nodemon),npm start(prod) - Frontend/Admin:
npm run dev,npm run build,npm run preview,npm run lint
- Ensure
.envexists inbackend/and values are correct. - If MongoDB fails: verify
MONGODB_URIand that theprescriptoDB is reachable. - If Cloudinary uploads fail: confirm Cloudinary credentials.
- CORS: API enables CORS; if requests fail, recheck the API base URL in the clients.
This project is for educational/demo purposes. Adjust as needed for production use.