Skip to content

mcasaje/simple-java-weather-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple-Java-Weather-App

Quick Start

Dependencies

  • Maven 3 (v3.3.9)
  • Java 8 (v1.8.0_152)
  • Google Chrome ES6 (v75.0.3770.100)

How to Run

1. Run the backend API

mvn clean package exec:java

This will run the backend on http://localhost:8080/

2. Open up the index.html in src/main/webapp on a modern browser that supports ECMAScript6.

3. Enter a location to receive the weather data for that area.

4. Calling the API directly (Optional)

You can call the API directly at http://localhost:8080/weather?location=LOCATION and replace LOCATION with a sample string such as "Hong Kong, HK"

TODO

  • Setup of Jersey API
  • Enable CORS on backend API
  • Create index page with form to submit to the backend API
  • Install Guice dependency for dependency injection
  • Install marshaller dependency to/from JSON
  • Retrieve weather data from OpenWeatherMap.org
  • Get City ID from OpenWeatherMap.org
  • Get City Weather using City ID from OpenWeatherMap.org
  • Parse weather data from OpenWeatherMap.org to extract overall weather description
  • Parse weather data from OpenWeatherMap.org to extract temperature in Celsius
  • Parse weather data from OpenWeatherMap.org to extract sunrise times
  • Parse weather data from OpenWeatherMap.org to extract sunset times
  • Convert times to 12 hour format
  • Convert temperature to Fahrenheit
  • Return all data via API endpoint /weather
  • Extract server port and app variables into environment vars or configuration files
  • Unit tests
  • Environment Maven profiles

About

Interview Coding Problem

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published