{"id":19311025,"url":"https://github.com/a0s/chtmll","last_synced_at":"2026-05-16T09:31:49.570Z","repository":{"id":40190640,"uuid":"228721718","full_name":"a0s/chtmll","owner":"a0s","description":"Smpl prjkt for chtmll","archived":false,"fork":false,"pushed_at":"2023-03-08T20:26:54.000Z","size":60,"stargazers_count":0,"open_issues_count":7,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-17T09:23:58.679Z","etag":null,"topics":["dry-transaction","dry-validation","ruby","ruby-on-rails"],"latest_commit_sha":null,"homepage":"https://github.com/a0s/chtmll","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/a0s.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2019-12-17T23:53:25.000Z","updated_at":"2021-05-20T12:15:34.000Z","dependencies_parsed_at":"2024-11-10T00:27:32.281Z","dependency_job_id":"117ff9a2-0a90-4de6-a521-8946c91b9d56","html_url":"https://github.com/a0s/chtmll","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/a0s/chtmll","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a0s%2Fchtmll","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a0s%2Fchtmll/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a0s%2Fchtmll/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a0s%2Fchtmll/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/a0s","download_url":"https://codeload.github.com/a0s/chtmll/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a0s%2Fchtmll/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33096858,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T04:41:52.686Z","status":"ssl_error","status_checked_at":"2026-05-16T04:41:52.009Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["dry-transaction","dry-validation","ruby","ruby-on-rails"],"created_at":"2024-11-10T00:27:21.896Z","updated_at":"2026-05-16T09:31:49.554Z","avatar_url":"https://github.com/a0s.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Smpl prjkt for chtmll 🥴\n\n## Usage\n\n```shell script\ngit clone https://github.com/a0s/chtmll.git\ncd chtmll\n\nbundle install\nbundle exec rake db:create\nbundle exec rake db:migrate\n\n# Then extract your dataset into ./dataset like\n# ./dataset/categories.json\n# ./dataset/reviews.json\n# ./dataset/themes.json\n# and import it with:\nbundle exec rake import_dataset\n# or \nbundle exec rake import_dataset path=PATH_TO_DATASET\n\nbundle exec rails s # start server\n```\n\n## API Endpoints\n\n`GET /reviews` - filter reviews by theme_ids/category_ids/comments.\nExample:\n```bash\ncurl -s \"localhost:3000/reviews?comments[]=find\u0026theme_ids[]=6345\u0026theme_ids[]=6374\u0026category_ids[]=1223\u0026limit=5\" | jq\n[\n  {\n    \"id\": 58925314,\n    \"comment\": \"... SKIPPED ...\",\n    \"themes\": [\n      {\n        \"sentiment\": 1,\n        \"theme_id\": 6345\n      },\n      {\n        \"sentiment\": 1,\n        \"theme_id\": 6344\n      },\n      {\n        \"sentiment\": 1,\n        \"theme_id\": 6374\n      }\n    ]\n  },\n\n... SKIPPED ...\n\n]\n```\n\n`GET /reviews/avg_by_theme` - average sentiment for reviews filtered by theme_ids/category_ids/comments and \nsplitted by theme_id. Example:\n```bash\ncurl -s \"localhost:3000/reviews/avg_by_theme?comments[]=find\u0026category_ids[]=1223\" | jq\n[\n  {\n    \"theme_id\": 6344,\n    \"avg_sentiment\": 1\n  },\n  {\n    \"theme_id\": 6345,\n    \"avg_sentiment\": 1\n  },\n  {\n    \"theme_id\": 6349,\n    \"avg_sentiment\": -1\n  }\n]\n```\n\n`GET /reviews/avg_by_category` - average sentiment for reviews filtered by theme_ids/category_ids/comments and \nsplitted by theme id. Example:\n```bash\ncurl -s \"localhost:3000/reviews/avg_by_category?comments[]=find\u0026category_ids[]=1223\" | jq\n[\n  {\n    \"category_id\": 1223,\n    \"avg_sentiment\": 0.8666666666666667\n  }\n]\n```\n\n`POST /review` - create new review for existing theme_id\n```bash\ncurl -s -X POST --data '{\"comment\":\"ololo\", \"themes\":[{\"theme_id\":6345,\"sentiment\":1}]}' -H 'Content-Type: application/json' localhost:3000/review | jq\n{\n  \"id\": 59460021,\n  \"comment\": \"ololo\",\n  \"themes\": [\n    {\n      \"sentiment\": 1,\n      \"theme_id\": 6345\n    }\n  ]\n}\n```\n   \n## Run tests\n\n```bash\ndocker-compose --file docker/compose-test.yml up --build --abort-on-container-exit --exit-code-from chtmll --renew-anon-volumes --remove-orphans \n...\nchtmll_1    | ................................................\nchtmll_1    |\nchtmll_1    | Finished in 2.18 seconds (files took 1.49 seconds to load)\nchtmll_1    | 48 examples, 0 failures\nchtmll_1    |\ndocker_chtmll_1 exited with code 0\n```\n\n## TODO\n\n* mass async insert over rabbitmq\n* better specs\n* endpoints for creation themes and categories\n\n## Known issues\n\n1) Local development and pg gem on MacOS \n\n```bash\nbrew install postgresql@9.6\ngem install pg -v '1.1.4' -- --with-pg-config=/usr/local/Cellar/postgresql@9.6/9.6.16/bin/pg_config\n```\n \n2) Source dataset included data duplication, lets skip it during import\n\n```json\n{\n    \"comment\": \"... SKIPPED ...\", \n    \"themes\": [\n        {\n            \"theme_id\": 6374,\n            \"sentiment\": -1\n        }, \n        {\n            \"theme_id\": 6374,\n            \"sentiment\": 1\n        }, \n        {\n            \"theme_id\": 6350,\n            \"sentiment\": -1\n        }, \n        {\n            \"theme_id\": 6363,\n            \"sentiment\": -1\n        }\n    ], \n    \"created_at\": \"2019-06-18T12:22:40.000Z\", \n    \"id\": 59421588\n}\n``` \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa0s%2Fchtmll","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fa0s%2Fchtmll","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa0s%2Fchtmll/lists"}