Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Build a Cool Space Station Tracking App using Spring Boot
Rating: 4.4 out of 5(22 ratings)
98 students

Build a Cool Space Station Tracking App using Spring Boot

Track the International Space Station with our cool app using Spring Boot and Java
Created byTony Perrin
Last updated 8/2019
English
English [Auto],

What you'll learn

  • Build a cool ISS tracking app using Spring Boot and Java
  • Create REST API endpoints using Spring Boot
  • Connect to a third party API to retrieve real time data using Spring Boot
  • Handle realtime tracking data
  • Build out a JavaScript frontend browser app
  • Work with the OpenMap API

Course content

1 section39 lectures1h 25m total length
  • What we are going to build1:55

    Build a Spring Boot app that connects to a third-party API to track the International Space Station in real time on the front end with JavaScript, open-source libraries, and maps.

  • Creating a Spring Boot project quickly1:32

    Generate a Spring Boot project quickly using start.spring.io, selecting a Maven project, a Java version, a group and artifact id, and adding the web dependency for Spring MVC.

  • Importing project in to IntelliJ1:57

    Import the generated Spring Boot application into IntelliJ as a Maven project from existing sources, then run the test to verify dependencies and context loads.

  • Test the third party API endpoint using CURL1:37

    Test the third-party open notify api endpoint for the iss position using curl and a browser, then hit the endpoint from a spring boot app to verify the data.

  • Create a REST endpoint in our Spring Boot app3:50

    Create a rest endpoint in our Spring Boot app by adding a controllers package and a get mapping under /api for the ISIS location endpoint that returns hello world.

  • Test our REST endpoint in a web browser1:53

    Test the new rest endpoint in a web browser and with curl, confirming the spring boot app returns a hello world string from the rest controller mapping at /api/isis location.

  • Connect to our third party API using the RestTemplate4:23

    Learn how to connect a Spring Boot app to a third-party API using RestTemplate, issue REST calls to open-notify, handle JSON responses, and implement basic error handling for unavailable endpoints.

  • Model the RestTemplate data back to a POJO8:23

    Model the RestTemplate response as a POJO with ISIS locator for timestamp, latitude, and longitude. Spring maps the json to this object, enabling easy data extraction for the space app.

  • Handling errors calling the third party API4:46

    Handle third-party API errors in a Spring Boot app by returning consistent responses and clear error messages to the front end, using try-catch and improved framework approaches.

  • Handling errors a cleaner way in an Restful API8:53

    Implement a Spring service to handle RestTemplate calls to a third-party API, using a circuit breaker with a fallback to return a clear message when the API is down.

  • Maven dependencies for Hysterix0:17
  • Running the jar outside Intellij3:12

    Learn to run a Spring Boot app outside IntelliJ by building with Maven, packaging a jar in the target folder, and executing java -jar to test locally.

  • What we have so far2:21

    Builds a Spring Boot app with annotation-based web controllers and a circuit-breaker fallback via Netflix districts, exposing /api/iss/location to power a front-end ISS trajectory map refreshed every five seconds.

  • Overview of our HTML webpage2:03

    Hit the Spring Boot backend from a browser and render live space station data on a map using JavaScript, Leaflet, and jQuery, with an HTML page and data polling.

  • The OpenMaps API1:28

    Explore Open Street Map—the open data map you can embed on your web page, free to use with credit to Open Street Map and its contributors, ideal for plotting locations.

  • Adding the basic HTML to our page2:47

    Create a basic html front end on the hasty mail page for the Spring Boot app, defining a div with id map and explicit width and height for the map.

  • Code from the previous lesson0:04
  • Adding our css and js libraries to the page1:25

    Add the leaflet css and javascript files, along with jquery, into the page header via copy and paste, and include meta charset for maps to work.

  • Code from the previous lesson0:04
  • Leaflet js for Open Map1:11

    Leaflet js for embedding maps on web pages, an open source javascript library working with open street maps, to build the front end of the space station tracking app.

  • Add a map to our webpage2:40

    Add an interactive map to the webpage with leaflet.js by wiring a map div, defining a map variable, setting view to 0,0, and applying an initial zoom with attribution.

  • Code from the previous lesson0:06
  • Call our Spring Boot app from browser to get ISS data5:02

    Call a spring boot app from the browser to fetch ISS data, parse json with jQuery, and update a Leaflet map using flyTo while noting cross-origin issues.

  • Code from previous lesson0:07
  • Cross-origin resource sharing (CORS)1:24

    Demonstrate how cross-origin resource sharing (CORS) and the same-origin policy block JavaScript requests to a Spring Boot app, and preview a Spring-based fix in the next video.

  • Handling CORS with Spring Boot2:03

    Fix cross-origin request errors in a Spring Boot app by applying the cross-origin annotation to allow specific origins, then restart the server and verify fix in the browser.

  • Plot location of ISS in middle of map2:47

    Plot a real-time location on a map using a leaflet.js circle with latitude and longitude, a radius of 30, and color options to track movement.

  • Code fron the last lesson0:05
  • Poll calling our API to plot a continuous course2:26

    Poll an API every five seconds to plot a space station's continuous course on a map, updating its location with long/lat data and drawing the growing path.

  • Code from the last lesson0:11
  • Add zoom capabilities to map2:47

    Add zoom capabilities to the map to view the path at different scales, set an initial zoom, and manage API call frequency for stable updates every five seconds.

  • Code from he last lesson0:04
  • Refactor the javascript2:23

    Refactor the JavaScript by extracting the set map logic and draw circle into dedicated functions, move variables outside the function, and preserve behavior while improving code readability and maintenance.

  • Code from the last lesson0:14
  • Houston we have a problem0:54

    Identify and handle api outages by adding a user-visible error when the third-party api is unavailable, showing a warning and indicating lost connection on the map.

  • Print error message if API unavailable5:42

    Learn to handle API disconnections by showing a leaflet popup with a connection error, keep the map's last position and zoom, and indicate API unavailable during polling.

  • Code from the last lesson0:09
  • Conclusion1:50

    Builds a spring boot backend with a controller and service that calls a third-party api to track the international space station on a map using open street maps and leaflet.js.

  • Bonus lecture0:37

    This bonus lecture offers a discount on Tony Perry's Udemy courses with the coupon code ALWAYS_999, and new courses are added all the time.

Requirements

  • Basic Java experience

Description

In this course we'll be using Spring Boot and Java to build a backend app which pulls information from a third party API.  We'll then display the location of the ISS on a map in a web browser using a little JavaScript.

This course is great for people who want to expand their Java skillset, use Spring Boot to provide backend REST API's and to learn to connect to third party APIs to retrieve data.

Your finished app will be able to track the current location of the International Space Station and plot its movements on a map viewable in a web browser.

Who this course is for:

  • All Java developers wanting to create a cool app to plot the movements of the International Space Station