feat: add interactive cost calculator to the hosting costs page#2101
feat: add interactive cost calculator to the hosting costs page#2101jkuester merged 87 commits intomedic:mainfrom
Conversation
…lator widget to improve logical flow.
…ed breakdown section. Adjust layout for improved readability.
…proved readability and maintainability.
… update labels for clarity.
…cing and alignment
…te instance load ranges and adjust user count limits for consistency.
…r. Update instance load range for c6g.8xlarge.
…r. Update related calculations and layout.
…lations for improved clarity.
Co-authored-by: mrjones <8253488+mrjones-plip@users.noreply.github.com>
|
@sugat009 can I get a review of the code implementation? 🙏 This has largely been implemented with Claude, but I have gone through line-by-line to cleanup/review the code and am happy with the quality of the result! The main focus was to stick to vanilla js/html/css without requiring additional libs. |
|
@eljhkrr, when you get the chance, can you help me with two things?
|
sugat009
left a comment
There was a problem hiding this comment.
LGTM! All previously flagged issues have been addressed. Just a couple of minor suggestions for quality of life improvements.
|
Thanks for the great work!
|
really like this input! |
|
Okay, thank you everyone again for your helpful input! I have updated things based on Elijah's comments (and with new data from the recommended instances):
The improvement here was largely expected because my previous numbers were assuming the tharakanithi and tanariver nodes were only serving a single CHT instance each. I balanced out these gains by increasing the default DB over-provision factor from
@mrjones-plip could you give this one final smoke test early next week just to be sure (got me all cautious here after the discussion in the TCO squad). Otherwise, I think this is ready to rock and roll! 🕺 ' |
|
The updates are looking visually really good! The applicability and warm fuzzies in seeing "Health Workers" vs "Users" is pretty amazing - I literally feel better about the numbers! I'm not just supporting rando users, I'm supporting super important health workers! I should be able to do a smoke test (if not a semi-deep dive) this afternoon. Stay tuned! |
There was a problem hiding this comment.
Yeeeessss. Feels so good to see this all come together - excellent work! Approving with one optional change and one easy CSS tweak.
Congrats @jkuester - this is HUGE
-
Maybe do a
People->Patientschange? This sounds better to me - this is entirely optional! And likely if Elijah et al. didn't flag it it's not an issue:People per Health Worker -> Patients per Health Worker
-
there's line break that happens in FF when docs responsive design is widest so left nav, center content and right nav are all showing. I believe a lil' CSS
white-space: pre;added to.inline-cost-yearlyclass fixes it but only tested on FF in all the responsive modes:.cht-cost-calculator { & .inline-cost-yearly { font-size: 1.5rem; font-weight: bold; color: var(--calc-link); white-space: pre; } }
Screencast.From.2026-03-27.17-32-04.mp4
|
Thank you @mrjones-plip for the final review! 🎉
So, I do agree that the "people" wording feels a bit awkward. However, maybe I am just mis-remembering things, but I thought we tended to avoid the word "patient" when referring to the population served by CHWs (the idea being that the CHWs (and by extension the CHT) serve "the community" in a holistic sense and are not just "treating patients" (not in the way that you might think of health workers in a clinic/hospital that just treat patients who are presenting with ailments). So, happy to go with different wording here, but not sure we would really consider the all population served by CHWs as their "patients". I will leave this as "People" for now and we can update in a future iteration. 👍
Woah, good catch! This def is a FF vs Chrome thing (as I could not repo this in Chrome, but was easily about to see it in FF). 100% agree that a bit of |
|
excellent work here! Agree with patient vs people take - thanks for the thoughtful response. |

Description
This is a little present for @mrjones-plip when he returns from the holidays! 🎄
It is a first draft of an interactive Hosting Cost estimation tool (forum thread).
It turns out it is pretty easy to add interactive HTML to your Hugo site via a custom shortcode. And, the modern CSS functionality provide very nice layout and visualization so I did not have to resort to any dependencies.
I am pretty happy with the features/layout/functionality of the whole thing, but the tuning of it could use more eyes.
One simplification that I have started with (but which could be easily refactored) is that I have only factored in the costs of 5 example EC2 instances and I try to pick one of those based on load (users * workflows). This approach has obvious limitations, but it was simple enough to let me get started with real world numbers. Definitely open to suggestions on the best way to improve this.
The other things that need more tuning are the various constant value that are used in down-stream computations:
DISK_COST_PER_GBis a rounded-up estimate from EBS.CONTACTS_PER_PLACEis roughly the "household size", but it gets used to estimate how many ancestor contacts are in the hierarchy tree (given the user input of the population size). Currently the logic assumes a completely even distribution and density of contacts throughout the tree.WORKFLOW_YEARLY_DOCS_PER_CONTACTis by far the most hand-wavy. Basically I need some way to connect how many workflows are being supported by the instance with an estimate of how many reports will be generated per year. So, in this case12means that I think we will have an average of 1 report created per month per workflow per contact. This may be way off.DOCS_PER_GBis a rough estimate that I made based on Watchdog data from a large production instance.Most of this code was written (or heavily influenced) by Claude, but I have carefully reviewed and edited it for maximum maintainability.
License
The software is provided under AGPL-3.0. Contributions to this project are accepted under the same license.