{"id":14994205,"url":"https://github.com/zhrgns/weatherapispringboot","last_synced_at":"2026-02-06T21:31:46.925Z","repository":{"id":156110482,"uuid":"626910654","full_name":"zhrgns/weatherApiSpringBoot","owner":"zhrgns","description":"The Weather API allows users to search for the current weather report of a city by its name. Api consumes an open source api for data resource","archived":false,"fork":false,"pushed_at":"2023-04-16T09:45:57.000Z","size":186,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-11T21:34:04.623Z","etag":null,"topics":["docker","docker-compose","grafana","h2-database","intellij-idea","java","lombok","maven","open-api","prometheus","restful-api","spring-boot","spring-cache","springdata-jpa","swagger-ui"],"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/zhrgns.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":"2023-04-12T12:05:04.000Z","updated_at":"2023-04-12T12:16:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"a066182a-c6c7-4057-b71f-ca6edeba37b8","html_url":"https://github.com/zhrgns/weatherApiSpringBoot","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"15f4d2aec538a34156185a38f92942ddf53067df"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zhrgns/weatherApiSpringBoot","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhrgns%2FweatherApiSpringBoot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhrgns%2FweatherApiSpringBoot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhrgns%2FweatherApiSpringBoot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhrgns%2FweatherApiSpringBoot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhrgns","download_url":"https://codeload.github.com/zhrgns/weatherApiSpringBoot/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhrgns%2FweatherApiSpringBoot/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268079708,"owners_count":24192556,"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","status":"online","status_checked_at":"2025-07-31T02:00:08.723Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["docker","docker-compose","grafana","h2-database","intellij-idea","java","lombok","maven","open-api","prometheus","restful-api","spring-boot","spring-cache","springdata-jpa","swagger-ui"],"created_at":"2024-09-24T16:00:59.855Z","updated_at":"2026-02-06T21:31:46.876Z","avatar_url":"https://github.com/zhrgns.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Weather Service Application\n\n## General Info:\n\n![Architecture](./weather-uml.png)\n---\n* The Weather API allows users to search for the current weather report of a city by its name. The request is made to `/weather/{city}` URL with `{city}` as the path variable. \n* The city parameter is validated to ensure it is not blank or a decimal value. \nIf it is invalid, a `400 - Http Bad Request` response is returned.\n* The API gets the current weather from either the database or consumes the WeatherStack API using an API key. \n  * If the latest data is not older than 30 minutes, it is retrieved from the database. \n  * If the data is older than 30 minutes or does not exist in the database, a request is made to the WeatherStack API, and the result is cached. If there is a cached value with the city filter as the key, the response is returned from the cache directly.\n* If there is too many request for api in 10 sec, a `429 Too Many Request` response is returned.\n* For usages, weather Stack Api_Key should be defined in the `application.yml` file or an `.env` file .\n\n* The API endpoint can be found on the Swagger page at` http://localhost:8080/swagger-ui/index.html`.\n\n\n## Technology\n\n---\n- Java 17\n- Spring Boot 3.0\n- H2 In Memory Database\n- Spring Data JPA\n- Spring Cache\n- Lombok\n- Restful API\n- Maven\n- Docker, Docker Compose\n- Prometheus, Grafana\n- Open API Documentation\n- IntelliJ IDEA\n\n## Prerequisites\n\n----\n- Maven or Docker\n\n## Docker Run\n\n----\nThis application can be built and run using Docker. \nThe Dockerfile has a multistage build, so building and running can be done in one step.\n\n```sh\n$ cd weatherapp\n$ docker-compose up -d\n```\n\nDocker compose creates 3 replicas (instances) of the application on port range 9595-9597\n\n\n### For open-api-ui:  `http://localhost:{9595-9597}/swagger-ui.html`\n### For Prometheus: `http://localhost:9090`\n### For Grafana: `http://localhost:3000`\nUSER, PASSWORD=admin\n\n\n## Maven Run\n\n---\nTo build and run the app with `Maven`:\n\n```sh\n$ cd weatherapp\n$ mvn clean install\n$ mvn spring-boot:run\n```\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhrgns%2Fweatherapispringboot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhrgns%2Fweatherapispringboot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhrgns%2Fweatherapispringboot/lists"}