Hello guys, hungry for knowledge, I’m happy to be writing about one of the most awesome web technology I used recently: Gatsby. In this article, I will be talking about what is Gatsby, its benefits, and how to get started.
What is Gatsby
Gatsby is a React-based Framework which is also a super cool modern web site generator to create blazingly fast websites.
And there are my slides where I talked about Gatsby.
Gatsby is super cool in creating super-fast web applications, being built with React it’s not surprising why it is fast, right?
Getting Started with Gatsby
To get started with Gatsby you have to make sure you have your tools all set:
- Install Node.
- Get your favorable Code Editor, either VS Code, Sublime Text, or any other preferred.
- Git BASH or any other tool to push our code to GitHub. Maybe you can skip this because we will be making use of our VS Code terminal.
- Of course Browser.
Or you can use the cool online code editor CodeSandBox which is pretty much easy to start with no signup.
Step 1: Select Gatsby.
Step 2: After selecting the Gatsby, CodeSandBox will grab and install all the packages you need for the application to get started including the Gatsby starter theme that will be making use of.
Step 3: Finally, you will have the Gatsby starter theme in front of you.
That’s all for CodeSandBox here, let’s get back to how we can do this on our machine with the whole tools mentioned above.
Step 1: Create a project folder and open it with VS Code.
To open the VS Code terminal use keyboard shortcut “Ctrl +
" or "Ctrl + shift + “. Next, to install Gatsby globally type the command: npm i -g gatsby
Now we will clone the Gatsby starter theme by using the command:
gatsby new your-preferred-app-name https://github.com/gatsbyjs/gatsby-starter-default
or download the Gatsby starter theme from GitHub.
If your app is done cloning, you will have a close picture of mine below.
WOW! We have done a pretty great job here!
Step 2: Run your Gatsby app.
Type: cd your-preferred-app-name to navigate to your app folder, then run the Gatsby site by typing gatsby develop, and your site will be much ready in the localhost just like in the image below.
So my own localhost link says http://localhost:8001 because I have something running in my localhost:8000, at the moment of writing this article. If you go ahead to click on that link it will open your Gatsby site on your default browser. Super cool, right?
That’s how to get pretty much started with creating a Gatsby application within minutes, easily push it to GitHub, and deploy to your favorite Cloud machine (I use Netlify). I the future I will write on how to build a real web app with Gatsby because I love Gatsby a lot and find it fun building with it.
It will also interest you to know that Gatsby has a large plugin ecosystem to get you with most integration with the CMS’s, NewsLetter, and etc.
I hope this article helped you understand Gatsby, why you should try Gatsby, and how to build interesting static sites with it.