{"id":31784772,"url":"https://github.com/devondragon/trt-dosage-calculator","last_synced_at":"2025-10-10T11:20:04.672Z","repository":{"id":237288180,"uuid":"794213568","full_name":"devondragon/trt-dosage-calculator","owner":"devondragon","description":"Super simple TRT dosage calculate Cloudflare Worker","archived":false,"fork":false,"pushed_at":"2025-08-06T16:38:58.000Z","size":1133,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-06T18:30:13.804Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devondragon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE_APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-04-30T17:13:48.000Z","updated_at":"2025-08-06T16:39:02.000Z","dependencies_parsed_at":"2025-04-05T16:24:04.273Z","dependency_job_id":"8e78a26a-dfcc-4d8f-a62d-21af565f5c89","html_url":"https://github.com/devondragon/trt-dosage-calculator","commit_stats":null,"previous_names":["devondragon/trt-dosage-calculator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/devondragon/trt-dosage-calculator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devondragon%2Ftrt-dosage-calculator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devondragon%2Ftrt-dosage-calculator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devondragon%2Ftrt-dosage-calculator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devondragon%2Ftrt-dosage-calculator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devondragon","download_url":"https://codeload.github.com/devondragon/trt-dosage-calculator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devondragon%2Ftrt-dosage-calculator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279003728,"owners_count":26083610,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-10T02:00:06.843Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-10T11:20:02.956Z","updated_at":"2025-10-10T11:20:04.653Z","avatar_url":"https://github.com/devondragon.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TRT Dosage Calculator\n\nA Cloudflare Worker application that calculates testosterone replacement therapy (TRT) injection dosages based on weekly dose targets, testosterone concentration, and injection frequency.\n\n## Features\n\n- 🧮 **Accurate Dosage Calculations** - Calculate injection volumes based on your prescribed weekly dose\n- 🌐 **RESTful API** - Both GET and POST endpoints with CORS support\n- 💻 **Web Interface** - User-friendly HTML form with mobile-responsive design\n- 💾 **Local Storage** - Saves user preferences for convenience\n- ⚡ **Fast \u0026 Serverless** - Deployed on Cloudflare Workers for global availability\n- 🔒 **Input Validation** - Comprehensive validation with reasonable medical limits\n- 📊 **Detailed Results** - Shows volume (ml), amount (mg), and frequency information\n\n## Quick Start\n\n### Prerequisites\n\n- Node.js (v18 or higher)\n- npm or yarn\n- Cloudflare account (for deployment)\n\n### Installation\n\n1. Clone the repository:\n```bash\ngit clone https://github.com/yourusername/trt-dosage-calculator.git\ncd trt-dosage-calculator\n```\n\n2. Install dependencies:\n```bash\nnpm install\n```\n\n3. Run locally:\n```bash\nnpm run dev\n```\n\nThe application will be available at `http://localhost:8787`\n\n### Testing\n\nRun the test suite:\n```bash\nnpm test\n```\n\nRun linting:\n```bash\nnpm run lint\n```\n\nFormat code:\n```bash\nnpm run format\n```\n\n## API Usage\n\n### Web Interface\nNavigate to the root URL to access the web calculator with a user-friendly form.\n\n### API Endpoints\n\n#### Calculate Dosage (POST)\n```bash\ncurl -X POST \"https://your-worker.workers.dev/api/v1/calculate\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n    \"targetWeeklyDose\": 100,\n    \"testosteroneStrength\": 200,\n    \"shotsPerWeek\": 2\n  }'\n```\n\n**Response:**\n```json\n{\n  \"dosePerShotMl\": \"0.250\",\n  \"dosePerShotMg\": \"50.0\",\n  \"shotsPerWeek\": \"2.00\",\n  \"frequency\": \"2 times per week\"\n}\n```\n\nFor complete API documentation, see [API_DOCUMENTATION.md](./API_DOCUMENTATION.md)\n\n## Deployment\n\nDeploy to Cloudflare Workers:\n\n```bash\nnpm run publish\n```\n\nMake sure you have configured your `wrangler.toml` with your account details.\n\n## Project Structure\n\n```\ntrt-dosage-calculator/\n├── src/\n│   └── index.ts          # Main application code (ES modules)\n├── test/\n│   └── index.test.ts     # Comprehensive test suite\n├── API_DOCUMENTATION.md  # Detailed API documentation\n├── CLAUDE.md            # AI assistant instructions\n├── package.json         # Dependencies and scripts\n├── tsconfig.json        # TypeScript configuration\n├── wrangler.toml        # Cloudflare Workers configuration\n└── README.md            # This file\n```\n\n## Input Validation\n\nThe calculator enforces the following limits for safety:\n\n- **Weekly Dose**: 0-1000 mg\n- **Testosterone Strength**: 0-500 mg/ml\n- **Shots Per Week**: 1-7\n- **Days Between Shots**: 1-30\n\n## Technology Stack\n\n- **Runtime**: Cloudflare Workers\n- **Language**: TypeScript\n- **Testing**: Jest with ts-jest\n- **Linting**: ESLint with TypeScript support\n- **Formatting**: Prettier\n- **Build Tool**: Wrangler\n\n## Recent Improvements\n\n- ✅ Modernized to ES Modules syntax\n- ✅ Added comprehensive test coverage (15+ test cases)\n- ✅ Implemented loading states and animations\n- ✅ Added localStorage for user preferences\n- ✅ Created versioned API endpoint with detailed responses\n- ✅ Added CORS support for cross-origin requests\n- ✅ Improved input validation with medical safety limits\n- ✅ Added medical disclaimer\n- ✅ Enhanced mobile responsiveness\n- ✅ Updated all dependencies to latest versions\n\n## Medical Disclaimer\n\n⚠️ **Important**: This calculator is for informational purposes only. Always consult with your healthcare provider before making any changes to your medication regimen. The calculations provided should be verified by a medical professional.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Support\n\nFor issues, questions, or suggestions, please open an issue on GitHub.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevondragon%2Ftrt-dosage-calculator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevondragon%2Ftrt-dosage-calculator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevondragon%2Ftrt-dosage-calculator/lists"}