The primary objective of the project is to establish a comprehensive online clinic that caters to the needs of both patients and the clinic itself, complete with a pharmacy. El7a2ny is a software program designed to let patients, medical professionals, chemists, and clinics all work together more efficiently and automatically. This encompasses features such as finding a suitable a doctor, making appointments, holding in-person or virtual meetings, obtaining prescriptions, receiving follow-up reminders, accessing medical records, and placing prescription drug orders.
Our motivation to develop El7a2ny is rooted in a shared commitment to elevate and refine healthcare processes. We envision a future where healthcare transcends traditional boundaries, and our project is the catalyst for this transformation.
Revolutionizing Healthcare Accessibility: Our passion lies in breaking down barriers to healthcare. Picture a world where finding the right doctor, setting up appointments, and managing prescriptions are just a few clicks away. We're committed to making healthcare not just a service but an experience that's effortlessly within reach.
Empowering Personalized Care: At the heart of our project is the belief that healthcare should be as unique as the individuals it serves. With our platform, you're not just a patient; you're an active participant in your health journey. Access your medical history, set personalized reminders, and take control of your well-being on your terms.
Simplifying Professional Workflows: For healthcare professionals, we're on a mission to simplify the complexities of daily tasks. By automating administrative processes, we aim to give doctors, pharmacists, and clinics more time to focus on what they do best – providing attentive and quality care to their patients.
Catalyzing Seamless Communication: In our vision, communication isn't just a transaction; it's the heartbeat of healthcare. We're building a platform that facilitates transparent and instantaneous communication between patients and healthcare providers, fostering a sense of connection that goes beyond traditional medical interactions.
Some pages in the website face a longer time loading than others , which can be confusing sometimes for no data , but we tried fixing it by adding a "Loading" statements all over the website so the user does not get confused that the page stopped loading , also The "change password" has to work on app.use(cors({ origin: 'http://localhost:3000', credentials: true, })); (something specific) but we can’t do that as sometimes we run the frontend on a different port so we need to use app.use(cors({ origin: ‘*’, credentials: true, }));
Controllers: Contains controllers handling various the business logic -- optimizing online healthcare interactions, streamlining appointments, prescriptions, and medical records for enhanced accessibility and personalized care.
Models: Houses database models and schemas that define the structure and relationships of its data entities.
Middleware: Holds middleware functions used in the application, i.e., jsonwebtoken is used for logging in and multer for document uploads.
Routes: Establishes pathways for handling various HTTP requests, specifying endpoints and connecting them to their respective controllers
App: Entry point for the backend application.
Utils: Verifies the uniqueness of emails and usernames, and validates passwords.
Assets: Stores static assets and visual elements such as images, fonts, etc.
Components: Houses reusable React components such as lists, tables, forms and navigation bars.
Features: Contains feature-specific components and logic.
Pages: Defines different pages of the application such as different medical professionals' views registration pages.
App: Entry point for the frontend application.
The backend code follows a clean and organized structure with clear separation of concerns. Notable points include:
Async/Await Usage: The code consistently uses async/await for handling asynchronous operations, enhancing code readability.
Error Handling: Robust error handling is implemented using try-catch blocks, providing clear responses to potential issues.
Consistent Naming: Variable and function names are in camelCase, adhering to common JavaScript conventions.
Comments: The code includes comments for explaining complex logic and providing context, aiding in understanding.
The frontend code, written in React, also follows a structured and readable style:
Component Structure: Components are well-organized into directories based on their functionality, promoting maintainability.
State Management: React state is managed using the useState hook, contributing to a more functional and modular approach.
Effect Handling: Managing side effects in React using the useEffect hook, fostering a more functional and modular approach to handling asynchronous operations and lifecycle events.
External Dependencies: External dependencies, such as Axios for HTTP requests, are imported and used consistently.
Consistent Styling: Consistent styling practices are followed, and class names are indicative of their purpose.
El7a2ny utilizes the MERN stack, comprising MongoDB, Express.js, React, and Node.js, to create a robust and full-stack web application. This technology stack seamlessly integrates a NoSQL database, a server-side framework, a front-end framework, and a runtime environment, providing a comprehensive solution for building scalable and dynamic web applications.
Client: React and Axios
Server: Node, Express and MongoDB
In our application, we prioritize user experience by seamlessly integrating a variety of micro enhancements. From animated transitions and tooltip guidance for intuitive navigation to smart form validation and contextual feedback for user assistance, each detail is meticulously designed. These subtle yet impactful features, such as responsive design and persistent user preferences, collectively contribute to an enhanced, efficient, and personalized experience, ensuring our users engage with our application effortlessly and enjoy a heightened level of satisfaction.
Soothing Color Palette: Our project features a carefully curated color scheme primarily centered around calming shades of blue and cream. Leveraging the principles of color psychology, the choice of blue invokes a sense of tranquility and professionalism.
Sectionalized Architecture: Implemented with meticulous precision, the project embodies a robust architecture with well-defined sections, ensuring intuitive navigation and seamless user engagement.
Optimized Visibility Mechanisms: Prioritizing clarity, our project incorporates advanced visibility features, guaranteeing optimal information presentation for users.
Visual Equilibrium: A focus on visual balance is integral to our design philosophy, resulting in a harmonious layout that contributes to an aesthetically pleasing and user-centric interface.
Fill Screen Mode: Enhancing user flexibility, our application includes a fill screen mode, allowing users to maximize their viewing experience and immerse themselves in content.
Cross-Platform Compatibility: Our project is designed to be seamlessly accessible across various platforms, ensuring a consistent and user-friendly experience regardless of the device or OS being used.
// Task 2: delete medical history document
const deleteMedicalHistoryDocument = async (req, res) => {
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Access-Control-Allow-Credentials', true);
const { Username, filePathToRemove } = req.params;
if (!(req.user.Username === Username)) {
res.status(403).json("You are not logged in!");
} else {
try {
const patient = await patientSchema.findOne({ Username });
if (!patient) {
return res.status(404).json({ error: 'Patient not found' });
}
// Find the index of the document with the given _id
const documentIndex = patient.MedicalHistoryDocuments.findIndex((document) => document._id.toString() === filePathToRemove);
if (documentIndex === -1) {
return res.status(404).json({ error: 'Document not found' });
}
// Remove the document at the found index
patient.MedicalHistoryDocuments.splice(documentIndex, 1);
await patient.save();
res.status(200).send({ message: 'Document deleted successfully' });
} catch (error) {
res.status(500).json({ error: error.message });
}
}
};
const express = require('express');
const multer = require('multer');
const path = require('path');
const storage = multer.memoryStorage();
const allowedFileTypes = ['pdf', 'jpeg', 'jpg', 'png'];
const fileFilter = (req, file, cb) => {
const extname = path.extname(file.originalname).toLowerCase();
if (allowedFileTypes.includes(extname.substr(1))) {
return cb(null, true);
}
return cb(new Error('Invalid file type. Only PDF, JPEG, JPG, and PNG files are allowed.'));
};
const upload = multer({
storage: storage,
fileFilter: fileFilter,
});
module.exports = upload;
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const doctorSchema = new Schema({
Username: {
type: String,
required: true,
unique: true
},
Name: {
type: String,
required: true
},
Email: {
type: String,
required: true,
unique: true
},
Password: {
type: String,
required: true,
},
DateOfBirth: {
type: Date,
required: true
},
HourlyRate:{
type: Number,
required: true,
},
Affiliation:{
type:String,
required: true
},
EDB:{
type:String,
required: true
},
PatientsUsernames: [{
type: String,
ref: 'Patient',
}],
Speciality:{
type: String,
required: true,
enum:["dermatology","dentistry","psychiatry","neurology","orthopedics","Dermatology","Dentistry","Psychiatry","Neurology","Orthopedics"]
},
WalletAmount:{
type: Number,
default: 0
},
IDDocument: {
data: {
type: Buffer,
},
contentType: {
type: String,
},
},
MedicalDegreeDocument: {
data: {
type: Buffer,
},
contentType: {
type: String,
},
},
WorkingLicenseDocument: {
data: {
type: Buffer,
},
contentType: {
type: String,
},
},
AvailableTimeSlots: [
{
Date: {
type: Date,
},
Time: {
type: Number,
},
Status: {
type: String,
default: "available",
enum: ["available", "booked"],
required: false,
},
},
],
},{ timestamps: true });
const Doctor = mongoose.model('Doctor', doctorSchema);
module.exports = Doctor;
router.post("/addMedicalHistoryDocument/:username", verify, upload.single("MedicalHistoryDocuments"), addMedicalHistoryDocument);
async function isUsernameUnique(username) {
const patientExists = await Patient.findOne({ Username: username });
const guestDoctorExists = await GuestDoctor.findOne({ Username: username });
const doctorExists = await Doctor.findOne({ Username: username });
const adminExists = await Admin.findOne({ Username: username });
return !patientExists && !guestDoctorExists && !adminExists && !doctorExists;
}
:root {
--mint-geen: #067787;
--ligth-grey: #f5f5f5;
--dark-grey: #404040;
--red: #e50c0c;
}
.green-btn {
background-color: var(--mint-geen);
color: white;
}
.white-btn {
background-color: var(--ligth-grey);
color: red;
}
.grey-btn {
background-color: var(--ligth-grey);
color: var(--mint-geen);
}
.green-txt {
color: var(--mint-geen);
}
.red-txt {
color: var(--red);
}
.dark-grey-txt {
color: var(--dark-grey);
}
.err-active {
border-color: var(--red);
}
.bg-green {
background-color: #e1eff1;
}
.bg-grey {
background-color: var(--ligth-grey);
}
import { useNavigate, useParams } from "react-router-dom";
import axios from "axios";
import { useEffect, useState } from "react";
import search from "../assets/images/svg/search.svg";
import TablePatients from "./TablePatients.jsx";
import NavBarDoctor from "./NavBarDoctor.jsx";
function PatientsList() {
const [searchText, setSearchText] = useState("");
const [filterText, setFilterText] = useState("");
const [result, setResult] = useState([]);
const { username } = useParams();
const [isLoading, setIsLoading] = useState(true);
useEffect(() => {
setIsLoading(true);
const response = axios
.get(`http://localhost:4000/Doctor/MyPatients/${username}`, {
headers: { authorization: "Bearer " + sessionStorage.getItem("token") },
})
.then((res) => {
setResult(res.data);
setIsLoading(false);
})
.catch((err) => {
console.log(err);
setIsLoading(false);
});
}, [username]);
console.log(result);
result.map((e) => {
console.log(e);
});
const onFilterValueChanged = (event) => {
setFilterText(event.target.value);
};
console.log(filterText);
let tHead = [
"Name",
"Username",
"Email",
"View",
"Add Prescription",
"View Prescriptions",
];
if (isLoading) {
return <div>Loading...</div>;
}
return (
<div>
<NavBarDoctor username={username} />
<div className="d-flex justify-content-between flex-row">
<p className="text-capitalize fs-4 w-25">Patients</p>
<div className="d-flex flex-row w-75 justify-content-end">
<div className="input-group w-50">
<span className="input-group-text bg-white border-end-0 search">
<img src={search} alt="search" />
</span>
<input
type="text"
className="form-control border-start-0 search ps-0"
placeholder="Search"
onChange={(e) => setSearchText(e.target.value)}
/>
</div>
<select className="input-group-text bg-white border-end-0 search" name="upcomingAppointments" onChange={onFilterValueChanged}>
<option value="all">All</option>
<option value="upcoming">Upcoming</option>
<option value="finished">Finished</option>
<option value="running">Running</option>
<option value="following">Following</option>
</select>
</div>
</div>
<TablePatients
username={username}
tHead={tHead}
data={result}
searchText={searchText}
filterText={filterText}
/>
</div>
);
}
export default PatientsList;
import { useNavigate } from 'react-router-dom';
import Input from '../components/Input.jsx';
import MainBtn from '../components/Button.jsx';
import { Link } from 'react-router-dom';
import { useState } from 'react';
import axios from "axios";
function Login() {
const navigate = useNavigate();
const [password, setPassword] = useState("");
const [username, setUsername] = useState("");
const handleLogin = async (event) => {
event.preventDefault();
console.log('uuu', username);
console.log('ppp', password);
try {
const response = await axios.post('http://localhost:4000/login', { username: username, password: password });
if (response.data.userDoctor) {
sessionStorage.setItem("token", response.data.userDoctor.accessToken);
navigate(`/doctorView/${username}`);
} else if (response.data.userPatient) {
sessionStorage.setItem("token", response.data.userPatient.accessToken);
navigate(`/patientView/${username}`);
} else if (response.data.userAdmin) {
sessionStorage.setItem("token", response.data.userAdmin.accessToken);
navigate(`/administratorView/${username}`);
} else {
console.error('User role not recognized');
alert("User role not recognized");
}
} catch (error) {
console.error(error.response ? error.response.data : error.message);
alert(error.response ? error.response.data.error : error.message);
}
};
return (
<div>
<form
className="d-flex justify-content-center"
>
<div className="form-width">
<p className="text-capitalize fs-4">Login</p>
<Input
title='username'
placeholder='enter your username'
type='text'
onChange={(e) => setUsername(e.target.value)}
/>
<Input
title='password'
placeholder='enter your password'
type='password'
onChange={(e) => setPassword(e.target.value)}
/>
<div className="mt-3">
<MainBtn
txt='login'
style='green-btn'
action={handleLogin}
/>
</div>
<p className="text-center mt-3 small-txt">
<>
Forgot Password?
<Link to="/forgotpassword" className="green-txt">
{' '}
Reset Password
</Link>
</>
</p>
</div>
</form>
</div>
);
}
export default Login;
import AppointmentsList from './components/AppointmentsList';
<Route exact path="/appointmentsList/:username" element={<AppointmentsList />} />
Install my-project with npm:
npm install my-project
cd my-project
Install the following npm packages:
1. axios -- npm i axios
2. bcrypt -- npm i bcrypt
3. body-parser -- npm i body-parser
4. connect -- npm i connect
5. cookie-parser -- npm i cookie-parser
6. cors -- npm i cors
7. dotenv -- npm i dotenv
8. express -- npm i express
9. git -- npm i git
10. jsonwebtoken -- npm i jsonwebtoken
11. moment -- npm i moment
12. mongoose -- npm i mongoose
13. multer -- npm i multer
14. node -- npm i node
15. nodemailer -- npm i nodemailer
16. nodemon -- npm i nodemon
17. pdfkit -- npm i pdfkit
18. react -- npm i react
19. stripe -- npm i stripe
20. validator -- npm i validator
Install the following apps:
1. MongoDB (Atlas)
2. Postman
3. Visual Studio Code
POST /admin/createAdmin/:username
Parameter | Type | Description |
---|---|---|
username |
string |
Required. The username for creating the admin. |
DELETE /admin/deleteEntity/:username/:entityType/:Username
Parameter | Type | Description |
---|---|---|
username |
string |
Required. The admin's username. |
entityType |
string |
Required. The type of entity to delete. |
Username |
string |
Required. The username of the entity to delete. |
DELETE /admin/deleteEntity2/:username/:Username
Parameter | Type | Description |
---|---|---|
username |
string |
Required. The admin's username. |
Username |
string |
Required. The username of the entity to delete. |
GET /admin/viewUnapprovedDoctors/:username
Parameter | Type | Description |
---|---|---|
username |
string |
Required. The admin's username. |
GET /admin/viewDoctorInfo/:username/:Username
Parameter | Type | Description |
---|---|---|
username |
string |
Required. The admin's username. |
Username |
string |
Required. The username of the doctor. |
POST /admin/acceptOrRejectDoctorRequest/:username/:Username
Parameter | Type | Description |
---|---|---|
username |
string |
Required. The admin's username. |
Username |
string |
Required. The username of the doctor. |
POST /admin/createContract/:username
Parameter | Type | Description |
---|---|---|
username |
string |
Required. The admin's username. |
POST /Appointment/Register
Parameter | Type | Description |
---|---|---|
(Body) | - | Prescription details to register. |
POST /Doctor/Register
Parameter | Type | Description |
---|---|---|
(Body) | - | Documents to register for a doctor. |
PUT /Doctor/updateDoctorByAffiliation/:Username
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the doctor. |
PUT /Doctor/updateDoctorByEmail/:Username
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the doctor. |
PUT /Doctor/updateDoctorByHourlyRate/:Username
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the doctor. |
GET /Doctor/docFilterAppsByDate/:Username/:Date
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the doctor. |
Date |
string |
Required. The date for filtering appointments. |
GET /Doctor/docFilterAppsByStatus/:Username/:Status
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the doctor. |
Status |
string |
Required. The status for filtering appointments. |
GET /Doctor/allAppointments/:Username
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the doctor. |
GET /Doctor/viewInfoAndRecords/:DoctorUsername/:PatientUsername
Parameter | Type | Description |
---|---|---|
DoctorUsername |
string |
Required. The username of the doctor. |
PatientUsername |
string |
Required. The username of the patient. |
GET /Doctor/MyPatients/:Username
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the doctor. |
GET /Doctor/PatientByName/:Username/:Name
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the doctor. |
Name |
string |
Required. The name of the patient to search for. |
GET /Doctor/PatientsUpcoming/:Username
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the doctor. |
GET /Doctor/selectPatientWithHisName/:DoctorId/:Username
Parameter | Type | Description |
---|---|---|
DoctorId |
string |
Required. The ID of the doctor. |
Username |
string |
Required. The username of the patient. |
POST /Doctor/addDoc
Parameter | Type | Description |
---|---|---|
(Body) | - | Details to add a doctor. |
GET /Doctor/viewContract/:DoctorUsername
Parameter | Type | Description |
---|---|---|
DoctorUsername |
string |
Required. The username of the doctor. |
POST /Doctor/acceptContract/:DoctorUsername
Parameter | Type | Description |
---|---|---|
DoctorUsername |
string |
Required. The username of the doctor. |
POST /Doctor/rejectContract/:DoctorUsername
Parameter | Type | Description |
---|---|---|
DoctorUsername |
string |
Required. The username of the doctor. |
GET /Doctor/viewWalletAmountByDoc/:DoctorUsername
Parameter | Type | Description |
---|---|---|
DoctorUsername |
string |
Required. The username of the doctor. |
GET /Doctor/viewHealthRecords/:DoctorUsername/:PatientUsername
Parameter | Type | Description |
---|---|---|
DoctorUsername |
string |
Required. The username of the doctor. |
PatientUsername |
string |
Required. The username of the patient. |
POST /Doctor/addHealthRecord/:DoctorUsername/:PatientUsername
Parameter | Type | Description |
---|---|---|
DoctorUsername |
string |
Required. The username of the doctor. |
PatientUsername |
string |
Required. The username of the patient. |
POST /Doctor/addAvailableTimeSlots/:DoctorUsername
Parameter | Type | Description |
---|---|---|
DoctorUsername |
string |
Required. The username of the doctor. |
POST /Doctor/scheduleFollowUp/:DoctorUsername/:PatientUsername
Parameter | Type | Description |
---|---|---|
DoctorUsername |
string |
Required. The username of the doctor. |
PatientUsername |
string |
Required. The username of the patient. |
GET /Doctor/doctorPastApp/:Username
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the doctor. |
POST /Doctor/createAvailableApps/:DoctorUsername
Parameter | Type | Description |
---|---|---|
DoctorUsername |
string |
Required. The username of the doctor. |
POST /Doctor/updateMedicineDosage/:DoctorUsername/:prescriptionId/:medicineName
Parameter | Type | Description |
---|---|---|
DoctorUsername |
string |
Required. The username of the doctor. |
prescriptionId |
string |
Required. The ID of the prescription. |
medicineName |
string |
Required. The name of the medicine to update dosage. |
POST /Doctor/acceptFollowUpRequest/:DoctorUsername/:PatientUsername
Parameter | Type | Description |
---|---|---|
DoctorUsername |
string |
Required. The username of the doctor. |
PatientUsername |
string |
Required. The username of the patient. |
POST /Doctor/rejectFollowUpRequest/:DoctorUsername/:PatientUsername
Parameter | Type | Description |
---|---|---|
DoctorUsername |
string |
Required. The username of the doctor. |
PatientUsername |
string |
Required. The username of the patient. |
GET /Doctor/downloadPrescriptionPDF/:DoctorUsername
Parameter | Type | Description |
---|---|---|
DoctorUsername |
string |
Required. The username of the doctor. |
POST /Doctor/addMedicineToPrescription
Parameter | Type | Description |
---|---|---|
(Body) | - | Medicine details to add to a prescription. |
POST /Doctor/addPatientPrescription/:username/:PatientUsername
Parameter | Type | Description |
---|---|---|
username |
string |
Required. The username of the doctor. |
PatientUsername |
string |
Required. The username of the patient. |
GET /Doctor/viewAllPres/:DoctorUsername/:PatientUsername
Parameter | Type | Description |
---|---|---|
DoctorUsername |
string |
Required. The username of the doctor. |
PatientUsername |
string |
Required. The username of the patient. |
PUT /Doctor/updatePrescription/:DoctorUsername/:PatientUsername/:prescriptionId
Parameter | Type | Description |
---|---|---|
DoctorUsername |
string |
Required. The username of the doctor. |
PatientUsername |
string |
Required. The username of the patient. |
prescriptionId |
string |
Required. The ID of the prescription. |
POST /Doctor/DeleteMedecineFromPrescription
Parameter | Type | Description |
---|---|---|
(Body) | - | Medicine details to delete from a prescription. |
POST /Doctor/rescheduleAppointment/:username/:appointmentId/:timeSlot
Parameter | Type | Description |
---|---|---|
username |
string |
Required. The username of the patient. |
appointmentId |
string |
Required. The ID of the appointment. |
timeSlot |
string |
Required. The new time slot for rescheduling. |
POST /Doctor/cancelAppointmentPatient/:username/:appointmentId
Parameter | Type | Description |
---|---|---|
username |
string |
Required. The username of the patient. |
appointmentId |
string |
Required. The ID of the appointment. |
POST /Doctor/cancelAppointmentPatientFamMem/:username/:appointmentId/:familyId
Parameter | Type | Description |
---|---|---|
username |
string |
Required. The username of the patient. |
appointmentId |
string |
Required. The ID of the appointment. |
familyId |
string |
Required. The ID of the family member. |
GET /Doctor/displayDoctorNotifications/:Username
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the doctor. |
POST /Doctor/sendAppointmentDoctorRescheduleNotificationEmail/:Username/:AppointmentId
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the doctor. |
AppointmentId |
string |
Required. The ID of the appointment. |
POST /Doctor/sendAppointmentDoctorCancelledNotificationEmail/:Username/:AppointmentId
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the doctor. |
AppointmentId |
string |
Required. The ID of the appointment. |
POST /Doctor/sendAppointmentDoctorNotificationEmail/:Username/:AppointmentId
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the doctor. |
AppointmentId |
string |
Required. The ID of the appointment. |
POST /FamilyMember/Register
Parameter | Type | Description |
---|---|---|
(Body) | - | Details to register a family member. |
POST /GuestDoctor/Register
Parameter | Type | Description |
---|---|---|
(Body) | - | Documents to register a guest doctor. |
IDDocument |
file |
Required. The ID document file (maxCount: 1). |
MedicalDegreeDocument |
file |
Required. The medical degree document file (maxCount: 1). |
WorkingLicenseDocument |
file |
Required. The working license document file (maxCount: 1). |
GET /HealthPackage/packages/:username
Parameter | Type | Description |
---|---|---|
username |
string |
Required. The username to retrieve health packages for. |
POST /HealthPackage/subscribe/:username
Parameter | Type | Description |
---|---|---|
username |
string |
Required. The username to subscribe to a health package. |
POST /HealthPackage/create/:username
Parameter | Type | Description |
---|---|---|
username |
string |
Required. The username to create a health package for. |
PUT /HealthPackage/updateAnnualFee/:username/:Type
Parameter | Type | Description |
---|---|---|
username |
string |
Required. The username to update the health package for. |
Type |
string |
Required. The type of update (e.g., Annual Fee). |
PUT /HealthPackage/updateDoctorSessionDiscount/:username/:Type
Parameter | Type | Description |
---|---|---|
username |
string |
Required. The username to update the health package for. |
Type |
string |
Required. The type of update (e.g., Doctor Session Discount). |
PUT /HealthPackage/updateFamilySubscriptionDiscount/:username/:Type
Parameter | Type | Description |
---|---|---|
username |
string |
Required. The username to update the health package for. |
Type |
string |
Required. The type of update (e.g., Family Subscription Discount). |
PUT /HealthPackage/updateMedicineDiscount/:username/:Type
Parameter | Type | Description |
---|---|---|
username |
string |
Required. The username to update the health package for. |
Type |
string |
Required. The type of update (e.g., Medicine Discount). |
DELETE /HealthPackage/delete/:username/:Type
Parameter | Type | Description |
---|---|---|
username |
string |
Required. The username to delete the health package for. |
Type |
string |
Required. The type of health package to delete. |
GET /HealthPackage/view/:username/:Type
Parameter | Type | Description |
---|---|---|
username |
string |
Required. The username to view health package information for. |
Type |
string |
Required. The type of health package to view. |
POST /Patient/registerPatient
Parameter | Type | Description |
---|---|---|
(Body) | - | Details to register a patient. |
POST /Patient/addFamMember/:Username
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient adding a family member. |
GET /Patient/getFamMembers/:Username
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient to retrieve family members. |
GET /Patient/findDocBySpeciality/:Username/:Speciality
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
Speciality |
string |
Required. The speciality of the doctor to find. |
GET /Patient/findDocByAvailability/:Username/:Date/:Time
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
Date |
string |
Required. The date to find available doctors. |
Time |
string |
Required. The time to find available doctors. |
GET /Patient/searchDocByName/:Username/:Name
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
Name |
string |
Required. The name of the doctor to search. |
GET /Patient/searchDocBySpec/:Username/:Speciality
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
Speciality |
string |
Required. The speciality of the doctor to search. |
POST /Patient/addPresToPatient/:Username/:id
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
id |
string |
Required. The ID of the prescription to add. |
GET /Patient/viewMyPres/:id
Parameter | Type | Description |
---|---|---|
id |
string |
Required. The ID of the patient's prescriptions. |
GET /Patient/filterMyPresBasedOnDate/:Username/:Date
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
Date |
string |
Required. The date to filter prescriptions. |
GET /Patient/filterMyPresBasedOnDoctor/:Username/:DoctorUsername
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
DoctorUsername |
string |
Required. The username of the doctor to filter prescriptions. |
GET /Patient/filterMyPresBasedOnFilled/:Username/:Filled
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
Filled |
string |
Required. The filled status to filter prescriptions. |
GET /Patient/viewAllDoctors/:Username
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
GET /Patient/viewDoctorInfo/:DoctorUsername/:PatientUsername
Parameter | Type | Description |
---|---|---|
DoctorUsername |
string |
Required. The username of the doctor. |
PatientUsername |
string |
Required. The username of the patient. |
GET /Patient/viewAllMyPres/:username
Parameter | Type | Description |
---|---|---|
username |
string |
Required. The username of the patient. |
GET /Patient/patientFilterAppsByDate/:Username/:Date
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
Date |
string |
Required. The date to filter appointments. |
GET /Patient/patientFilterAppsByStatus/:Username/:Status
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
Status |
string |
Required. The status to filter appointments. |
GET /Patient/allAppointments/:Username
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
GET /Patient/allFamilyMemberAppointments/:Username
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
PUT /Patient/choosePaymentMethodForHP/:type/:PatientUsername
Parameter | Type | Description |
---|---|---|
type |
string |
Required. The type of health package. |
PatientUsername |
string |
Required. The username of the patient. |
GET /Patient/viewWalletAmountByPatient/:PatientUsername
Parameter | Type | Description |
---|---|---|
PatientUsername |
string |
Required. The username of the patient. |
GET /Patient/health-packages/:Username
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
GET /Patient/viewSubscribedHealthPackages/:Username
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
GET /Patient/viewSubscribedHealthPackagesOfFamilyMember/:Username/:NationalID
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
NationalID |
string |
Required. The national ID of the family member. |
POST /Patient/cancelHealthCarePackageSubscriptionOfFamMember/:Username/:Type/:NationalID
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
Type |
string |
Required. The type of health package to cancel. |
NationalID |
string |
Required. The national ID of the family member. |
POST /Patient/cancelHealthCarePackageSubscription/:Username/:Type
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
Type |
string |
Required. The type of health package to cancel. |
GET /Patient/viewHealthPackages/:Username
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
GET /Patient/allAppointments/:Username
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
GET /Patient/allFamilyMemberAppointments/:Username
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
PUT /Patient/choosePaymentMethodForHP/:type/:PatientUsername
Parameter | Type | Description |
---|---|---|
type |
string |
Required. The type of health package. |
PatientUsername |
string |
Required. The username of the patient. |
GET /Patient/viewWalletAmountByPatient/:PatientUsername
Parameter | Type | Description |
---|---|---|
PatientUsername |
string |
Required. The username of the patient. |
GET /Patient/health-packages/:Username
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
GET /Patient/viewSubscribedHealthPackages/:Username
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
GET /Patient/viewSubscribedHealthPackagesOfFamilyMember/:Username/:NationalID
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
NationalID |
string |
Required. The national ID of the family member. |
POST /Patient/cancelHealthCarePackageSubscriptionOfFamMember/:Username/:Type/:NationalID
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
Type |
string |
Required. The type of health package to cancel. |
NationalID |
string |
Required. The national ID of the family member. |
POST /Patient/cancelHealthCarePackageSubscription/:Username/:Type
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
Type |
string |
Required. The type of health package to cancel. |
GET /Patient/viewHealthPackages/:Username
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
GET /Patient/viewWalletAmountByPatient/:PatientUsername
Parameter | Type | Description |
---|---|---|
PatientUsername |
string |
Required. The username of the patient. |
GET /Patient/health-packages/:Username
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
GET /Patient/viewSubscribedHealthPackages/:Username
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
GET /Patient/viewSubscribedHealthPackagesOfFamilyMember/:Username/:NationalID
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
NationalID |
string |
Required. The national ID of the family member. |
POST /Patient/cancelHealthCarePackageSubscriptionOfFamMember/:Username/:Type/:NationalID
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
Type |
string |
Required. The type of health package to cancel. |
NationalID |
string |
Required. The national ID of the family member. |
POST /Patient/cancelHealthCarePackageSubscription/:Username/:Type
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
Type |
string |
Required. The type of health package to cancel. |
GET /Patient/viewHealthPackages/:Username
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
POST /Patient/subscribeToAHealthPackage/:patientUsername/:healthPackageType
Parameter | Type | Description |
---|---|---|
patientUsername |
string |
Required. The username of the patient. |
healthPackageType |
string |
Required. The type of health package to subscribe to. |
POST /Patient/subscribeToAHealthPackageForFamilyMember/:patientUsername/:healthPackageType/:NationalID
Parameter | Type | Description |
---|---|---|
patientUsername |
string |
Required. The username of the patient. |
healthPackageType |
string |
Required. The type of health package to subscribe to. |
NationalID |
string |
Required. The national ID of the family member. |
GET /Patient/viewHealthCarePackageStatus/:Username/:healthPackageType
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
healthPackageType |
string |
Required. The type of health package. |
GET /Patient/viewHealthPackageStatusOfFamilyMember/:Username/:healthPackageType/:NationalID
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
healthPackageType |
string |
Required. The type of health package. |
NationalID |
string |
Required. The national ID of the family member. |
POST /Patient/addMedicalHistoryDocument/:username
Parameter | Type | Description |
---|---|---|
username |
string |
Required. The username of the patient. |
DELETE /Patient/deleteMedicalHistoryDocument/:Username/:filePathToRemove
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
filePathToRemove |
string |
Required. The path of the file to remove. |
GET /Patient/viewMedicalHistoryDocuments/:Username
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
GET /Patient/viewHealthRecords/:Username
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
GET /Patient/patientPastApp/:Username
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
GET /Patient/patientUpcoming/:Username
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
GET /Patient/availableDoctorApps/:Username
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
POST /Patient/selectAppointment/:patientUsername/:timeSlot/:doctorUsername
Parameter | Type | Description |
---|---|---|
patientUsername |
string |
Required. The username of the patient. |
timeSlot |
string |
Required. The selected time slot. |
doctorUsername |
string |
Required. The username of the doctor. |
POST /Patient/selectAppointmentDateTimeFamMem/:patientUsername/:timeSlot/:doctorUsername
Parameter | Type | Description |
---|---|---|
patientUsername |
string |
Required. The username of the patient. |
timeSlot |
string |
Required. The selected time slot. |
doctorUsername |
string |
Required. The username of the doctor. |
GET /Patient/downloadPrescriptionPDF/:patientUsername/:prescriptionID
Parameter | Type | Description |
---|---|---|
patientUsername |
string |
Required. The username of the patient. |
prescriptionID |
string |
Required. The ID of the prescription. |
POST /Patient/AddRefundForPatient/:username/:appointmentId
Parameter | Type | Description |
---|---|---|
username |
string |
Required. The username of the patient. |
appointmentId |
string |
Required. The ID of the appointment. |
POST /Patient/requestFollowUpAppointment/:username/:appointmentId
Parameter | Type | Description |
---|---|---|
username |
string |
Required. The username of the patient. |
appointmentId |
string |
Required. The ID of the appointment. |
POST /Patient/requestFollowUpForFamilyMember/:username/:appointmentId
Parameter | Type | Description |
---|---|---|
username |
string |
Required. The username of the patient. |
appointmentId |
string |
Required. The ID of the appointment. |
POST /Patient/linkPatientAccountAsFam/:PatientUsername
Parameter | Type | Description |
---|---|---|
PatientUsername |
string |
Required. The username of the patient. |
GET /Patient/ViewAllPres/:PatientUsername
Parameter | Type | Description |
---|---|---|
PatientUsername |
string |
Required. The username of the patient. |
GET /Patient/ViewPresDetails/:PatientUsername/:id
Parameter | Type | Description |
---|---|---|
PatientUsername |
string |
Required. The username of the patient. |
id |
string |
Required. The ID of the prescription. |
POST /Patient/rescheduleAppointment/:username/:appointmentId/:timeSlot
Parameter | Type | Description |
---|---|---|
username |
string |
Required. The username of the patient. |
appointmentId |
string |
Required. The ID of the appointment. |
timeSlot |
string |
Required. The new time slot for the appointment. |
POST /Patient/rescheduleAppointmentFamMem/:username/:appointmentId/:timeSlot
Parameter | Type | Description |
---|---|---|
username |
string |
Required. The username of the patient. |
appointmentId |
string |
Required. The ID of the appointment. |
timeSlot |
string |
Required. The new time slot for the appointment. |
POST /Patient/cancelAppointment/:username/:appointmentId
Parameter | Type | Description |
---|---|---|
username |
string |
Required. The username of the patient. |
appointmentId |
string |
Required. The ID of the appointment. |
POST /Patient/cancelAppointmentFamMem/:username/:appointmentId
Parameter | Type | Description |
---|---|---|
username |
string |
Required. The username of the patient. |
appointmentId |
string |
Required. The ID of the appointment. |
POST /Patient/createAppointmentNotifications/:Username
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
GET /Patient/displayNotifications/:Username
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
POST /Patient/sendAppointmentPatientRescheduleNotificationEmail/:Username/:AppointmentId
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
AppointmentId |
string |
Required. The ID of the appointment. |
POST /Patient/sendAppointmentPatientCancelledNotificationEmail/:Username/:AppointmentId
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
AppointmentId |
string |
Required. The ID of the appointment. |
POST /Patient/sendAppointmentNotificationEmail/:Username/:AppointmentId
Parameter | Type | Description |
---|---|---|
Username |
string |
Required. The username of the patient. |
AppointmentId |
string |
Required. The ID of the appointment. |
PUT /Patient/updatePrescriptionPaymentMethod/:username/:id
Parameter | Type | Description |
---|---|---|
username |
string |
Required. The username of the patient. |
id |
string |
Required. The ID of the appointment. |
POST /Prescription/Register
Parameter | Type | Description |
---|---|---|
(No parameters for this request) |
POST /refresh
Parameter | Type | Description |
---|---|---|
(No parameters for this request) |
POST /login
Parameter | Type | Description |
---|---|---|
(Request body with login credentials) |
POST /logout/:username
Parameter | Type | Description |
---|---|---|
username |
string |
Required. The username of the user to log out. |
POST /OtpResetPassword
Parameter | Type | Description |
---|---|---|
(Request body with necessary information) |
POST /UpdatePassword
Parameter | Type | Description |
---|---|---|
(Request body with necessary information) |
PUT /ChangePassword/:username
Parameter | Type | Description |
---|---|---|
username |
string |
Required. The username of the user whose password is being changed. |
1. Make a POST request to the login endpoint by providing your username and password in the request body.
2. Upon successful authentication, you will receive an access token in the response.
URL: POST /localhost:4000/login
Request Body (JSON):
{
"username": "your_username",
"password": "your_password"
}
After obtaining the access token, use it to authenticate subsequent requests.
1. Copy the access token received during login.
2. In the new HTTP request, set the Authorization type to "Bearer Token."
3. Paste the copied access token in the provided field.
4. Use the access token to authenticate your requests by including it in the Authorization header.
GET /your-endpoint
Request Body (JSON):
{
your-request-body
}
Authorization: Bearer your_access_token
Welcome to El7a2ny! This guide will walk you through the steps to set up and use the project. Whether you are a beginner or an experienced developer, follow these steps to get started:
Clone the repository to your local machine using the following command:
git clone https://github.com/advanced-computer-lab-2023/Suicide-squad-Clinic.git
Navigate to the project directory and install the required dependencies:
cd your-project
npm install
All the required dependencies and apps can be found under the Installation section.
Create a .env file in the root directory using the following command:
touch .env
Add the necessary environment variables:
MONGO_URI = "your-MongoDB-database-link"
PORT = your-port-number
STRIPE_KEY = your-stripe-key
PUBLISHABLE_KEY = your-publishable-key
Start the backend server by running:
nodemon App.js
Open a new terminal window, navigate to the project directory, and start the frontend server:
npm start
Open your web browser and go to http://localhost:3000 to access the application.
If it's your first time, register for a new account. Otherwise, log in using your credentials.
Explore the features and functionalities of the application. Follow the on-screen prompts and use the intuitive user interface.
If applicable, test API endpoints using tools like Postman. Refer to the "Tests" section in the README for detailed instructions.
If you encounter any issues or have suggestions, feel free to open an issue on GitHub or contribute to the project.
Congratulations! You have successfully set up and used El7a2ny. Enjoy exploring and using the application!
We welcome and appreciate contributions from the community. Whether you want to report a bug, suggest a feature, or contribute code, there are several ways you can help improve El7a2ny. Here's how you can get started:
If you come across any bugs, issues, or have suggestions for improvements, please open an issue on the GitHub repository. Be sure to provide detailed information about the problem and steps to reproduce it.
Have an idea for a new feature? Submit a feature request on GitHub, explaining the proposed feature and its potential benefits. We value your input in shaping the project.
If you're comfortable with coding, consider contributing directly to the project. Here's how you can do it:
1. Fork the repository.
2. Create a new branch for your changes.
3. Make your changes and ensure they align with the project's coding standards.
4. Test your changes thoroughly.
5. Submit a pull request with a clear description of your changes.
Good documentation is crucial for a successful project. If you notice areas where the documentation can be improved or if you have additional information to add, feel free to contribute to the documentation.
Finally, we would like to express our gratitude to our professor and TAs, who have played a crucial role in the development and success of this project:
Assoc. Prof. Mervat Abuelkheir, Eng. Nada Ibrahim, Eng. Hadwa Pasha, Eng. Noha Hamid, Eng. Fatma Elazab, Eng. Amr Diab and Eng. Mahmoud Mabrouk.
Their guidance, expertise, and support have been invaluable throughout the development process. We extend our sincere appreciation to them for their contributions.