PillStack is a virtual clinic platform coupled with an online pharmacy. This MERN stack project aims to eradicate the challenges associated with physical hospital visits by providing a complete digital healthcare solution.
This project serves as a learning opportunity to collaborate effectively within a team setting, specifically focusing on the development of a MERN Stack project. The primary objectives include gaining practical experience in meeting both Functional and Non-Functional Requirements, navigating diverse APIs, and cultivating a consistent coding style.
- The system currently does not allow the user to top up their wallet balance. However in the future we intend to add this feature.
- The system does not verify the user's email upon registeration.
- For reporting bugs or offering contributions or enhancements please check our Contributions section below.
- Landing Page
- Login Page
- Patient home page
- View all doctors on the platform
- Book an appointment
- chat with a doctor
- Add a family member
- View linked family members
- View my appointments
- View my family's appointments
- View my health packages
- Subscribe to a health package
- Doctor's home page
- View doctor's patients
- chat with a patient
- Add an appoinmment to my bookings
- Accept/Reject a follow up requested by a patient
- Schedule a follow up for a patient
- Admin home page
- Add a new admin to the system
- Delete a user from the system
- View doctor's applications
- Use 4-space indentation.
- Line length should not exceed 80 characters.
- End statements with semicolons.
- Variables: camelCase
- Functions: snake_case
- Group related files into directories (e.g., /src, /tests).
- Use comments to explain complex logic or non-obvious code parts.
- Use concise and descriptive commit messages following the conventional commits specification.
MERN Stack is a popular and robust combination of technologies used for building web applications. The acronym MERN stands for MongoDB, Express.js, React, and Node.js, which are the four core technologies that make up this stack.
- Node.js: A JavaScript runtime for server-side development.
- Express.js: A web application framework for Node.js.
- MongoDB: A NoSQL database for storing application data.
- Socket.IO: A JavaScript library for enabling real-time, bidirectional communication between web clients and servers.
- React.js: A JavaScript library for building user interfaces.
- Axios: A promise-based HTTP client for making HTTP requests.
- Postman : For testing API endpoints during development.
- Online payment is supported
- Live chat between patients and doctors
- Video chat between patients and doctors
- Patients can view any doctor's full profile.
- Appointments Cancellation and refund is possible.
- Patients are sent emails with details and upadtes of their appointments.
- Patients can link immediate family accounts to their own account.
- Patients can book appointmnets for their linked family members.
- Guest:
As a Guest, I could:
- Register as a patient.
- Submit a request to register as a doctor .
- Upload required documents upon registration as a doctor.
- Patient:
As a Patient, I could:
- Upload/remove documents (PDF, JPEG, JPG, PNG) for my medical history.
- Add family members with name and national ID.
- Link another patient's account as a family member.
- Choose to pay for my appointment using my wallet or credit card.
- View all new and old prescriptions .
- View health package options and details.
- Subscribe to a health package for myself and family members.
- Choose to pay for the chosen health package using wallet or credit card.
- Cancel a subscription of a health package.
- View a list of all my upcoming/past appointments and my family memebrs' appointments.
- Reschedule an appointment.
- Cancel an appointment.
- Receive notifications about new and cancelled appointments.
- View, select, and pay for prescription items.
- Download selected prescriptions (PDF).
- Start/end a video call with the doctor.
- Chat with a doctor.
- Request a follow-up to a previous appointment.
- Reset a forgotten password through OTP sent to email.
- Doctor As a Doctor, I could:
- Edit/update my email, hourly rate, or affiliation.
- Add available time slots for appointments.
- View information and health records of patients registered with me.
- Schedule a follo up for my patients.
- Accept or revoke a follow-up session request from a patient.
- Add/delete/update medicine to/from the patient's prescription.
- Add new health records for a patient.
- Chat with a patient of mine.
- Reset a forgotten password through OTP sent to email.
- Admin: As a Doctor, I could:
- Add another administrator with specific credentials.
- Remove a doctor/patient/admin from the system.
- View and accept or reject a doctor's request to join the platform.
- Add/update/delete health packages.
- Reset a forgotten password through OTP sent to email.
Patient registration function: Stripe payment intent creation function: Admin accept doctor's request function:
1.Clone Repository to your device git clone https://github.com/advanced-computer-lab-2023/Pill-Stack-Clinic.git
2.Open 2 terminals
3.In the first terminal run the following commands:
cd backend
npm install
cd src
nodemon app.js
4.In the second terminal run the following commands:
cd frontend
npm install
cd src
npm start
Your default browser should automatically open on the web application's address.
Our APIs is divided into four APIs :
- route: /patientRegister
- request type: POST
- body:
{username :'ahned' ,name:'ahmed', password : 'Ahmed@123' , email : '[email protected]',DateOfBirth:'2001/2/18',gender:'Male',mobile:012345678 , EmergencyContact_name,:'ahmed' , EmergencyContact_mobileNumber:'mohmaed',EmergencyContact_Relation:'child}
- route: /administration
- request type:POST
- body:
{username :'ahmed' , password : 'Ahmed@123' , email : '[email protected]'}
- route : (/)
- type : POST
- body :
{username :'ahned' , password : 'Ahmed@123'}
- route : (/logOut)
- type : POST
-middleware : userVerfication - header : is handled using the authentication middleware session which contains logged user token
- route : (/changePassword)
- type : POST
- body :
{oldPassword :'Ahned34-' , newPassword : 'Ahmed39-'}
- route : (/sendOTP)
- type : POST
- body :
{email :'[email protected]'}
- route : (/checkOTP)
- type : POST
- body :
{email :'[email protected]',otp:'1234'}
- route : (/resetPass)
- type : POST
- body :
{email :'[email protected]',newPassword:'ahmedA1234-'}
- route : (/profile)
- type : GET
- middleware: userVerification
- route : (/addFamMem)
- type : POST
- middle : userVerification
- body :
{username :'ah',nationalID:'1234',age=20, gender='Male',relation='child'}
- route : (/linkPatientAsFamilyMember/:Username/:emailOrPhone/:relation)
- type : POST
- middleware : userVerification
- header :
{username: 'ah',emailOrPhone:'01234567',relation:'child'}
- route : (/viewFamily)
- type : GET
- middleware: userVerification
- route : (/viewFamilyAppointments)
- type : GET
- middleware: userVerification
- route : (/selectedDoctorDetails/:username)
- type : GET
- header :
{username: 'doctor'}
- route : (/getAmount)
- type : POST
- middleware : userVerification
- body :
{doctor :'doctor'}
- route : (/viewDoctorAppointments/:username)
- type : GET
- header :
{username: 'doctor'}
- route : (/payWallet)
- type : POST
- middleware : userVerification
- body :
{appid: 'mongoose.type.objectId()',doctorUsername:'doctor', amount:30 , linkedFamMember:'ah', manualFamMember:'Na}
- route : (/packages)
- type : GET
- route : (/subscribeWallet)
- type : POST
- middleware : userVerification
- body :
{packageID: 'mongoose.type.objectId()',username:'ahmed'}
- type : GET
- route : (/cancelSubs)
- type : POST
- middleware : userVerification
- body :
{userId: 'mongoose.type.objectId()',packageID: 'mongoose.type.objectId()'}
- route : (/cancelAppointments)
- type : POST
- middleware : userVerification
- body :
{appointmentId: 'mongoose.type.objectId()'}
- route : (/cancelFamAppointments)
- type : POST
- middleware : userVerification
- body :
{appointmentId: 'mongoose.type.objectId()'}
- route : (/cancelFamAppointments)
- type : POST
- middleware : userVerification
- body :
{prescription: 'mongoose.type.object()'}
- route : (/Chat/:username/:doctorUsername)
- type : POST
- header :
{username: 'ah',doctorUsername:'doctor'}
- route : (/Chat/:username/:doctorUsername)
- type : POST
- header :
{username: 'ah',doctorUsername:'doctor'}
- route : (/rescheduleAppointment)
- type : POST
- middleware : userVerification
- body :
{appointmentId: 'mongoose.type.objectId()',newDate:'2023-11-24T09:00:00.000+00:00'}
- route : (/famRescheduleAppointment)
- type : POST
- middleware : userVerification
- body :
{appointmentId: 'mongoose.type.objectId()',newDate:'2023-11-24T09:00:00.000+00:00'}
- route : (/pay)
- type : POST
- middleware : userVerification
- body :
{appid: 'mongoose.type.objectId()',doctorUsername:'doctor',amount:30}
- route : (/pay/confirm)
- type : POST
- middleware : userVerification
- body :
{appid: 'mongoose.type.objectId()',doctorUsername:'doctor',amount:30,member:'',manualMem:'ahm'}
- route : (/payPack)
- type : POST
- middleware : userVerification
- body :
{packid: 'mongoose.type.objectId()'}
- route : (/pay/confirm)
- type : POST
- middleware : userVerification
- body :
{packid: 'mongoose.type.objectId()'}
- route : (/profile)
- type : GET
- middleware: userVerification
- route : (/profile/edit/:id)
- type : POST
- header : `{id:'mongoose.type.objectId()'}
- body :
{email:'[email protected]',HourlyRate:12,Affiliation:'NMC'}
- route : (/updateContractStatus)
- type : POST
- middleware : userVerification
- body :
{username:'doctor'}
- route : (/myPatients)
- type : GET
- middleware : userVerification
- route : (/availability)
- type : GET
- middleware : userVerification
- route : (/availability)
- type : POST
- middleware : userVerification
- body :
{date:'2023-3-2',startTime='10:30',endTime='11:30'}
- route : (/scheduleFollowUp)
- type : POST
- middleware : userVerification
- body :
{oldAppointment: 'mongoose.type.objectId()',newAppointment: 'mongoose.type.objectId()'}
- route : (/addHealthRecord)
- type : POST
- middleware : userVerification
- body :
{patientUsername: 'ah',patientName:'ah',recordDetails:'Constant follow up is needed'}
- route : (/cancelAppointments)
- type : POST
- middleware : userVerification
- body :
{appointmentId: 'mongoose.type.objectId()'}
- route : (/PDF/:username)
- type : POST
- middleware : userVerification
- header :
{username:'ah'}
- body :
{prescription: 'mongoose.type.object()'}
- route : (/addPrescription/:username)
- type : POST
- middleware : userVerification
- header :
{username:'ah'}
- body :
{prescriptions: 'mongoose.type.object()'}
- route : (/editPrescription/:username/:presId)
- type : PUT
- middleware : userVerification
- header :
{username:'ah',presId:'mongoose.type.objectId()'}
- body :
{prescription: 'mongoose.type.object()'}
- route : (/ChatDoctor/:doctorUsername/:username)
- type : POST
- header :
{username: 'ah',doctorUsername:'doctor'}
- route : (/sendMessage/:patientUsername/:doctorUsername)
- type : POST
- header :
{patientUsername: 'ah',doctorUsername:'doctor'}
- route : (/ChatDoctor2/:doctorUsername/:pharmacistUsername)
- type : POST
- header :
{pharmacistUsername: 'pharm',doctorUsername:'doctor'}
- route : (/sendMessage2/:pharmacistUsername/:doctorUsername)
- type : POST
- header :
{pharmacistUsername: 'pharm',doctorUsername:'doctor'}
- route : (/profile)
- type : GET
- middleware: userVerification
- route : (/applications)
- type : GET
- route : (/applications/view/:id)
- type : GET
- header :
{id:'mongoose.type.objectId()'}
- route : (/applications/accept-registeration/:id)
- type : POST
- header :
{id:'mongoose.type.objectId()'}
- route : (/applications/accept-registeration/:id)
- type : POST
- header :
{id:'mongoose.type.objectId()'}
- route : (/packages)
- type : GET
- route : (/packages)
- type : POST
- body :
{packagename:'PackName',price:20,session_dis:20,pharmacy_dis:20,family_dis:20}
- route : (/editPack/:id)
- type : POST
- header :
{id:'mongoose.type.objectId()'}
- body :
{price:20,session_dis:20,pharmacy_dis:20,family_dis:20}
- route : (/deletePack/:id)
- type : POST
- header :
{id:'mongoose.type.objectId()'}
- route : (/allUsers)
- type : GET
- route : (/removeUser)
- type : POST
- body :
{id:'mongoose.type.objectId()',role:'doctor'}
Patient's Wallet
View all doctors on the platform
Get session price of a specific doctor
View family members
Doctor's patients
Doctor adding availability to the system
Viwing all doctor's applications
- Open
http://localhost:3000/
to view the landing page in your browser.
- Register as a patient in order to be able to login into the system.
- Upon successful registeration, a redirection to the login page will occur.
- Upon successful login, a redirection to the home page will occur
- In order to view the list of doctors, click on
View Available Doctors
- Press on
Book Appointments
in order to view the details of the doctor - Press on
Book Appointments
in order to view the availability of the doctor - Select the desired appointment,and select between you and your family members and your desired payment method.
- To view your appointments, navigate back to the home page and select
Appointments
. Rescheduling,cancelling, and requesting a follow up can be done through this page. - Navigate back to home page and select
Appointments
and then selectFamily Appointments
to view appointments booked for your family members.Also rescheduling, cancelling, and requesting a follow up - Inorder to check the packages offered my the system, Navigate back to the home page and select
Packages
and thenSubscribe
. - Select your required package and choose your payment option.
- From the side bar select
packages
and then myMy packages
to view your current subscriptions.Cancellation of package can happen here. - To upload medical documents head to
Medical Documents
from the side bar. You can upload and view your medical documents as a pdf. - The chat icon on the bottom right side in the home page , allows you to chat with doctors.
-
Open
http://localhost:3000/
to view the landing page in your browser.
-
Enter your credentials and a redirection the the doctor-home page will occur.
-
Through the
Availability
page, the doctor can add time slots according to his schedule. -
Through the
Appointments
page the doctor can view his past and upcoming appointments. Cancelling,rescheduling, and accessing the appointment can all happen in this page -
Through the
My patients
page the dcotor can view his patients. -
Doctor can view the details of a patient by selecting the desired patient.In this page, doctor can manage prescriptions, add health records, chat with patient.
-
From the side bar
Personal/Followups
shows the doctor the follow up requests, where the doc can accept and reject. -
The chat icon on the bottom right side in the home page , allows you to chat with patients and pharmacists.
- Open
http://localhost:3000/
to view the landing page in your browser.
- Select
Join Now
and redirection to login page occurs - Enter your credentials and a redirection the the admin-home page will occur.
- Through Packages, the admin can edit and add packages
- Through
doctor requests
, the admin can view all requests sumbitted and accept or reject. - Through
Users
, the admin can view all users on the system and remove any user or add new Admin.
Thank you for considering contributing to our project! We welcome contributions from everyone.
- Reporting Bugs: If you find a bug or issue, please send us an email on
[email protected]
mentioning the issue with a clear description. - Fixing Bugs: Fork the repository, create a new branch, and submit a pull request referencing the issue.
- Requesting Features: Propose new features by emailing us on
[email protected]
to discuss changes. - Implementing Features: Coordinate with developers before implementing new features.
- Stripe is licensed under the Apache License 2.0