Live weather widget gives us weather update of cities. It takes city name as input and shows the temperature in celcius. Api, keys and interval(min) are taken from sqlite database. For UI, wxwidgets library is used, for sending requests to the API, libcurl is used and for json parsing response from API, we are using nlohmann-json library.
-curl
-nlohmann-json
-wxwidgets
-sqlite3
- The solution is only built in msvc x64 DEBUG configuration (couldn't get the time to setup the release configuration).
- The solution requires to be built with MultiThreaded Debug config.
- The solution requires the std=c++17 to be installed.
- If a city name is changed, we have to wait at max for INTERVAL time for weather to be updated (as the thread for weather update will be in sleep).
- This is a MSVC 2019 solution.
- There is third party folder in the root directory which contains the libcurl, nlohmmann json and sqlite library headers, static and dynamic link library files and dlls.
- The paths to thirdparty headers and libs are already set in the vcxproj.
- After the build, the dlls from the respective bin folders should be copied/present with the executable.
- The database file [weather.db] should be present with the sln file.
- You have to have installed latest version of wxwidgets from here. The default installation path for wxwidgets is harcoded in visual studio project.
- The default installation path for wxwidgets (C:\wxWidgets-3.1.5) is hardcoded in the vcxproj for easy configuration. If the default installation path is used, the solution can be run from any directory. Otherwise, the vcxproj will require to be updated.
- Add multiple providers for weather information (DB already has the supported structure).
- The database also supports muliple settings, we should add user settings there and reload on app restart.
- Loader gif or loader bar to show the background process.
- Weather information for multiple cities.
- Multiple instances of the widget.
- Last data sync.
- Exception Handling.
- Error handling for JSON responses.