HEXO
Building the most comprehensive medical cannabis software system in Canada.
Challenge
Create a set of systems to run compliantly Hexo's (formerly Hydropothecary) medical cannabis operations from production to sale.
Outcome
Over the course of a few years, we built a fleet of systems that allowed Hexo to go from a startup to a $1B valuation public company (Billion Dollar Start-up).
About the project
In 2015 the medical cannabis industry in Canada was in its infancy. We started working with a startup of a few who had the ambition to build one of the country's largest cannabis providers. At this early stage of the industry, there were no off-the-shelf software products that could be used to acquire the necessary licenses so our task was to build out everything needed.
Over the course of the coming months, we created numerous interconnected bespoke systems that handled different aspects of the company. These systems include a client management system for handling customer registration/prescriptions, a production and cultivation system, a webshop for selling products to clients, a packing and shipping system, and others.
We worked closely with Hexo's compliance and operations teams to analyze regulatory requirements and processes in order to determine the right solution.
Approach
Our top priority for Hexo's ecosystem has always been scalability. Over the following years, as the industry and the business advanced, we were able to flawlessly scale 100x the load on all systems and undergo numerous major upgrades due to regulatory changes. All systems and data have passed all quarterly Health Canada inspections.
We built Hexo's ecosystem using modern technology to ensure scalability and flexibility. All backend services run either Ruby or Elixir where performance and concurrency are needed, while the frontend utilizes ReactJS.
The infrastructure runs on multiple containerized environments on AWS.
Ecosystem
We built for Hexo a sophisticated ecosystem of services that communicate with each other over APIs and handle different parts of the process. Segregating the business processes into separate software systems allowed us to:
- have well-defined boundaries between functionalities;
- use different tech stacks according to the features needed;
- better handle access and permissions;
- have the option to replace services more easily.
- fault tolerance.
By the numbers
Sevices built: 14+
Team size: 8
Duration: 6 years
Technology
Elixir
Elixir is behind Hexo's most important systems. Elixir empowered us to build asynchronous functionalities, and effortlessly process hundreds of thousands of API requests, that would've required tens of server with other toolsets.
Ruby
We used Ruby and Rails to build some of the first systems of the ecosystem. Ruby and Rails allowed us to move fast when needed, without generating a lot of technical debt. Rails' conventions and object-oriented designed helped us get a lot of the initial momentum.
ReactJS
We used ReactJS is our go-to frontend framework across the board. We used it both in standalone components and in SPAs for systems used by the internal users and for client-facing features like the Registration platform and E-shop.
AWS
Hexo's ecosystem of applications run entirely on AWS since 2015. As a heavily regulated company dealing with sensitive customer data, we leveraged AWS to ensure security and stability. We leveraged numerous AWS services like ECS, PrivateLink, Redshift, DMS, CodePipeline, Lambda and many others.
They made themselves available every step of the way for years to ensure smooth operations.
HEXO, VP Regulatory Affairs
Read on Clutch