Overview
The Next 13 Boilerplate for Programmatic SEO Campaigns is a template for creating modern programmatic SEO campaigns. It includes all the features that you would expect in a modern pSEO campaign. The boilerplate utilizes Next 13 for static fast webpage loading and deployment on Vercel. It also uses Incremental Static Regeneration (ISR) for regenerating information on Vercel during runtime. The template automatically generates sitemaps and robots.txt, even with ISR regeneration, using next-sitemap. It provides distinct layouts for site, blog, and variant pages. The boilerplate also includes SEO metadata, JSON-LD, Open Graph tags with Next SEO, and a built-in cookie banner and Google Analytics. It features developer experience first with Prisma for easy database interaction, type-checking with TypeScript, integration with Tailwind CSS, strict mode for TypeScript and React 18, code formatter with Prettier, absolute imports using @ prefix, and E2E testing with Playwright.
Features
- Utalizes Next 13 for Static Fast Webpage Loading and Deploy on Vercel.
- Use ISR for regenerating infomration on Vercel during runtime.
- Sitemaps and Robots.txt generated automatically even with ISR regeneration via next-sitemap.
- Site, Blog and Variant page have distinct layouts.
- SEO metadata, JSON-LD and Open Graph tags with Next SEO.
- Maximize lighthouse score.
- Built-in Cookie Banner.
- Built-in Google Analytics.
- Auto 404 Image placeholder component.
- Prisma (Postgres-compatible) for easy DB interaction.
- Type checking TypeScript.
- Integrate with Tailwind CSS.
- Strict Mode for TypeScript and React 18.
- Code Formatter with Prettier.
- Absolute Imports using @ prefix.
- E2E Testing with Playwright.
Installation
To get started with the Next 13 Boilerplate for Programmatic SEO Campaigns, follow these steps:
- Clone the repository:
git clone git@github.com:agamm/pseo-next.git pseo-example - Install the dependencies:
npm i - Start Docker for local PostgreSQL:
docker-compose up -d(for local PostgreSQL DB) - Open
http://localhost:3000/to view the development environment. - Check the Development section for further instructions.
- Rename
Development.env.exampleto.envand update the necessary parameters if needed. - Place all your landing pages (Home page, about, terms, etc.) in the
/src/app/(site)folder. - Write your blog posts as Markdown files in the
/postsfolder. - Change the layout of your blog in the
/src/app/blogfolder. - Create your Programmatic variants in the
/src/variant/[slug]folder. Example:yoursite.com/hotels/spain-summer-2023withvariant="hotels"andslug="spain-summer-2023". - Uncomment the comments in the relevant files to actually fetch data from your database.
- Connect your project to Prisma by adding your schema in
/prisma/schema.prismaand runningnpx prisma migrate dev --name initandnpm run dbDeployment. - Connect your repository to Vercel and add your environment variables.
- In Vercel, change the build command to
npm run prod:build.
Summary
The Next 13 Boilerplate for Programmatic SEO Campaigns is a powerful tool for creating modern programmatic SEO campaigns. It offers a wide range of features, including fast webpage loading, automatic sitemap and robots.txt generation, distinct layouts for different page types, SEO metadata optimization, and built-in analytics and cookie banner. The boilerplate prioritizes developer experience by providing easy integration with databases, type-checking with TypeScript, and a code formatter. Overall, it is a comprehensive solution for anyone looking to optimize their SEO strategies.