DEV Community

Discussion on: Why did I build my portfolio website with GatsbyJS?

Collapse
 
fasani profile image
Michael Fasani

Hey thanks for sharing. Why did you use Strapi? What do you solve with that approach or what are the benefits over statically hosted text+images in the Gatsby build process. Thanks

Collapse
 
bitdweller profile image
Pedro Pimenta

It doesn't solve anything for myself because I would definitely be comfortable with editing Markdown files, of course. I did it first for (I'm sorry for repeating this so much) the chance to learn a NodeJS CMS that I may in the future use for clients because they may need to have an easy-to-use platform to update their sites, instead of using WordPress. As it's NodeJS, any change or configuration will be with JavaScript so... you know... I'll learn something on the way :)

And also, now I can just open up the Strapi admin and add a project, instead of having to open the editor, run gatsby develop, make changes, commit it and upload. I don't need it but it's nice to have.

I also learn a bit more about constraints and planning for future needs.

Collapse
 
fasani profile image
Michael Fasani

Hey thanks, Ok so to understand that fully... The site is mostly statically built with Gatsby but now some content comes from the CMS during page load so it can be edited online in realtime or do you have to then query the CMS and then build Gatsby and deploy it again?

Thread Thread
 
bitdweller profile image
Pedro Pimenta

Oh, yes, it is built again and the images are served from Gatsby to the user. AWS only stores the images for the CMS and because of how Gatsby works, it downloads and compresses images and serves them from wherever you host Gatsby. I really didn't think that through :)

So in the end, AWS is only for the CMS to store content. This is needed if you upload to a server like Heroku because Heroku doesn't allow you to write files to the filesystem. If you host it on a "regular" server you won't need the S3 bucket, you can save the images on the server. Then Gatsby would do the same, fetch the images and host them itself.

So, as you asked, Gatsby is re-built everytime I hit Save on Strapi through a Webhook. The point of having Gatsby is to build a static site, it doesn't make sense to fetch content in real-time. You would use a regular React webapp in that case.

Hope it helps! Ask me anything else, I am not an expert and this conversation helps very much :)