{"id":16367618,"url":"https://github.com/mmontes11/crypto-trade","last_synced_at":"2025-10-26T07:30:45.399Z","repository":{"id":53588595,"uuid":"321418810","full_name":"mmontes11/crypto-trade","owner":"mmontes11","description":"Cryptocurrency trading PoC","archived":false,"fork":false,"pushed_at":"2023-02-23T17:43:54.000Z","size":105,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-01-31T16:46:24.310Z","etag":null,"topics":["clickhouse","crypto","cryptocurrency","docker","github-actions","go","golang","helm","helm-charts","kubernetes","nats","trading"],"latest_commit_sha":null,"homepage":"https://crypto-trade.mmontes-dev.duckdns.org","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/mmontes11.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}},"created_at":"2020-12-14T17:11:49.000Z","updated_at":"2024-10-24T15:41:47.000Z","dependencies_parsed_at":"2024-06-19T11:31:06.427Z","dependency_job_id":"9f3115e7-3c1a-45e9-8b7a-321626dc4c43","html_url":"https://github.com/mmontes11/crypto-trade","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmontes11%2Fcrypto-trade","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmontes11%2Fcrypto-trade/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmontes11%2Fcrypto-trade/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmontes11%2Fcrypto-trade/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mmontes11","download_url":"https://codeload.github.com/mmontes11/crypto-trade/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238284741,"owners_count":19446720,"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":["clickhouse","crypto","cryptocurrency","docker","github-actions","go","golang","helm","helm-charts","kubernetes","nats","trading"],"created_at":"2024-10-11T02:50:23.969Z","updated_at":"2025-10-26T07:30:40.118Z","avatar_url":"https://github.com/mmontes11.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# crypto-trade\n[![Lint](https://github.com/mmontes11/crypto-trade/workflows/Lint/badge.svg)](https://github.com/mmontes11/crypto-trade/actions?query=workflow%3ALint)\n[![Build](https://github.com/mmontes11/crypto-trade/workflows/Build/badge.svg)](https://github.com/mmontes11/crypto-trade/actions?query=workflow%3ABuild)\n[![Test](https://github.com/mmontes11/crypto-trade/workflows/Test/badge.svg)](https://github.com/mmontes11/crypto-trade/actions?query=workflow%3ATest)\n[![Release](https://github.com/mmontes11/crypto-trade/workflows/Release/badge.svg)](https://github.com/mmontes11/crypto-trade/actions?query=workflow%3ARelease)\n[![Deploy](https://github.com/mmontes11/crypto-trade/workflows/Deploy/badge.svg)](https://github.com/mmontes11/crypto-trade/actions?query=workflow%3ADeploy)\n\n[![Artifact HUB](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/mmontes)](https://artifacthub.io/packages/search?repo=mmontes)\n[![Go Report Card](https://goreportcard.com/badge/github.com/mmontes11/crypto-trade)](https://goreportcard.com/report/github.com/mmontes11/crypto-trade)\n[![Go Reference](https://pkg.go.dev/badge/github.com/mmontes11/crypto-trade.svg)](https://pkg.go.dev/github.com/mmontes11/crypto-trade)\n\nSimulates real time cryptocurrency tradings in a microservice ecosystem.\n\n---\n\n- [Tech stack](#tech-stack)\n- [How it works](#how-it-works)\n- [Installation](#installation)\n- [API](#api)\n- [Production environment](#production-environment)\n\n---\n\n## Tech stack\n\n- [Go](https://golang.org/)\n- [Nats](https://nats.io/)\n- [ClickHouse](https://clickhouse.tech/)\n- [Docker](https://www.docker.com/)\n- [Kubernetes](https://kubernetes.io/)\n- [Helm](https://helm.sh/)\n- [GitHub actions](https://github.com/features/actions)\n\n## How it works\n\nIt contists in 3 microservices:\n- **publisher**: Generates random trades and sends them to Nats.\n- **subscriber**: Receives trades and stores them in ClickHouse.\n- **api**: Exposes a REST API with the trades from ClickHouse.\n\n## Installation\n\n###### Local\n\n1. Set up Nats and ClickHouse:\n```bash\n$ docker-compose -f docker-compose.services.yml up -d\n```\n2. Start each microservice in a different tab by manually running:\n```bash\n$ make run\n```\n###### Local + Tmux\n\nInstall [tmux](https://github.com/tmux/tmux) and then:\n```bash\n$ ./scripts/run-dev.sh\n```\n###### Docker\n\n```bash\n$ ./scripts/run-docker.sh\n```\n## API\n\n[![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/155f5c6f3ba941caed61#?env%5Bcrypto-trade%20PRO%5D=W3sia2V5IjoidXJsIiwidmFsdWUiOiJodHRwczovL2NyeXB0by10cmFkZS5tbW9udGVzLWRldi5kdWNrZG5zLm9yZyIsImVuYWJsZWQiOnRydWV9XQ==)\n\n###### GET /health\n\nIndicate the service is up and running.\n\nResponses:\n- **200 OK**\n\n###### GET /api/trades\n\nRetrieves real time cryptocurrency trades. \n\nQuery params:\n- **groupBy**: second | minute | hour\n- **crypto**: btc | eth\n- **currency**: eur | usd\n- **fromDate**: 1970-01-01T00:00:00Z\n- **toDate**: 2050-01-01T00:00:00Z\n- **limit**: 100\n\nResponses:\n- **200 OK**\n- **404 Not Found**\n\nBody:\n- Array of trades\n\n\n## Production environment\n\n[https://crypto-trade.mmontes-dev.duckdns.org/api/trades?groupBy=hour\u0026crypto=btc\u0026currency=eur\u0026fromDate=2021-01-01T00:00:00Z](https://crypto-trade.mmontes-dev.duckdns.org/api/trades?groupBy=hour\u0026crypto=btc\u0026currency=eur\u0026fromDate=2021-01-01T00:00:00Z)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmontes11%2Fcrypto-trade","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmmontes11%2Fcrypto-trade","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmontes11%2Fcrypto-trade/lists"}