{"id":28396478,"url":"https://github.com/kolesnikova-dev/stock-aggregator","last_synced_at":"2025-07-14T03:33:30.005Z","repository":{"id":277189837,"uuid":"931622489","full_name":"kolesnikova-dev/stock-aggregator","owner":"kolesnikova-dev","description":"This repository contains a Stock Market Aggregator script built with Go","archived":false,"fork":false,"pushed_at":"2025-02-25T19:16:58.000Z","size":124,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-01T08:44:31.538Z","etag":null,"topics":["concurrency","go","gochannels","optimized-performance"],"latest_commit_sha":null,"homepage":"","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/kolesnikova-dev.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,"zenodo":null}},"created_at":"2025-02-12T15:33:16.000Z","updated_at":"2025-02-25T19:17:01.000Z","dependencies_parsed_at":"2025-05-05T20:49:52.496Z","dependency_job_id":null,"html_url":"https://github.com/kolesnikova-dev/stock-aggregator","commit_stats":null,"previous_names":["kweeuhree/stock-aggregator","kolesnikova-dev/stock-aggregator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kolesnikova-dev/stock-aggregator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kolesnikova-dev%2Fstock-aggregator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kolesnikova-dev%2Fstock-aggregator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kolesnikova-dev%2Fstock-aggregator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kolesnikova-dev%2Fstock-aggregator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kolesnikova-dev","download_url":"https://codeload.github.com/kolesnikova-dev/stock-aggregator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kolesnikova-dev%2Fstock-aggregator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265237696,"owners_count":23732514,"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":["concurrency","go","gochannels","optimized-performance"],"created_at":"2025-05-31T22:06:27.095Z","updated_at":"2025-07-14T03:33:29.986Z","avatar_url":"https://github.com/kolesnikova-dev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📈 Stock Market Aggregator\n\nThis repository contains a **Stock Market Aggregator** CLI program built with Go.\n\n## 🧑‍💻 About the Project\n\nThe project is designed to collect **stock market data** from free APIs (MarketStack, FMPCloud, and FinHub) and aggregate the data to show the **average price** of stocks, given a user inputs a stock ticker into a prompt.\n\n---\n\n### 🎯 Project Goal\n\nThe main goal of this project is to implement **Go-native concurrency patterns** and apply them in a real-world scenario of fetching and processing stock data.\n\nTesting goal is to keep testing coverage above 80%.\n\n---\n\n### 📷 Screen Capture\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"assets/aggregator.png\" alt=\"Stock Price Aggregator CLI program screenshot\"\u003e\n\u003c/p\u003e\n\n---\n\n### 📋 Project Breakdown\n\n**Main Program** initializes the application, sets up logging, and controls the flow between data fetching and aggregation.\n\n- Loads environment variables (using the godotenv package).\n- Initializes logging for information and error messages.\n- Creates instances of the Fetcher and Aggregator modules.\n- Fetches stock data by calling the Fetcher's Fetch function.\n- Passes the fetched data to the Aggregator to aggregate the stock prices.\n\n**Data Fetching** retrieves stock data from free stock market APIs, concurrently.\n\n- Fetches stock data using multiple free APIs (such as FMP Cloud).\n- Each URL request is handled concurrently using Go's goroutines, ensuring efficient data fetching.\n- Errors are logged if there are any issues with the API requests.\n- The Fetch method of the Fetcher returns the raw data for further processing.\n\n**Data Aggregation** aggregates the fetched stock data.\n\n- Receives the fetched stock data from the Fetcher.\n- For now, the method only logs that aggregation is attempted (to be expanded in future development).\n\n**Utility functions**\n\n- Converting a slice of interfaces into a slice of maps\n- Rounding a float64 to two decimals\n- Pretty printing a JSON object to improve readabilty\n\n---\n\n### 🧪 Testing\n\nBuilt-in `testing` library is used for unit and integration tests.\nCurrent coverage: 85.9% of statements of fetcher package.\n\n---\n\n### 😃 Code Snippets I am excited about\n\n\u003cfieldset align=\"center\"\u003e\n\u003clegend align=\"left\"\u003eRequesterParser struct allows for modularity and easy testing\u003c/legend\u003e\n\u003cimg src=\"assets/requester.png\" alt=\"Fetcher and RequesterParser structs\"\u003e\n\u003c/fieldset\u003e\n\n\u003cbr /\u003e\n\n\u003cfieldset align=\"center\"\u003e\n\u003clegend align=\"left\"\u003eOwner-consumer pattern in fetch function for improved modularity\u003c/legend\u003e\n\u003cimg src=\"assets/fetch.png\" alt=\"Owner-consumer pattern in fetch function\"\u003e\n\u003c/fieldset\u003e\n\n\u003cbr /\u003e\n\n\u003cfieldset align=\"center\"\u003e\n\u003clegend align=\"left\"\u003eFor-select pattern for receiving channel values\u003c/legend\u003e\n\u003cimg src=\"assets/for-select.png\" alt=\"For-select pattern for receiving channel values\"\u003e\n\u003c/fieldset\u003e\n\n\u003cbr /\u003e\n\n\u003cfieldset align=\"center\"\u003e\n\u003clegend align=\"left\"\u003eDynamic routing of values to the respective slices\u003c/legend\u003e\n\u003cimg src=\"assets/dynamic.png\" alt=\"Dynamic routing of values to the respective slices\"\u003e\n\u003c/fieldset\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkolesnikova-dev%2Fstock-aggregator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkolesnikova-dev%2Fstock-aggregator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkolesnikova-dev%2Fstock-aggregator/lists"}