While working for cleared I developed the backend for their main services from scratch until their acquisition by LifeMD.
The codebase was based on Santiago Quinteros’ Bulletproof Node. I used mappers, entities and DTOs to separate domains.
The server supported multiple services:
One interesting challenge we had was that we needed to be notified when the status of a case changed, but the related third party API didn’t provide webhooks. So I “emulated” webhooks by polling their API at a regular interval. With this came the added benefit of using /events over /webhooks - we can view a record of past events by hitting the endpoint, and avoid the risk of lost webhooks. This all makes achieving idempotency easier.
The server handled many functions, each requiring it’s own planning - dynamic product recommendations, PDF generation, payment processing, processing quiz machine submissions and processing EHR cases from trained physicians.