Building an application
In this chapter and the next, we will build a single-page application that relies on an API written in Play. We will build a webpage that looks like this:
The user enters the name of someone on GitHub and can view a list of their repositories and a chart summarizing what language they use. You can find the application deployed at app.scala4datascience.com
. Go ahead and give it a whirl.
To get a glimpse of the innards, type app.scala4datascience.com/api/repos/odersky
. This returns a JSON object like:
[{"name":"dotty","language":"Scala","is_fork":true,"size":14653}, {"name":"frontend","language":"JavaScript","is_fork":true,"size":392}, {"name":"legacy-svn-scala","language":"Scala","is_fork":true,"size":296706}, ...
We will build the API in this chapter, and write the front-end code in the next...