{"id":23197011,"url":"https://github.com/brakmic/weather_component_hpx","last_synced_at":"2025-04-05T08:42:07.630Z","repository":{"id":265731930,"uuid":"861404928","full_name":"brakmic/weather_component_hpx","owner":"brakmic","description":"A two-component demo that runs on HPX","archived":false,"fork":false,"pushed_at":"2024-09-23T09:51:33.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-01T20:14:22.436Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","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/brakmic.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":"2024-09-22T19:53:29.000Z","updated_at":"2024-09-23T09:51:37.000Z","dependencies_parsed_at":"2024-12-07T20:30:32.526Z","dependency_job_id":null,"html_url":"https://github.com/brakmic/weather_component_hpx","commit_stats":null,"previous_names":["brakmic/weather_component_hpx"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brakmic%2Fweather_component_hpx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brakmic%2Fweather_component_hpx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brakmic%2Fweather_component_hpx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brakmic%2Fweather_component_hpx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brakmic","download_url":"https://codeload.github.com/brakmic/weather_component_hpx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247312098,"owners_count":20918341,"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":[],"created_at":"2024-12-18T14:27:37.970Z","updated_at":"2025-04-05T08:42:07.581Z","avatar_url":"https://github.com/brakmic.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Weather Component HPX\n\nThis project is an [HPX](https://hpx-docs.stellar-group.org/latest/html/index.html)-based C++ application that retrieves weather data for a given city using two APIs:\n1. **City Resolution API ([Nominatim OpenStreetMap](https://nominatim.openstreetmap.org/))**: Resolves the city name to geographic coordinates (latitude and longitude).\n2. **Weather Data API ([Open-Meteo](https://open-meteo.com/))**: Retrieves weather data for the provided coordinates, including windspeed, temperature, humidity, pressure, and more.\n\nThe project uses modern C++ features like `std::optional` to handle cases where the city cannot be resolved to coordinates. The client is unaware of internal handling and continues to function smoothly even when a city is not found. \n\n### Key Features:\n- Uses HPX for distributed, asynchronous task handling.\n- Resolves cities to geographic coordinates using the OpenStreetMap Nominatim API.\n- Fetches weather data based on coordinates from the Open-Meteo API.\n- Filters valid city results using the `addresstype` field from Nominatim to ensure only populated places like cities, towns, and villages are accepted.\n\n### Project Structure:\n\n```\nweather_component_hpx/\n├── CMakeLists.txt\n├── LICENSE\n├── include/\n│   ├── city_resolver_component.hpp\n│   ├── coordinate.hpp\n│   └── weather_component.hpp\n├── src/\n│   ├── city_resolver_component.cpp\n│   ├── coordinate.cpp\n│   ├── main.cpp\n│   └── weather_component.cpp\n└── third-party/\n    ├── httplib  (cpp-httplib as submodule)\n    └── json     (nlohmann/json as submodule)\n```\n\n### Dependencies:\nThis project depends on the following libraries:\n- **HPX**: High Performance ParalleX library for distributed systems.\n- **cpp-httplib**: A lightweight C++ HTTP/HTTPS library (added as a git submodule).\n- **nlohmann/json**: A header-only JSON library for C++ (added as a git submodule).\n- **OpenSSL**: For SSL/TLS support in the HTTP client.\n- **TBB**: Threading Building Blocks (required for HPX).\n\n### Cloning the Repository\n\nTo properly clone the repository, including the required git submodules (`cpp-httplib` and `nlohmann/json`), run the following commands:\n\n```bash\ngit clone --recurse-submodules https://github.com/brakmic/weather_component_hpx.git\n```\n\nIf you already cloned the repository without the submodules, you can initialize and update them with:\n\n```bash\ngit submodule init\ngit submodule update\n```\n\n### Build Instructions\n\nEnsure that you have CMake and a C++23-compatible compiler installed. The project uses HPX and requires OpenSSL for secure HTTP requests.\n\n#### Step 1: Install Dependencies\nMake sure to have the following installed on your system:\n- **HPX**: Install it via your package manager or build it from source.\n- **OpenSSL**: Required for HTTPS support.\n- **TBB**: Required by HPX (on macOS, it is expected to be installed via Homebrew).\n\n#### Step 2: Configure and Build\nTo build the project, follow these steps:\n\n1. **Create a build directory**:\n   ```bash\n   mkdir build \u0026\u0026 cd build\n   ```\n\n2. **Run CMake**:\n   ```bash\n   cmake ..\n   ```\n\n3. **Compile the project**:\n   ```bash\n   make -j$(nproc)\n   ```\n\n#### Step 3: Running the Application\n\nOnce the project is compiled, you can run the `weather_component` executable by providing a city name as a command-line argument:\n\n```bash\n./weather_component \u003ccity_name\u003e\n```\n\nFor example:\n\n```bash\n./weather_component \"Bonn\"\n```\n\nIf the city is resolved successfully, the weather data for that city will be retrieved and displayed. If the city cannot be resolved (e.g., for invalid or non-existent city names), an error message will be returned.\n\n### Example Output\n\nWhen running the program with the city name \"Bonn\", the output will be something like:\n\n```\nTime: 2024-09-21T15:00:00Z\nTemperature: 22.5 °C\nWindspeed: 14.0 km/h\nWind Direction: 240 degrees\nHumidity: 65%\nPressure: 1015 hPa\nCloud Cover: 20%\nVisibility: 10 km\n```\n\n### License\n\nThis project is licensed under the MIT License. See the [LICENSE](./LICENSE) file for more details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrakmic%2Fweather_component_hpx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrakmic%2Fweather_component_hpx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrakmic%2Fweather_component_hpx/lists"}