{"id":20968321,"url":"https://github.com/munishchouhan/weatherforecast","last_synced_at":"2026-04-16T09:02:29.700Z","repository":{"id":54848421,"uuid":"165483975","full_name":"munishchouhan/WeatherForecast","owner":"munishchouhan","description":"Rest API for Weather Forecasting ","archived":false,"fork":false,"pushed_at":"2024-08-26T16:27:52.000Z","size":39,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-12-27T19:21:10.565Z","etag":null,"topics":["java","rest-api","spring-boot"],"latest_commit_sha":null,"homepage":"","language":"Java","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/munishchouhan.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":"2019-01-13T08:45:26.000Z","updated_at":"2023-01-03T15:26:38.000Z","dependencies_parsed_at":"2025-01-20T02:40:59.410Z","dependency_job_id":"5b98f64f-3fce-4de6-aa11-df8690b63f0c","html_url":"https://github.com/munishchouhan/WeatherForecast","commit_stats":null,"previous_names":["munishchouhan/weatherforecast"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/munishchouhan/WeatherForecast","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/munishchouhan%2FWeatherForecast","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/munishchouhan%2FWeatherForecast/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/munishchouhan%2FWeatherForecast/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/munishchouhan%2FWeatherForecast/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/munishchouhan","download_url":"https://codeload.github.com/munishchouhan/WeatherForecast/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/munishchouhan%2FWeatherForecast/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31878831,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T07:36:03.521Z","status":"ssl_error","status_checked_at":"2026-04-16T07:35:53.576Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["java","rest-api","spring-boot"],"created_at":"2024-11-19T03:10:31.818Z","updated_at":"2026-04-16T09:02:29.680Z","avatar_url":"https://github.com/munishchouhan.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Weather Forecasting Rest API version 2.0\n\n\n## Getting started\nThis application is build on spring boot v 2.4.2.Release\nTo use Weather Forecasting Rest API, User need to register with\nhttp://openweathermap.org service to get APIKEY, which will be added in application.properties file.\n\n## Prerequisite\n* Maven 3.5.2\n* Eclipse Oxygen\n* Java 8\n\n## Build\nThis application uses MAVEN 3.5.2 for build.\nUse below command at the root directory of this project\n\n\u003e mvn clean install\n\n## Run\nOnce the build is successful, you can find the jar file of this application in ~/target folder\nRun the jar file using below command\n\n\u003ejava -jar .\\target\\weatherforecast-0.0.1-SNAPSHOT.jar\n\n\n## Access API\nhttp://localhost:9090/data/{cityname}\ne.g. http://localhost:9090/data/berlin\n\nresponse Example: \n\n`[{\"date\":[2019,1,14],\"avg_day_temp\":34.705,\"avg_night_temp\":35.3625,\"avg_pressure\":1005.36375},{\"date\":[2019,1,15],\"avg_day_temp\":35.385,\"avg_night_temp\":36.5425,\"avg_pressure\":1016.5550000000001},{\"date\":[2019,1,16],\"avg_day_temp\":42.81999999999999,\"avg_night_temp\":43.102500000000006,\"avg_pressure\":1010.2175}]`\n\n## Access Swagger UI\nhttp://localhost:9090/swagger-ui.html\nThis can be used  for manual testing\n\n## Unit Testing\nTo  Test Application : \n\nyou can run com.weatherforecast.WeatherForcastApplicationTests\n\n## Integration Testing\nTo Test Integration with openweathermap.org: \n\nyou can run com.weatherforecast.integration.WeatherForecastIntegrationTest\n\n## Reasoning and Motivations\n\nAt first, I created a high level design:\n\n`API call--\u003e/data/{city}--\u003edataservice--\u003eopenweathermap forecast API--\u003edataservice--\u003eresponse for /data`\n\nNote: In case study, I assume that, Average is referring to mean and not to mode or median\n\nFollowing are my reasoning and motivations through out this case study:\n\n* When ever I develop an API, I keep in mind the performance, maintainability, easy to test, and easy to read.\n* code should be well commented for easy understanding.\n* Bootstrap the application by creating project at https://start.spring.io/.\n* Imported to eclipse for development, my preferable IDE.\n* All the variables, which are subject to change were added in properties file, this helps in easy maintenance.\n* Java 8 features like Lambda expressions with Stream API is used for better understanding and less code.\n* Collections like ArrayList is used to collect data for different days.\n* POJO classes are created to get the required forecast data from openweathermap.org.\n* POJO class is created for /data response.\n* Exceptions are created to throw the correct error code according to the REST API conventions.\n* Input is getting validated at the starting of API call and appropriate error code is thrown.\n* Caching is enabled in this application to cached the forecast data from openweatherapi.org, to improve the performance for multiple same API calls.\n* server port is also changed to 9090 because mainly 8080 is already taken in several machines.\n* I have used multiple functions to divide the logic and increase the code reuse.\n* LocalDate and LocalTime is added in the response of openweathermap.org, which makes it easy to filter the entries according to the date and time.\n* \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmunishchouhan%2Fweatherforecast","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmunishchouhan%2Fweatherforecast","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmunishchouhan%2Fweatherforecast/lists"}