Your task is to create a user lookup autocomplete in Elm using the public GitHub user search API, according to the screenshots below. You should be able to enter a username and get back some basic information about that user.
-
Clone the repo and
yarn
to install the necessary dependencies. This repo usescreate-elm-app
to set up a basic project with an HMR-supported dev server. See that project's README if you run into any issues during installation. -
cd project && yarn
and thenyarn elm-app-start
to start the dev server. Navigate to http://localhost:3000 in your browser (if it doesn't automatically open).create-elm-app
uses PostCSS by default and you can install any plugins you like, and should you wish to use Sass instead you can renamemain.css
tomain.scss
and runyarn watch-css
. -
You are not required to use any external packages, but should you wish to do so you can install Elm packages with
yarn elm-app-install <package-name>
. To install JavaScript packages, useyarn add <package-name>
as usual. -
You can query the API endpoint with a query param named
q
, e.g.https://api.github.com/search/users?q=rtfeldman
. Limit the autocomplete results to the first three matches. You are free to decide how many characters should constitute a match (fuzzy matching is not required). Clicking a result should populate the user's name, location, followers, and respositories in the widget (that data can be found at the GitHub users API). Note: You do not need to implementEnter
or arrow key functionality in the autocomplete. -
Bonus: Display a nicely formatted error message if no user matching the input could be found.