HealMate is an online platform designed to bridge the gap between patients and medical specialists. It allows users to easily find, book, and consult with professionals from various medical fields such as dermatology, psychology, and optometry. The project is part of the Code Institute's Full-Stack Developer course and focuses on Django framework, database manipulation, and CRUD functionality.
Live site: HealMate
For Admin access with relevant sign-in information, click here.
Github repository, click here.
HealMate is an online platform that allows users to:
The platform ensures accessibility across all devices and browsers, and its goal is to streamline the process of finding and scheduling medical consultations. In future iterations, HealMate will add functionality for healthcare providers to manage their schedules, send reminders to patients, and offer tools for patient-doctor communication.
My inspiration for HealMate came from a personal experience during a routine visit to my GP. I thought about how many medical consultations, especially those that don’t require physical examinations, could easily be handled online. This thought extended to pregnant women, who often need guidance and reassurance from their midwives or doctors but don’t necessarily need an in-person visit. The convenience of a digital platform for such consultations became clear. The name HealMate reflects the idea of a supportive, reliable partner in managing one's health—much like popular health apps such as ClueMate, where ‘Mate’ signifies companionship and guidance in managing health.
In line with the healthcare theme, I chose a neutral, clean palette:
The primary objective of HealMate is to bridge the gap between patients and healthcare providers. By offering an intuitive interface, users can easily search for medical professionals, book appointments, and receive necessary care without hassle.
I used an agile approach to project management. The HealMate development process was broken into sprints, and tasks were added to the GitHub project board to be tracked and managed through issues.
The HealMate platform will include the following MVP functionalities:
The site is structured around an easy-to-use interface. The primary menu includes links to specialist searches, appointment bookings, and user profile management.
Wireframes were created for the following key pages to ensure an intuitive user journey:
Wireframes were designed using Balsamiq, ensuring responsiveness across devices.
The ERD for HealMate illustrates the relationships between the users, specialists, appointments, and more. This is essential to demonstrate the relationships between the different models in the PostgreSQL database.
The ERD also demonstrates the platform's role-based structure. Each user is assigned to a specific group (patient, specialist, or admin) that determines their access level. PatientProfile and SpecialistProfile models are linked to the User model, and each profile type has specific fields relevant to their role. Admins have broader access to manage both specialist vetting and platform data.
The above ERD was generated using Python Extension - pygraphviz and pydotplus. Documentation at https://django-extensions.readthedocs.io/en/latest/graph_models.html.
All data is securely handled with Django’s security features, including:
Role-based access control (RBAC) is implemented using Django's Group and Permission systems. Patients, specialists, and admins are grouped based on their role, and their access to features and sensitive information is restricted accordingly. Patients can only access their own medical data and booking history, while specialists can only view data related to their consultations. Admins have the broadest access for system management.
HealMate offers distinct user views. Unregistered users can search for specialists, but registered users have full access to the appointment system and dashboard functionalities.
Patients: When a new user registers, they are automatically assigned to the "Patient" group. This ensures that all users begin with patient privileges and access, allowing them to book appointments and view specialist profiles. During the registration process, essential patient profile information is captured (e.g., contact number, address, date of birth, gender). After the registration is complete, a corresponding PatientProfile is automatically created and associated with the user.
Specialists: During the registration process, essential patient profile information is captured (e.g., contact number, address, date of birth, gender). After the registration is complete, a corresponding PatientProfile is automatically created and associated with the user.
Admins: Admin accounts are created manually by other existing admins or superusers within the Django administration area. This ensures that the creation of administrative-level accounts is strictly controlled and follows the platform's internal policies.
This registration flow was chosen to ensure role-based control and security. Patients are the primary users of the platform, and allowing them to register freely makes the service accessible. However, specialists and admins require a higher level of trust and validation, so they undergo a manual vetting process. This ensures that only qualified professionals and authorized admins can manage sensitive tasks such as consultations and platform settings, which helps maintain the integrity and security of the system.
HealMate includes role-based dashboards for different types of users:
Patient Dashboard: Allows patients to view their profile, manage appointments, and access medical records.
Specialist Dashboard: Specialists can manage their availability, view and approve appointments, and review patient profiles.
Admin Dashboard: Admins can manage users (patients, specialists) and vet specialist applications. They also have access to system-wide settings.
(Not the same as Role-Based Dashboard Features)
The navigation bar in HealMate adapts dynamically based on the user's role. This feature ensures that users see only the relevant options for their role, improving usability and reducing clutter in the interface.
This role-based navigation provides a tailored experience for every user type, streamlining access to the most relevant pages.
HealMate includes a soft delete mechanism to ensure data integrity and prevent accidental loss of important user information. Instead of permanently deleting accounts, users can request a soft deletion, which deactivates their account while retaining their data in the system.
How It Works:
Benefits:
HealMate allows patients to book appointments with specialists directly through the platform. The system includes:
HealMate provides a secure messaging system for communication between patients and specialists:
Each user can manage their profile through the dashboard:
The following CRUD functionalities are implemented within HealMate:
Create: Patients are automatically assigned a profile upon registration. This profile includes key fields such as contact information, address, and medical history.
Read: Patients can view their profile and associated information, including medical history and emergency contact details, from their dashboard.
Update: Patients have the ability to update their profile information, including personal data (e.g., contact number, address, and medical history), via a dedicated "Edit Profile" page.
Delete (Soft Delete): Patients can request to deactivate their account through a soft delete mechanism. This deactivation preserves the patient’s data within the system while preventing further access until reactivation by an admin. The admin can reactivate the account from the Django admin panel at any time, restoring full access for the patient.
This CRUD cycle is central to the PatientProfile model, ensuring that users can fully manage their personal information while providing system integrity with the soft delete functionality.
I plan to implement the following in future iterations:
All code has been validated through:
DISABLE_COLLECTSTATIC
Setting Causing Heroku Deployment FailureIssue:
During the deployment to Heroku, the following error occurred:
The error was caused by the absence of proper static file handling and a misconfiguration in the INSTALLED_APPS
list in settings.py
.
Cause:
DISABLE_COLLECTSTATIC=1
config variable was used in Heroku to prevent collectstatic from running during the initial setup.django.contrib.staticfiles
in INSTALLED_APPS
, which caused an error when trying to collect static files.Steps Taken to Fix:
django.contrib.staticfiles
entry in INSTALLED_APPS
.DISABLE_COLLECTSTATIC=1
from Heroku's Config Vars.Issue
Users are unable to access the Admin, Patient, and Specialist dashboards even though they are assigned to the correct user groups in the Django admin panel. The application either throws a 403 Forbidden error or does not recognize the users' group memberships.
Cause
The issue seems to be related to incorrect handling of group membership checks in the views or misconfiguration of user group assignments within the Django admin panel.
Investigate Group Check Functions:
is_admin
, is_patient
, is_specialist
) in views.py
to ensure they correctly identify user groups.Validate Group Assignments:
Testing:
Revert Changes:
Verify Access Control:
PermissionDenied
logic displayed the correct 403 error page for unauthorized access attempts.Outcome
The problem was successfully resolved, allowing users to access their respective dashboards based on group membership without encountering 403 errors or redirection issues.
The form on the homepage not visible due to conflicting view usage. The homepage should display a form that allows users to search for specialists, but the form did not appear as expected.
The conflict arises from the use of both a class-based HomePage
view and a function-based home
view. The class-based view does not properly pass the specialties
context required to render the form on the homepage.
Update URLs:
core/urls.py
to replace the class-based HomePage
view with the function-based home
view to ensure the correct context is passed.Verify Context Passing:
specialties
context was properly passed to index.html
so that the form could display the list of specialties dynamically.Test Form Visibility and Functionality:
Commit Changes:
The form is now visible on the homepage and correctly displays the list of specialties, allowing users to search for specialists as intended. The conflict between the views was resolved by using the appropriate function-based view that properly passes the necessary context.
A Django signal intended to automatically assign new users to the "Patients" group and create a PatientProfile
upon registration was not firing. This led to no profile being created and no group being assigned after user registration.
The issue was caused by an incorrect configuration of the AccountsConfig
class in INSTALLED_APPS
in settings.py
and missing signal imports in the ready()
method of accounts/apps.py
.
Correct Configuration in INSTALLED_APPS:
INSTALLED_APPS
in settings.py
to reference 'accounts.apps.AccountsConfig'
instead of just 'accounts'
. This ensured that the custom AppConfig class was properly loaded.Add Signal Imports in ready()
Method:
ready()
method in accounts/apps.py
to correctly import the signal handlers, ensuring they were registered when the app was loaded.Remove Debug Statements:
The signal is now correctly triggered upon user registration, resulting in the automatic assignment of new users to the "Patients" group and the creation of a PatientProfile
as intended. The configuration in INSTALLED_APPS
and signal registration were successfully fixed.
Specialists encountered multiple issues when trying to set their availability. Initially, a 405 Method Not Allowed error occurred upon form submission. After fixing that, the start time was not displayed on the specialist dashboard, while the end time appeared correctly.
405 Method Not Allowed:
post
method was missing from the SpecialistDashboardView
class in dashboard/views.py
, resulting in the 405 error when attempting to submit availability.Missing Start Time:
start_time
was not displayed on the specialist dashboard due to a missing template tag ({{ availability.start_time }}
) in the "Your Availability" section.Handle POST Method in View:
post
method to SpecialistDashboardView
in dashboard/views.py
to properly handle form submissions, resolving the 405 Method Not Allowed error.Fix Start Time Rendering in Template:
{{ availability.start_time }}
tag, ensuring that both the start_time
and end_time
are displayed in the "Your Availability" section.Specialists can now successfully submit their availability without encountering the 405 error. Both start_time
and end_time
are displayed correctly on the specialist dashboard, providing a complete view of their available times for appointments.
The incorrect template was being rendered for specialist search results on the HealMate platform. A secondary search_results.html
template in a different directory was causing confusion, leading to a simplified search results page being displayed. Key features like specialist bio, profile image, and pagination were missing.
An additional search_results.html
template was located inside the global /templates/specialists/
directory. This template had minimal content and was unintentionally overriding the correct search_results.html
template in the /specialists/templates/specialists/
directory.
Isolate Problematic Template:
/templates/specialists/
directory to determine if it was the source of the issue.Confirm and Resolve Issue:
/templates/specialists/
directory and its contents.Verify Correct Template Rendering:
search_results.html
template inside /specialists/templates/specialists/
is now rendering, displaying all necessary features, including the specialist bio, profile image, and pagination.The correct template for specialist search results is now rendering as intended. The page displays all relevant information, including specialist bio, profile images, and pagination, providing users with a complete view of search results.
All code for this project was written in Visual Studio/Gitpod as the integrated development environment. GitHub was used for version control, and the application was deployed to Heroku from GitHub.
To ensure a successful deployment to Heroku, the following practices are to be followed (Experience from previous Django projects):
requirements.txt
file must be kept up to date to ensure all imported Python modules are configured correctly for Heroku.Procfile
was added to configure the application as a Gunicorn web app on Heroku.settings.py
, the ALLOWED_HOSTS
list was configured to include the Heroku app name and localhost
. Example format:
ALLOWED_HOSTS = ['your-app-name.herokuapp.com', 'localhost']
DATABASE_URL
, CLOUDINARY_URL
, and SECRET_KEY
were added to the .env
file, which is ignored by Git using .gitignore
. These variables are added to Heroku manually through the Config Vars section.The steps for deploying to Heroku are as follows (Experience from previous Django projects):
The live link for this project can be found here: HealMate
git clone https://github.com/easybulb/healmate
Note: The difference between a clone and a fork is that with a clone, you need permission to push changes to the original repository, whereas a fork creates an entirely new project under your GitHub account.
As part of my HealMate project, I am dedicated to ensuring that users’ personal data is handled responsibly. The following privacy practices outline how information is collected, used, and stored within this academic project.
Data Collection: HealMate, as a project, collects personal data during user registration and profile setup. This includes:
Data Usage: The information gathered is used solely for educational purposes, including:
Data Sharing: As this is a student project, personal data will not be shared with any third parties. It will only be used for demonstrating the functionality of the project. All information remains confidential and will not be distributed beyond the scope of the HealMate project.
Security: While this project is intended for educational use, I strive to implement best practices for data security using the Django framework’s built-in tools. Personal information is securely stored in the database and protected against unauthorized access.
User Rights: Users of this platform, as part of this project, have the right to request modifications or deletion of their data. For any requests or concerns about personal data usage in this project, please contact the project owner at the provided email address.
Since this is an educational project, the privacy and data handling policies may evolve over time as more features are added and refined.
I would like to extend my heartfelt gratitude to the following individuals and organizations whose support, guidance, and inspiration have been invaluable in the development of this project.
Amy Richardson – Sincere gratitude to Amy, our tutor and facilitator, whose unwavering guidance and expertise were pivotal throughout this journey. Her mentorship provided the clarity and support needed to navigate challenges, ultimately elevating the quality of this project. Her dedication and encouragement made a profound impact on my progress and learning.
Mark Briscoe – A heartfelt thank you to Mark, our dedicated tutor, whose unwavering support, insightful feedback, and constructive criticism were instrumental in guiding this project to completion. His depth of knowledge and encouragement not only enhanced my understanding but also inspired me to consistently improve my work. This project would not have been the same without his invaluable mentorship.
This project would not have been possible without the support, advice, and inspiration of each individual and organization mentioned. Thank you for being a part of this journey.