HRT Recorder Web(HRT 网页记录工具)
A privacy-focused, web-based tool for simulating and tracking estradiol levels during Hormone Replacement Therapy (HRT).
这是一个注重隐私的网页工具,用于在激素替代疗法(HRT)期间模拟和追踪雌二醇水平。
The pharmacokinetic algorithms, mathematical models, and parameters used in this simulation are derived directly from the HRT-Recorder-PKcomponent-Test repository.
本模拟中使用的药代动力学算法、数学模型与相关参数,直接来源于 HRT-Recorder-PKcomponent-Test 仓库。
We strictly adhere to the PKcore.swift and PKparameter.swift logic provided by @LaoZhong-Mihari, ensuring that the web simulation matches the accuracy of the original native implementation (including 3-compartment models, two-part depot kinetics, and specific sublingual absorption tiers).
我们严格遵循 @LaoZhong-Mihari 提供的 PKcore.swift 与 PKparameter.swift 中的逻辑,确保网页端模拟与原生实现在精度上保持一致(包括三室模型、双相肌注库房动力学以及特定的舌下吸收分层等)。
The core logic has been split into small, focused modules so pharmacokinetics,
calibration, personal learning, and data encryption can evolve more safely and
be understood more quickly by new contributors.
当前核心逻辑已经拆分为几个职责清晰的小模块,便于后续维护、继续贡献,以及让新协作者更快理解项目结构。
Current module map:
当前模块关系如下:
-
types.ts- Shared domain enums and interfaces such asDoseEvent,LabResult, andSimulationResult.
types.ts:共享的数据模型与类型定义,例如DoseEvent、LabResult、SimulationResult。 -
pk.ts- Population PK constants, route-specific parameter resolution, the main simulation engine, and interpolation helpers.
pk.ts:基础药代参数、给药途径参数解析、主模拟引擎,以及插值工具。 -
calibration.ts- Lab unit conversion, legacy ratio-based calibration, and the Bayesian OU-Kalman calibration model.
calibration.ts:化验值单位转换、旧版比值校准,以及 Bayesian OU-Kalman 动态校准模型。 -
personalModel.ts- EKF-based personal learning, E2/CPA personalized estimation, and confidence interval generation.
personalModel.ts:基于 EKF 的个体化学习、E2/CPA 个体估算,以及置信区间生成。 -
src/utils/dataEncryption.ts- Generic AES-GCM helpers for import/export payload encryption.
src/utils/dataEncryption.ts:用于导入导出数据的通用 AES-GCM 加密工具。 -
logic.ts- Compatibility barrel file that re-exports the public API used by the UI.
logic.ts:兼容层与统一出口,对 UI 暴露稳定的公共接口。
Dependency direction:
依赖方向:
types.ts → pk.ts → (calibration.ts, personalModel.ts) → logic.ts
This keeps the mathematical foundation reusable while letting higher-level
calibration and personalization layers build on top of the same PK model
without duplicating formulas.
这样可以保证药代数学底座只维护一份,而校准层与个体化学习层都能在同一套 PK 模型之上构建,避免重复实现和参数漂移。
-
Multi-Route Simulation: Supports Injection (Valerate, Benzoate, Cypionate, Enanthate), Oral, Sublingual, Gel, and Patches.
多给药途径模拟:支持注射(戊酸酯 Valerate、苯甲酸酯 Benzoate、环戊丙酸酯 Cypionate、庚酸酯 Enanthate)、口服、舌下、凝胶以及贴片等多种给药方式。
-
Real-time Visualization: Interactive charts showing estimated estradiol concentration (pg/mL) over time.
实时可视化:通过交互式图表展示随时间变化的雌二醇估算浓度(pg/mL)。
-
Sublingual Guidance: Detailed "Hold Time" and absorption parameter (
$\theta$ ) guidance based on strict medical modeling.舌下服用指导:基于严格的医学建模,提供详细的“含服时间(Hold Time)”与吸收参数($\theta$)参考。
-
Privacy First: All data is stored entirely in your browser's
localStorage. No data is ever sent to a server.隐私优先:所有数据都完全存储在你浏览器的
localStorage中,绝不会发送到任何服务器。 -
Internationalization: Native support for Simplified Chinese and English, Cantonese, Russian, Ukrainian and more.
多语言支持:原生支持多语言界面。
This project is built with React and TypeScript. You can run it easily using a modern frontend tooling setup like Vite.
本项目基于 React 与 TypeScript 构建,你可以使用诸如 Vite 这样的现代前端工具链轻松运行它。
-
Clone or Download the files.
Clone 或下载项目文件到本地。 -
Initialize a Vite project (if starting from scratch):
初始化一个 Vite 项目(如果你是从零开始):npm create vite@latest hrt-recorder -- --template react-ts cd hrt-recorder npm install -
Install Dependencies:
安装依赖:npm install recharts lucide-react uuid @types/uuid clsx tailwind-merge
-
Setup Tailwind CSS:
配置 Tailwind CSS:Follow the Tailwind CSS Vite Guide to generate your
tailwind.config.js. 请按照 Tailwind CSS 的 Vite 指南 配置并生成你的tailwind.config.js文件。 -
Add Code:
添加代码:-
Place
logic.tsandindex.tsxinto yoursrc/folder.
将logic.ts与index.tsx放入你的src/文件夹中。 -
Update
index.htmlentry point if necessary.
如有需要,更新index.html中的入口配置。
-
-
Run:
运行项目:npm run dev
You are very welcome to deploy this application to your own personal website, blog, or server!
我们非常欢迎你将此应用部署到自己的个人网站、博客或服务器上!
We want this tool to be accessible to everyone who needs it. You do not need explicit permission to host it.
我们希望所有需要这款工具的人都能方便地使用它。你无需额外获得授权即可自行托管与部署。
Attribution Requirement:
If you deploy this app publicly, please:
如果你将该应用公开部署,请:
-
Keep the original algorithm credits: Visibly link back to the HRT-Recorder-PKcomponent-Test repository.
保留原始算法的鸣谢信息:在显眼位置添加指向 HRT-Recorder-PKcomponent-Test 仓库的链接。
-
Respect the license: Ensure you follow any licensing terms associated with the original algorithm code.
遵守许可协议:确保你遵循原始算法代码所适用的全部许可条款。
I wish you a smooth transition and Happy Estimating! 🏳️⚧️
祝你性转顺利,快乐估测(>^ω^<)
同时,祝所有用此 webapp 的停经期女性身体健康 ❤️
At the same time, I wish good health to all the women using this web app who are going through menopause. ❤️
- Add Japanese language localization support
- Add testosterone calculation support
- 给每个人通过做六项后的数据进行校准,多次校准后改变动力学方程的参数
本项目遵守 MIT Licence