Two digital health platforms
Two health start-ups needed platforms that could hold health data in Canada from day one. I took a sleep-therapy platform from a handoff package to AWS staging, and set up the cloud and review process for an AI mental-health companion.
The problem
Health data in Canada needs encryption, strong sign-in and a clear home region, before the first real user signs up.
Both clients were small teams. The platforms had to be safe and affordable to run, and easy for other developers to work in.
| CloudFront | Edge and TLS |
| ECS Fargate | Web app containers |
| RDS PostgreSQL | Row-level security, encrypted |
| Cognito | Sign-in with TOTP MFA |
| KMS | Keys stay in the region |
| CloudWatch | Alarms and budgets |
What it does
- Sign-in with MFA through Amazon Cognito
- PostgreSQL with row-level security on RDS
- Containers on ECS Fargate behind CloudFront
- Infrastructure defined in AWS CDK
- Budget alarms and paging
My role
For the sleep-therapy platform I chose the architecture, wrote the infrastructure and took it to staging with 404 tests.
For the mental-health companion I set up staging in CDK, reviewed a second developer’s 11 pull requests and split code ownership with CODEOWNERS.
| Check-in reminders | Approved |
| Settings screen | Approved |
| Session summary screen | Changes requested |
| Staging budget alarm | Approved |
| CODEOWNERS file | Approved |
Decisions
-
AWS in Canada, not Supabase
For the sleep-therapy platform I chose AWS in ca-central-1 over Supabase, so the data, keys and backups can all stay in one Canadian region.
More infrastructure to own, which I wrote in CDK so it can be rebuilt from code.
-
ECS Fargate over App Runner and Amplify
I compared App Runner, Amplify and ECS Fargate for hosting, and chose containers on Fargate behind CloudFront.
More configuration up front than a managed app host.
-
Know the cost before launch
I priced the sleep-therapy platform’s production at about US$215 a month before launch, and set budget alarms and paging on the companion’s staging.
A little more setup on the first day.
-
Review every change, split the ownership
On the mental-health companion I reviewed a second developer’s 11 pull requests and split the code with CODEOWNERS, so each part has a clear reviewer.
Every change waits for its owner’s review.
Results
- 404unit and integration tests on the sleep-therapy staging build
- $215in US dollars a month, the production estimate before launch
- 11pull requests reviewed for the second developer
- 1region for all health data: ca-central-1
Tech
- App
- Next.js, tRPC, Drizzle ORM
- Data
- Amazon RDS PostgreSQL with row-level security, KMS
- Identity
- Amazon Cognito with TOTP MFA
- Hosting
- ECS Fargate and CloudFront, defined in AWS CDK
- Operations
- CloudWatch alarms, budgets and paging
Next case study
A phone receptionist, a safety-tested website assistant, and ClientRelay, my own voice-AI receptionist product.
Hiring for a remote role in Canada? Tell me about it.
This opens your email app with your note, addressed to me.
- ekamxjot@gmail.com