{"id":15322773,"url":"https://github.com/msfidelis/nutrition-overengineering","last_synced_at":"2025-04-14T23:35:21.179Z","repository":{"id":40650824,"uuid":"444573296","full_name":"msfidelis/nutrition-overengineering","owner":"msfidelis","description":":bread: :hamburger: :pizza: :sandwich: :egg: :bacon: - Application to calc healthcare and nutrition metrics, but using the most over engineered as possible","archived":false,"fork":false,"pushed_at":"2025-04-10T18:52:15.000Z","size":599,"stargazers_count":21,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-10T20:00:59.713Z","etag":null,"topics":["golang","grpc","jaeger","microservice","microservices","overengineering"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/msfidelis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-01-04T21:49:07.000Z","updated_at":"2025-04-10T18:52:20.000Z","dependencies_parsed_at":"2024-03-25T15:18:52.410Z","dependency_job_id":"e33b764c-ea0e-4659-9afb-d258532f3c90","html_url":"https://github.com/msfidelis/nutrition-overengineering","commit_stats":{"total_commits":33,"total_committers":1,"mean_commits":33.0,"dds":0.0,"last_synced_commit":"61cc695dc796a3f087c34792452239232637a545"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msfidelis%2Fnutrition-overengineering","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msfidelis%2Fnutrition-overengineering/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msfidelis%2Fnutrition-overengineering/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msfidelis%2Fnutrition-overengineering/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/msfidelis","download_url":"https://codeload.github.com/msfidelis/nutrition-overengineering/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248980612,"owners_count":21193135,"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","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":["golang","grpc","jaeger","microservice","microservices","overengineering"],"created_at":"2024-10-01T09:17:51.485Z","updated_at":"2025-04-14T23:35:21.171Z","avatar_url":"https://github.com/msfidelis.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nutrition Overengineering\nApplication to calc healthcare and nutrition metrics, but using the most over engineered as possible\n\n\u003e \"Caraca Matheus, tu é idiota??? \n\u003e \"Sim\"\n\n\n# Overenginner Microservices Summary\n\n* `health-api`: REST Interface for product. Using API Composition pattern. \n* `bmr-grpc`: gRPC Microservice to calc Basal Metabolic Rate\n* `imc-grpc`: gRPC Microservice to calc IMC \n* `recommendations-grpc`: gRPC Microservice to summarize diet recommendations and contabilize Macros\n* `proteins-grpc`: gRPC Microservice to calc daily protein necessity\n* `water-grpc`: gRPC Microservice to calc daily water ingestion\n* `calories-grpc`: gRPC to calc calories ingestion necessity\n* `health-data-offload`: Worker to save health-reports on data layer\n* `frontend`: VueJS SPA\n\n## Docker Images\n\n| Application                   | Image                                             | \n|-------------------------------|---------------------------------------------------|\n| health-api                    | fidelissauro/health-api:latest                    |\n| bmr-grpc-service              | fidelissauro/bmr-grpc-service:latest              |\n| imc-grpc-service              | fidelissauro/imc-grpc-service:latest              |\n| water-grpc-service            | fidelissauro/water-grpc-service:latest            |\n| calories-grpc-service         | fidelissauro/calories-grpc-service:latest         |\n| proteins-grpc-service         | fidelissauro/proteins-grpc-service:latest         |\n| recommendations-grpc-service  | fidelissauro/recommendations-grpc-service:latest  | \n| health-data-offload           | fidelissauro/health-data-offloa:latest            | \n\n## Workflow \n\n![Workflow](.github/images/workflow.png)\n\n# API  \n\n## Usage \n\n```bash\ncurl --location --request POST '0.0.0.0:8080/calculator' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{ \n   \"age\": 26,\n   \"weight\": 90.0,\n   \"height\": 1.77,\n   \"gender\": \"M\", \n   \"activity_intensity\": \"very_active\"\n} ' --silent | jq .\n```\n\n```json\n{\n    \"status\": 200,\n    \"imc\": {\n        \"result\": 28.72737719046251,\n        \"class\": \"overweight\"\n    },\n    \"basal\": {\n        \"bmr\": {\n            \"value\": 2011.7,\n            \"unit\": \"kcal\"\n        },\n        \"necessity\": {\n            \"value\": 3470.1825000000003,\n            \"unit\": \"kcal\"\n        }\n    },\n    \"health_info\": {\n        \"age\": 26,\n        \"weight\": 90,\n        \"height\": 1.77,\n        \"gender\": \"M\",\n        \"activity_intensity\": \"very_active\"\n    },\n    \"recomendations\": {\n        \"protein\": {\n            \"value\": 180,\n            \"unit\": \"g\"\n        },\n        \"water\": {\n            \"value\": 3150,\n            \"unit\": \"ml\"\n        },\n        \"calories\": {\n            \"maintain_weight\": {\n                \"value\": 3470.1825000000003,\n                \"unit\": \"kcal\"\n            },\n            \"loss_weight\": {\n                \"value\": 3123.1642500000003,\n                \"unit\": \"kcal\"\n            },\n            \"gain_weight\": {\n                \"value\": 5205.27375,\n                \"unit\": \"kcal\"\n            }\n        }\n    }\n}\n```\n\n# Jaeger and Zipkin\n\n## Using Tracing between services \n\nTo use jaeger tracing with zipkin you can specify environment variable called `ZIPKIN_COLLECTOR_ENDPOINT`. \n\n```bash\nexport ZIPKIN_COLLECTOR_ENDPOINT=http://jaeger:9411/api/v2/spans\n```\n\n![Jaeger Tracing](.github/images/jaeger-tracing.png)\n\n![Jaeger Map](.github/images/jaeger-map.png)\n\n\n\n# TODO\n* Refactor communication lib \n* Customize log lib for trace id\n* Error Handling and Retries\n* Implement Prometheus HTTP Endpoint\n* Create Kubernetes Deployment\n* Create Istio Manifests to Service Mesh gRPC Optimizations\n\n## Notes \n\n```\nbrew install grpc protobuf protoc-gen-go-grpc\nprotoc --proto_path=proto/bmr --go_out=proto/bmr --go_out=plugins=grpc:bmr --go_opt=paths=source_relative proto/bmr/bmr.proto\nprotoc --go_out=plugins=grpc:bmr bmr.proto\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsfidelis%2Fnutrition-overengineering","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsfidelis%2Fnutrition-overengineering","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsfidelis%2Fnutrition-overengineering/lists"}