Rooted

GatsbyContentfulExpressWordPress

Friday, January 5, 2024

It seems easy for a business owner to find their way into an expensive website plan, all while having to build out their site on their own. There are a multitude of options to choose from. Naturally, this might overwhelm many who are looking for a website.

Rooted Psychotherapy website on four devices

What Was I Asked to Do?

As often happens, people who know you work with web design and development will ask for your assistance. Initially, I was asked if I could help them complete their website as it was in an "unfinished state."

Laptop with under construction on the screen

Many of us may remember the "under construction" graphics (often animated GIFs) that were so frequently found on websites. While their site didn't have these, many areas gathered "dust."

At the time, I had a VPS server provided by KnownHost. Leveraging this, I decided to build them a site using:

  • NodeJS
  • Express
  • Pug
  • WordPress (Headless)
  • Ui-Kit

While I enjoyed learning new technologies (previously, I would develop sites using WordPress), I found the site stumbled in some areas. The Express server was run using nodemon and then PM2. Despite these tools, there were times when the server process would not restart after reboots.

No one wants to get emails asking, "Where is my site?" We all want "the lights on" 24/7. In my studies in the past on Lynda.com ( now LinkedIn Learning), I learned about static site generators like Jekyll. I then stumbled upon GatsbyJS. This combined with serverless hosting through Netlify seemed like the way to go. So I dove right in.

// Wow that's some plugin list!
plugins: [
    `gatsby-plugin-postcss`,
    `gatsby-plugin-image`,
    `gatsby-plugin-sharp`,
    `gatsby-transformer-sharp`,
    `gatsby-plugin-react-helmet`,
    {
      resolve: `gatsby-source-filesystem`,
      options: {
        name: `images`,
        path: `${__dirname}/src/images`,
      },
    },
    {
      resolve: `gatsby-source-contentful`,
      options: {
        spaceId: `dufp2wlrjqr9`,
        accessToken: process.env.CONTENTFUL_ACCESS_TOKEN,
      },
    },
    {
      resolve: `gatsby-plugin-sitemap`,
      options: {
        exclude: [],
      },
    },
  ],

Gatsby was a great stepping stone for me in my learning about JAM stack technologies. I liked Gatsby so much that I soon went on to make two more sites using Gatsby. The site has remained stable on version 4 for years now. Site updates are made through the Contentful headless CMS. I dabbled with Airtable for a little too before settling on Contentful.

Hosting on Netlify also meant that I had eliminated my need to maintain the Express server. Had I found my "Valhalla?" (Some of you may know what I just did right there). Truth be told, if I am ever asked for a site redesign, I would move away from Gatsby and also from Contentful. "But why?" you ask.

For a time, it seemed like updates to Gatsby were coming fast and furious. This was both good and bad. Also, the reliance on plugins (see the code snippet above) had me concerned about the potential "breakage" of important connections. Contentful offers a generous free tier, but the price jump if you need more than the free tier gave me "sticker shock."

I no longer use Gatsby and Contentful as I believe I have found alternatives that work better for me and my clients.