Lets talk about this stack

Next.js and Sanity CMS for the win

When I started the process of building this site, I knew that I wanted to build a nice looking promotional website for myself, and a blog. I already had in mind that I will do a Next.js front end, but what about the blog content management system and what made me choose Sanity, which at the time was completely unknown to me. Lets do a deep dive into my decision making process.

Next.js: the low hanging fruit

React is a library. It lets you put components together, but it doesn’t prescribe how to do routing and data fetching. To build an entire app with React, we recommend a full-stack React framework like Next.js or Remix.

The above quote is directly off the home page of React. If you are starting a react project, and not using a framework, you're behind the times. Some of the benefits of Next.js include:

  • Server Side Rendering (SSR) and static site generation (SSG)
  • Smooth development process with Hot Module Replacement
  • Built in Routing
  • Automatic code splitting.
  • Because it handles SSR and SSG, this makes it more SEO friendly.

What this means is that you should end up with an easy development experience and a high performance UI. Adding to that my familiarity with Next.js and its conventions made choosing it a no brainer.

The CMS

There is no shortage of options to choose from when looking at CMS's. To narrow the field, I knew I wanted to try a Javascript/Typescript based CMS. Why? No reason other than to experiment.

So why Sanity? I had never heard of it before I started looking into CMS's but I stumbled upon it and it gave me exactly what I needed.

  • Simple and customizable
  • Easily integrates with Next.js
  • Free Hosting

What sold me on giving it a try was the Sanity Studio with visual editing and how easy that was to setup. Sanity allows me to view and interact with my content in place as I'm creating, easily manage my content, and syncs with the cloud in real time. As a bonus, Sanity provides an asset pipeline for my images so they should be loading super quick.

The Result

Using Next.js and Sanity allowed me to build out this site in about 2 days with an additional day for styling (tailwind FTW). Im incredibly happy with the developer experience and as I continue on this journey, and thanks to Next.js, I'm looking forward to diving into SEO and analytics and reaching new people.

Learn more about: