{"id":30694742,"url":"https://github.com/zet4/rates","last_synced_at":"2025-09-02T06:44:30.686Z","repository":{"id":82014271,"uuid":"246843260","full_name":"zet4/rates","owner":"zet4","description":null,"archived":false,"fork":false,"pushed_at":"2020-03-12T13:48:09.000Z","size":7,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-19T05:32:36.309Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/zet4.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":"2020-03-12T13:36:38.000Z","updated_at":"2020-05-11T14:56:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"c7e7b630-96e9-4e16-8f49-73f3e87bda2a","html_url":"https://github.com/zet4/rates","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zet4/rates","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zet4%2Frates","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zet4%2Frates/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zet4%2Frates/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zet4%2Frates/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zet4","download_url":"https://codeload.github.com/zet4/rates/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zet4%2Frates/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273244302,"owners_count":25070959,"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-09-02T02:00:09.530Z","response_time":77,"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-09-02T06:44:30.063Z","updated_at":"2025-09-02T06:44:30.617Z","avatar_url":"https://github.com/zet4.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rates\n\nRates is a microservice implemented per spec as a test project for Tet, this service is split in two parts, first is the API server that simply fetches data from database and second is the collect command that fetches currency data from RSS feed and updates the database.\n\nAs this project was implemented per spec, it does not use redis for caching queries to database, real usage would see that changed.\n\nThis is also a very simple service and thus the project layout was kept simple, more complex services would see a better laid out package structure.\n\n## Setup\n\nTL;DR;\n```\ndocker-compose up\ncat ./schema.sql | docker exec -i rates_db_1 sh -c \"exec mysql -urates -prates rates\"\ndocker exec -i rates_rates_service_1 sh -c \"exec /rates collect\"\n```\n\nStart the project by running `docker-compose up`, and populate the database by running `cat ./schema.sql | docker exec -i rates_db_1 sh -c \"exec mysql -urates -prates rates\"`, after which either run `docker exec -i rates_rates_service_1 sh -c \"exec /rates collect\"` to collect data from RSS or alternatively wait for cron task to execute (in theory)\n\nThe service should now be running and available on `localhost:8080`.\n\n## Endpoints\n\nPer spec, the service currently exposes 2 endpoints,\n* `/api/v1/rates/latest` for up-to-date currency rates\n* `/api/v1/rates/history/:currency` for historical data points for given currency.\n\nExamples with service running:\n* `http://localhost:8080/api/v1/rates/latest`\n* `http://localhost:8080/api/v1/rates/history/gbp`\n\n## Commands\n\nPer spec, the service currently exposes 2 commands,\n* `rates serve` starts the REST API server, by default on `:3333`\n* `rates collect` fetches data from defined source and updates database\nFor more details and options check `rates -h` and `rates collect -h`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzet4%2Frates","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzet4%2Frates","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzet4%2Frates/lists"}