Sign inSign up

viepovsky/city-walk

By viepovsky

‱Updated over 2 years ago

Run the City Walk App in a Docker container.

Image
0

406

viepovsky/city-walk repository overview

⁠City Walk App

GitHub Workflow Status Codecov test coverage Docker Image Size (tag)

The application provides users with personalized recommendations for outdoor activities and clothing based on the current weather and air quality conditions of a given location. By inputting the coordinates of their city, users can receive recommendations on what to wear and whether it's a good day to go outside. The app also stores the coordinates of cities for easy access.

⁠Technologies

The application currently uses the following frameworks and technologies:

  • Spring Boot: Web, Data JPA, Test, Validation
  • Unit tests with: JUnit, Mockito
  • Lombok
  • Maven

⁠External APIs

At the moment, the City Walk App uses two external APIs:

  • Air Quality API to retrieve air quality for a given location.
  • Weather API to retrieve the current weather and a 13-day forecast for the given location.

⁠How to run

You can run the application in a container using the following command in your terminal or cmd:

docker run -d -p 8080:8080 viepovsky/city-walk

⁠Endpoints

The app provides many endpoints, but users can start by retrieving coordinates for a specific city:

  • http://localhost:8080/city-walk-app/localization/city?country-code=PL&city=Kalisz - retrieves coordinates for a given country code and city in JSON format like this:
{
    "countryCode": "PL",
    "name": "PoznaƄ",
    "latitude": "52.40692",
    "longitude": "16.92993"
}

Afterward, users can check the current weather for that location:

  • http://localhost:8080/city-walk-app/weather?latitude=52.40692&longitude=16.92993 - retrieves the current weather for the given coordinates in JSON format like this:
{
    "symbol": "n400",
    "symbolPhrase": "overcast",
    "temperature": 14,
    "feelsLikeTemp": 14,
    "dewPoint": 8,
    "windSpeed": 9,
    "uvIndex": 0,
    "pressure": 1013.29,
    "visibility": 10000
}

The main function of the app is to provide recommendations, including walk recommendations:

  • http://localhost:8080/city-walk-app/walk?latitude=52.40692&longitude=16.92993 - retrieves walk recommendations for the current air quality and UV index for the given coordinates in JSON format like this:
{
    "recommendation": "RECOMMENDED",
    "aqiScale": "GOOD",
    "uvIndexScale": "LOW"
}

and wear recommendations:

  • http://localhost:8080/city-walk-app/wear?date=YYYY-MM-DD&latitude=52.40692&longitude=16.92993 - retrieves wear recommendations for the current weather for the given date and coordinates in JSON format like this:
{
    "weatherDesc": "COOL",
    "head": "NONE",
    "upperBody": "SHIRT",
    "lowerBody": "JEANS",
    "foot": "SNEAKERS",
    "rain": "NO"
}

Tag summary

Content type

Image

Digest

sha256:2470fc6de


Size

301.6 MB

Last updated

almost 3 years ago

docker pull viepovsky/city-walk