How satishgupta2/prescripto works
Project type and purpose
• This is a full-stack MERN (MongoDB, Express, React, Node) doctor-appointment booking system with three clients (public website, doctor portal, admin panel), a backend API server, a MongoDB database, and two external services (Cloudinary for image storage, Razorpay for payments).
File structure
• Top-level directories:
• frontend – React app for patients (booking UI, profile, payment)
• admin – React app for admins & doctors (dashboard, appointment management, doctor management)
• bankend – Express/Node server (APIs, controllers, models, middleware, config)
• Notice MVC-style arrangement in backend (models/, controllers/, routes/), plus config/ for MongoDB & Cloudinary and middleware/ for JWT authentication and file uploads.
• Both React apps use Vite, Tailwind CSS, Context API for state, and share a similar folder layout (components/, pages/, context/).
README for additional insights
• Three authentication levels: patient, doctor, admin
• Razorpay integration for payments
• CRUD operations on users, doctors, appointments via REST APIs
• Deployment targets: Render for backend, static hosting for React apps
a. Main components:
1. Patient-facing Frontend (React SPA)
2. Doctor/Admin Portal (React SPA)
3. Backend API Server (Node/Express)
4. Database (MongoDB Atlas)
5. Cloudinary (image upload & storage)
6. Razorpay Payment Gateway
b. Relationships & interactions:
• Both React apps communicate over HTTPS with the Backend API.
• The Backend uses Mongoose to read/write to MongoDB.
• File-upload endpoints route images through the Cloudinary SDK.
• Booking endpoint calls Razorpay SDK for payment orders.
• Authentication (JWTs) is applied via middleware on protected routes.
c. Architectural patterns & design principles:
• MVC separation in backend (models ↔ controllers ↔ routes)
• Context API in frontend for global state (user session, appointments)
• RESTful API design (adminRoute, doctorRoute, userRoute)
• Layered security: separate JWT guards for Admin, Doctor, User
d. Key technologies/frameworks:
• React + Vite + Tailwind CSS
• Context API for state management
• Express.js + Mongoose
• Cloudinary SDK
• Razorpay Node.js SDK
• JWT for auth
Essential elements
• Authentication layers: JWT guards for Users, Doctors, Admins
• Context stores in frontends (AppContext, AdminContext, DoctorsContext)
• Static hosting of SPAs (e.g., Vercel/Netlify) vs. Render hosting for API
• Contact point: API Base URL (e.g., https://api.prescripto.com)