/builderio-nextjs-isr-seo-starter

This is a starter kit Builder.io using NextJS with ISR capabilities and SEO improvements like Robots.txt and Sitemaps

Primary LanguageTypeScriptGNU General Public License v3.0GPL-3.0

Builder.IO & NextJs starter with ISR & SEO optimization

This project aims to be a starting project for every initiative around Builder.io and Next.js that requires ISR capabilities and SEO optimizations like having a dynamic sitemap.xml and a few other tricks.

If you want to see a live site using this starter go to Kenzilab.com.

Features

  • Typescript support ❤️
  • ISR for every Page generated.
  • Sitemap.xml generated in SSR connected with Builder.io
  • NextSeo package added.
  • Robots.txt
  • Perfect Lighthouse Score 100 / 100 / 100 / 100 by default.

Initial setup

  • Clone this repo.
  • Run npm i command.
  • Create your environment variables file. Create a .env file in the root with the following values.
    • NEXT_PUBLIC_BUILDER_PUBLIC_KEY - This is obtained through the Builder.io admin panel. For detailed instructions on getting your API Key, check out Finding your Public API Key in the Using Builder API Keys documentation.
    • REVALIDATE_SECRET - This is a custom-generated key for granting access to the revalidate endpoint. Use your favorite password generator or use your own one.
  • Go to Builder.io and create the first page (https://www.builder.io/c/docs/create-page).
  • Enable Builder.io Webhook for pages (https://www.builder.io/c/docs/webhooks) make sure you point it to /api/revalidate?secret={REVALIDATE_SECRET}.
  • Adjust the values you want to use for SEO. You can edit them in /src/config/seo.

Starting the server (locally)

It is as easy as running npm run dev and open a web browser in http://localhost:3000.

Deploy on Vercel

I recommend using Vercel. This repo also has Vercel Analytics npm dependency so it is included out of the box.

Deploy with Vercel

You will have to configure the environment variables in the admin panel. Name them as they are in the .env file.

Deploy elsewhere

I refer you to the official Next.js documentation.

Although there are many choices out there I recommend exploring Cloudflare Pages. It is easy, powerful, costless and very straightforward.

Websites using this project

If you want to list here your project you can open a PR with your url.