Priscripto is a full-stack web application designed for booking doctor appointments online. Users can register, log in, view available doctors, and book or cancel appointments. Doctors can manage their profiles and view booked appointments. The app also features secure authentication, role-based access, and a responsive UI.
-
Overview
-
Technologies Used
-
Project Structure
-
Frontend Documentation
- Environment Variables
- Key Features
- Folder Structure
- Important Components
- API Integration
-
Backend Documentation
- Environment Variables
- Key Features
- Folder Structure
- Database Models
- API Endpoints
-
Deployment
-
Best Practices
-
Future Enhancements
-
How to Run Locally
-
Author
-
License
The Appointment Booking System (Priscripto) is a web application that allows users to book appointments with doctors. It includes features like user authentication, appointment scheduling, and profile management. The system is built with a React.js frontend and a Node.js/Express.js backend, with MongoDB as the database.
- React.js
- Axios
- Tailwind CSS
- React Router DOM
- Toastify for notifications
- Node.js
- Express.js
- MongoDB with Mongoose
- JSON Web Tokens (JWT) for authentication
- Cloudinary for image uploads
- Frontend: Vercel
- Backend: Render
- Database: MongoDB Atlas
frontend/
โโโ public/
โโโ src/
โ โโโ assets/
โ โโโ components/
โ โโโ context/
โ โโโ pages/
โ โโโ styles/
โ โโโ utils/
โ โโโ App.jsx
โ โโโ main.jsx
โ โโโ index.css
โโโ .env
โโโ package.json
โโโ vite.config.js
backend/
โโโ controllers/
โโโ middlewares/
โโโ models/
โโโ routes/
โโโ utils/
โโโ .env
โโโ server.js
โโโ package.json
โโโ config/
VITE_BACKEND_URL=https://appointment-booking-system-backend-8sgg.onrender.com
- JWT-based user login/signup
- Appointment booking/cancellation
- View user profile and appointment history
- Responsive UI
assets/
: Static filescomponents/
: Reusable UI elementscontext/
: Global state using Context APIpages/
: Page-specific componentsstyles/
: Styling and Tailwind configsutils/
: API methods and helpers
- Navbar.jsx: Navigation and user options
- Appointment.jsx: Slot booking logic
- MyAppointment.jsx: User's booked appointments
const { data } = await axios.post(
`${import.meta.env.VITE_BACKEND_URL}/api/user/cancel-appointment`,
{ appointmentId },
{ headers: { token } }
);
PORT=4000
MONGO_URI=<your-mongodb-uri>
JWT_SECRET=<your-jwt-secret>
CLOUDINARY_NAME=<your-cloudinary-name>
CLOUDINARY_API_KEY=<your-cloudinary-api-key>
CLOUDINARY_API_SECRET=<your-cloudinary-api-secret>
- JWT Auth with role-based access
- Doctor & appointment management
- Secure routes with middlewares
- Centralized error handling
controllers/
: Logic for APIsmiddlewares/
: Auth and error middlewaremodels/
: Mongoose schemasroutes/
: API route definitionsutils/
: Helpers (tokens, cloudinary, etc)
User Model
const userSchema = new mongoose.Schema({
name: String,
email: { type: String, unique: true },
password: String,
isAdmin: { type: Boolean, default: false },
});
Doctor Model
const doctorSchema = new mongoose.Schema({
name: String,
specialization: String,
slot_booked: { type: Object, default: {} },
});
Appointment Model
const appointmentSchema = new mongoose.Schema({
userId: String,
docId: String,
slotDate: String,
slotTime: String,
cancelled: { type: Boolean, default: false },
});
- POST
/api/user/login
- POST
/api/user/signup
- GET
/api/user/get-profile
- POST
/api/user/cancel-appointment
- GET
/api/doctor/list
- POST
/api/doctor/add
- POST
/api/appointment/book
- GET
/api/appointment/list
- Push to GitHub
- Link repo to Vercel
- Set
VITE_BACKEND_URL
- Push to GitHub
- Link to Render
- Set all env variables
- Use HTTPS and env variables for secrets
- Central error handling in backend
- Reusable components in frontend
- Pagination and indexes for performance
- Admin dashboard for user/doctor management
- Email/SMS reminders
- Payment gateway
- Analytics dashboard
# Clone the repo
git clone https://github.com/yourusername/priscripto.git
cd priscripto
# Install dependencies
cd backend && npm install
cd ../frontend && npm install
# Setup env vars in backend/.env
MONGO_URI=your_mongodb_uri
JWT_SECRET=your_secret
CLOUDINARY_NAME=your_name
CLOUDINARY_API_KEY=your_key
CLOUDINARY_API_SECRET=your_secret
# Run the app
npm run dev (in both backend and frontend)
# Visit in browser
http://localhost:5173
Shivani Pandey Full-Stack Developer | MERN Stack | Cloud & Security Enthusiast
This project is open-source and available under the MIT License.