Always Creating

Creating a Clone of HackerNews (React + Apollo Client)

June 16, 2019



So I recently made a full-stack Hacker news clone by following tutorial available on Howtographql site. In this post, I am going to describe the journey of building the frontend part of the project using Reactjs and apollo client (a frontend client to work with Graphql).

Why I did this project?

Well while working on my blog I came across Graphql (Gatsbyjs uses it to fetch data from backend). GraphQL is a new way of querying data, is quite different from REST and at the same time looks promising and fascinating. So I became more interested in it, as I could use my learning of Graphql to create a better blog. The Howtographql website was a great starting point. It was pretty well written and helpful so I guessed the tutorial there will be good. They had a React + Graphql tutorial for beginners, so it seemed a great way to master and sharpen some react skills, yee!! Building something like the Hackernews clone seems a recommended way to learn about development. Thus I began building! Also later I found out that apollo client is an emerging tech stack and gaining popularity.

How ?

Well, I just followed the tutorial and made the site. I recommend starting with backend (the Nodejs + Graphql tutorial on Howtographql ) or doing both tutorials parallelly. I didn't get stuck at any point and they have Github reference for each and every code block, which is great!! if you get stuck.

Takeaway

I still have to learn a lot about apollo and react. But I did pick up some new things while building the project. I learned some javascript coding methods like the map function, ternary operator use cases. I learned a bit about how features like pagination, filtering, sorting, authentication work. Also, I didn't stop where the tutorial ended, I kept on adding features which actually helped me understand better. Building on top of the tutorial seems to be a great way to learn and makes you appreciate the tutorial more. Initially, I didn't understand a great number of modules and was questioning the tutorial and my judgment, but later everything turned out to be great.


All Articles