FCC Speedrun #5 Image-Search

Yasser Hussain
Chingu FCC Speedrun
1 min readApr 22, 2017

End Product

Deployed app — https://elixir-image-search.herokuapp.com/

Code- https://github.com/yasserhussain1110/chingu-fcc-speedrun-challenge/tree/master/backend/api-image-search

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. :)

--

--

Chingu FCC Speedrun
Chingu FCC Speedrun

Published in Chingu FCC Speedrun

The home of the FCC Speedrun challenge, designed by P1XT (hosted in the Chingu cohorts)! Github -> https://github.com/P1xt/chingu-fcc-speedrun-challenge

Yasser Hussain
Yasser Hussain

Written by Yasser Hussain

Programmer. Author. Functional Programming guy.

No responses yet