How We Built an Online Health Consultation Marketplace
- 2124 views
Millions of people suffer from diseases due to unhealthy diets and sedentary lifestyles. Lots of health-related issues, however, can be prevented if a person gets a consultation from a qualified health practitioner and strictly follows the advice given. Yet getting an appointment with a health practitioner can be quite a challenge with the hectic lifestyles of modern people.
Pip Reed, a qualified nutrition expert and member of the Australian Natural Therapists Association, and Robbie Clark, an accredited practicing dietician, came up with the idea of TheHealthClinic, Australia’s first live online nutrition clinic that helps people keep fit and live healthy lives. TheHealthClinic allows practitioners to have live video conversations with their patients to design individual meal plans and exercise routines. Moreover, health practitioners can monitor their patients’ daily results and adjust their plans if needed. Being online, TheHealthClinic is available from any part of the world, so patients don’t need to waste time in waiting rooms and can book consultations at a time convenient for them.
When Pip and Robbie reached out to RubyGarage, their project had already been under development but they didn’t have a production version. Moreover, they wanted to significantly upgrade the application, so our team had to accomplish lots of tasks:
- Check the integrity of the existing code and analyze it for bugs and vulnerabilities
- Get the application ready for further improvements and upgrades
- Scale up the application in order to make it capable of handling lots of traffic
- Ensure scalability of the business model
- Make the application responsive and convenient for users
- Provide tools for streamlined communication between health practitioners and patients
- Make the application accessible from mobile devices via a native mobile app
- Add an ecommerce solution to let patients buy items prescribed during a consultation
- Develop content marketing solutions to attract more clients
With so many tasks to cope with, our team got down to work. Since TheHealthClinic was a startup, we had to find the best solutions in the shortest possible time.
Our rescue mission started with a thorough analysis of the initial code. We used several code quality gems (including AbstractAnalyzer, Brakeman, RailsBestPractices, and RubyCritic) and discovered lots of code smells and security vulnerabilities and several major problems with the app architecture in general. Our team implemented best practices to refactor the code and fix all critical problems.
The initial code came without automated tests, so the application was likely to malfunction if new functionalities were added. To ensure the quality of the application, our team wrote automated tests with the help of Ruby gems including RSpec, DatabaseCleaner, Capybara, VCR, and PhantomJS.
To make TheHealthClinic’s business model scalable, our team implemented full-scale marketplace functionality.
The founders of TheHealthClinic wanted to let other skilled health practitioners consult patients, so we implemented this functionality. Once approved by Pip and Robbie, other health practitioners can choose between one of two subscription models: free or paid. The difference lies in the amount of commission charged by TheHealthClinic.
Patients, in turn, can choose either basic or premium membership; needless to say, premium membership offers a richer set of features. Patients can see how much all health practitioners charge for consultations (and, thus, choose whom to consult with) and re-schedule their appointments as needed.
To make the web application responsive and user-friendly, our team decided to transform it into a single-page application that’s fast and doesn’t need to frequently refresh the page. We used AngularJS to implement dynamic page rendering.
Efficient Communication Tools
To ensure efficient communication between practitioners and patients, TheHealthClinic required live video and text chat. The initial version of the application already had a live video chat integration based on the OpenTok WebRTC platform. Our team added the Faye messaging system for live text chat. Thanks to these solutions, health practitioners can not only see their patients, but message them as well. For example, they might message the names of health products or medicines.
We also made it possible for practitioners to leave recommendations on the personal profiles of their patients.
We developed Practicall, a mobile app for iOS, to help patients receive online face-to-face consultations with health practitioners anywhere and anytime. Practicall also allows patients to message their practitioners during video calls and leave feedback after consultations.
Since health practitioners at TheHealthClinic write prescriptions, patients should be able to purchase their prescribed health solutions right on the website. Our team implemented an online store based on Spree, an effective tool for powering storefronts. Patients can buy not only health foods and supplements, but digital products as well (such as exercise and diet plans).
There are two types of exercise and diet plans to choose from: standard (generic) and custom (tailored by a practitioner individually for each patient). After patients have bought a digital product, it’s uploaded to their personal TheHealthClinic profile.
TheHealthClinic is an online clinic, so finding and attracting new users (practitioners and patients alike) requires an effective marketing strategy. First of all, our team implemented a blog managed by health practitioners; the blog helps patients quickly find answers to some of their questions. Secondly, we added a special health directory where patients can find detailed information about the most common diseases and their symptoms. Next, our team implemented support of promotional codes; health practitioners can send emails with promo codes to their patients. Finally, we made it possible for application admins to edit meta tags to optimize search engine results.
- Programming Language
- Web Server
- Nginx – a high-performance and easy-to-configure HTTP server
- PostgreSQL – an object-relational database
- Application Server
- Puma – a highly concurrent application server for Ruby on Rails
- Web Hosting
- Amazon Web Services – the world’s leading cloud services platform
- Configuration Management Tool
- Chef – a tool for server configuration and management
- Messaging System
- Faye – a publish-subscribe messaging system
- Payment Service
- Stripe – an online payment processing system
- File Storage
- Amazon S3 – highly scalable cloud-based storage
- Performance and Bug Tracking
- Airbrake – a bug tracking tool for detecting and fixing errors in code
- Social Media
- Mobile Messaging Service
- Twilio – messaging software that can send programmable SMS messages as well as make programmable voice calls and more
- Live Video and Voice Service
- OpenTok – a WebRTC platform for integrating live video chat into web applications
Working on the project, our team faced several significant challenges, so we’d like to show you how we overcame them.
Selecting the Most Suitable Payment System
Since we implemented a marketplace, the application required a reliable online payment system. Patients had to be able to pay for consultations and purchase products in the in-app store, while practitioners needed to get paid for their services. Moreover, the founders of TheHealthClinic needed to manage transactions in the payment system in order to monitor the quality of consultations and settle possible financial disputes between patients and practitioners.
Our team carried out market research to find the most suitable online payment solution. Out of several payment systems (Braintree, Stripe, PayPal, Dwolla, etc.), we opted for Stripe as it was the best in terms of management, configurability, integration, and reliability.
Stripe allowed our team to fully implement the control logic of payments in the application. Money earned by health practitioners is kept on their custom Stripe accounts (created automatically during registration), which are managed by the administrators. Once a week, administrators transfer money from these custom Stripe accounts to practitioners’ bank accounts. This allows administrators to check the quality of consultations and receive feedback from patients before making payments to health practitioners.
Making the Application Scalable
Established in Australia, TheHealthClinic had enormous potential for expansion, as it could be used by patients (as well as health practitioners) from other countries. Therefore, our team faced the challenge of building a truly scalable application that would work well if the number of users grew.
Creating a scalable application required an appropriate cloud service. Our team decided upon Amazon Web Services (AWS), the top cloud services provider in the world. AWS provides a variety of cloud-based solutions that help build amazingly scalable applications. We used several Amazon services: Amazon Simple Storage Service (also called Amazon S3) for storing and backing up files in the cloud; Amazon Relational Database Service (or simply Amazon RDS) for administering a PostgreSQL database; and Amazon Elastic Compute Cloud (commonly known as Amazon EC2) for running the application on virtual machines in combination with the Auto Scaling feature for automatically scaling Amazon EC2 capacity.
Bringing the Application to Life As Soon As Possible
The initial code we received was of terrible quality, which made any further development of the application extremely difficult. Yet TheHealthClinic was a startup, so our team had to deliver a fully-fledged application really fast.
Therefore, our team drew up a detailed plan for getting the code up and running. We started by fixing errors and bugs in the initial code. For example, it contained the Refinery CMS, which was useless in the application, so we decided to simply remove it. Also, the application didn’t have a proper authorization system, so our team added the CanCanCan gem to fix this problem. Once the initial code was put in order, we moved on to writing and running automated tests to ensure that the application was ready for further upgrades. As a result, we delivered a scalable and reliable application with smooth and secure code.
Our team successfully coped with all the tasks and delivered a top-notch application that brings together experienced health practitioners and patients. If you have an idea for a similar app, our team can help you turn it into a fully-fledged product.
Subscribe via email and know it all first!
You are subscribed!
Subscribe via email and know it all first!
You are subscribed!