Hello everybody,
I'll soon start to work on a static website project using Strapi for the back-end. But I wonder if working with Gatsby for the front-end is relevant. That's why I'm looking for people's opinion/experience of Gatsby because I can't figure it out by myself...
So, if you could help me to make my choice, it would be great :D
Cheers!
Top comments (12)
Hi ,
It definitely can bring in great speed in your website. Here are few reasons for which I would choose Gatsby as my front-end
No doubt that JAMStack is the present and the future. This power when combined with PWA, will rule the domain of web development for a long time.
Thanks for asking.
Tharun Shiv
tharunShiv https://tharunshiv.com
😊
Thank you Tharun for your answer. The good speed of Gatsby websites is definitely a pros to use Gatsby !
Even if you have dynamic content, since you said it's only a little bit, you can use GraphQL and databases to pull dynamic data into the application right?
You mentioned that you're gonna use an API service, so this shows that you're gonna isolate your front end and backend, so you would be using services like GraphQL, Axios or Firebase like services which would help you make requests and populate the website. May I know how your thought process is currently?
Well with my team we agreed to use Next.js that seems more suitable for our project. So Gatsby is out of the table..
Thank you for your time Tharun, really appreciate it :)
Sure.. :)
I'm just curious about the pros of Next.js, can you help me with that? Like what made you choose Next.js over Gatsby. :)
The main reason was that our project might evolve and its dynamical part might be more important in the future ^^
Alright.. thanks for the knowledge. :) All the best with your project!
Hello
GatsbyJs is a Static Site Generator, like Hugo, Jekyll etc...
It is not the ideal framework (as far as I know) if you want to setup a front-end based on REST api (like Strapi.io is providing). But as Gatsby is itself based on React then I am sure it is possible to consume a REST api :D
I am suggesting more to look at the famous Create React App that will be more basic or Next.js that is handling Server Side Rendering.
A good article here : dev.to/benjaminmock/gatsby-vs-next...
Thank you Julien for your answer. The link to the article is really useful because I'm thinking to use create react app :)
Gatsby generates static sites and very much has a specific use case. There's a couple of questions to answer about it to see if it fits for you:
This means: Does your data vary by the individual user that's logged in? This means usually that you have to do some client side fetching and if that's all you're doing than Gatsby probably isn't the right fit.
This is common among blogs. Where the user plays almost no part in what data loads and all the data is the same for each user. In this case Gatsby could be a good fit but again it depends more deeply on what you're wanting as well as how steep of a learning curve you're willing to deal with.
While Gatsby allows for client side code just fine and managing dynamic data, it has a steep learning curve compared to something like create-react-app if you're going to be hydrating data from a rest api.
Gatsby also sort of requires you to normalize the data as it comes in so you can use GraphQL to query it and this all happens during the build time, when the site is actually generated. This makes the learning curve exceptionally steep for Gatsby.
Unless you are developing a blog or just really want to learn Gatsby I probably wouldn't recommend it. I personally use it for my blog and it works just fine for that but none of my data is fetched client side so it all happens during the build process.
Thank you JD for your answer. My project is mainly static but we have a small part of it that require dynamic data. That's why I'm doubting about using Gatsby.