FCC Speedrun #5 Image-Search
End Product
Deployed app — https://elixir-image-search.herokuapp.com/
Recap
For those who are new to FCC, this is the project’s objective.
User’s can search for images -
https://elixir-image-search.herokuapp.com/api/imagesearch/robots?offset=30
User’s can see latest search terms -
https://elixir-image-search.herokuapp.com/api/latest
Coding Experience
This app was relatively simpler to build in comparison to the last one, because I had gained some experience in how to use databases in the last app.
This app was about finding the right libraries to get the job done.
For example, I was using the Google’s Image Search API to get the list of images. I used HTTPoison library for that.
Secondly, all the search terms are inserted in a database table named search_terms. So to get latest search terms, I had to write a postgreSQL query. I found many good examples here and was able to successfully write the query to retrieve the latest last 10 search terms.
Lastly, since I didn’t want all the information in search_terms table to be sent to the user. I had to pick certain properties from it and show only those. Thanks to stackoverflow I found a way to do so by overriding the default encoding of Phoenix.
Once I did that, the app was ready.
Thanks for reading. :)