
basesmi
Small business website for counseling practices with services, team and resources pages on Next.js and MongoDB
Next.js 16 and Payload CMS website starter for service businesses with SEO, GTM tracking and lead capture

A website template built on the official Payload website template, using Next.js 16, PostgreSQL and Tailwind CSS 4. It adds service, project and portfolio content, a layout builder, local SEO structured data, Google Tag Manager with GA4 and Consent Mode v2, and Google Reviews and Maps. Requires Node 22+, pnpm and PostgreSQL 16+.
Al Rukn Furniture website and content platform
This repository is a GitHub template: create your own copy of it in one click.
Create a repository from this template
Next.js Payload CMS template for service-business websites: SEO-ready, Google Tag Manager + GA4 built in, lead conversion tracking (form, WhatsApp, phone) for Google Ads, and a full Payload admin. Live demo: repair.kanzelectronic.com
Built on the official Payload Website Template (Payload
3.89+ Next.js16), then production-hardened for real service businesses.
A reusable Next.js 16 + Payload CMS 3 starter with PostgreSQL, layout builder, SEO / AEO / GEO, Google Tag Manager + GA4, Cookie Consent Mode v2, Google Reviews, Google Maps, leads, service landings, and portfolio — already proven on live sites.
| Site | URL |
|---|---|
| Al Rukn Furniture | https://alruknfurniture.ae/ |
| Al Mustajid Aluminium & Glasses | https://almustajid.ae/ |
| Kanz Electronic TV Repair | https://repair.kanzelectronic.com/ |
| Homes Renovators | https://homesrenovators.com/ |
| Al Mustajid Services | https://services.almustajid.ae/ |
| Mudassar (developer portfolio) | https://mudassar.net/ |
Built and maintained by Mudassar — mudassar.net
/admin, frontend App Router, React Server Components, standalone Docker-ready output.@payloadcms/db-postgres with migrations and production env checks.dataLayer conversion events.mapURL, Place ID via Payload global.template:check, lint, typecheck, Vitest unit/integration, Playwright e2e/a11y, optional LHCI.TEMPLATE.md to rebrand for a new project.git clone https://github.com/mhkxx2/nextjs-payload-website-template.git
cd nextjs-payload-website-template
Or use Use this template on GitHub.
cp .env.example .env
# edit DATABASE_URI, PAYLOAD_SECRET (>=32 chars), NEXT_PUBLIC_SERVER_URL, PREVIEW_SECRET, REVALIDATION_SECRET
pnpm install
pnpm payload migrate # apply DB migrations
pnpm dev # http://localhost:3000 | admin: /admin
First admin user is created through the Payload onboarding flow at /admin.
docker compose up
Compose starts Postgres 16 and the Next/Payload app on port 3000 with local-only defaults. Replace every secret before any shared or production use.
This template ships a production search + answer + generative/local discovery stack — not just a meta title field.
| Capability | What ships |
|---|---|
| CMS SEO fields | Per-document SEO title (≤60), meta description (≤180), required canonical URL, index/follow toggles |
| Open Graph & Twitter | OG title/description/image + Twitter card metadata via Next Metadata helpers |
| Admin SEO preview | In-admin search/social preview UI (SEOPreview) |
| Site-wide defaults | SEODefaults global + @payloadcms/plugin-seo |
| Canonical policy | Trailing-slash canonical URLs, origin-safe resolution, drafts/utility paths excluded |
| robots.txt | App Router robots route; disallows /admin/, /api/, /graphql/, /internal/, /next/, /search/ |
| sitemap.xml | Dynamic sitemap of published, indexable pages/posts/projects/services (+ structural routes & catalogue products) |
| Redirects | Payload redirects plugin + collision-safe public route contract |
| 404 / soft 404 hygiene | Dedicated not-found handling; filtered catalogue views can force noindex when appropriate |
| Site icons for crawlers | Favicon / apple-touch / icon routes served outside /api/ so robots are not blocked |
| On-demand revalidation | Cache tags + revalidation hooks so SEO URLs stay fresh after CMS edits |
Built so assistants and answer surfaces can extract clear entities and Q&A:
Organization, LocalBusiness, Service, Article, FAQPage, BreadcrumbListschemaEligible (and that are publicly published)schemaTypes multi-select)areaServed when service areas existmapURL) and Google Reviews (mapsUrl) — validated HTTPS Maps hosts onlygoogle-reviews global) ties the site to the real Maps listingProduction frontends load a full measurement stack from the root layout:
beforeInteractive) — storage defaults queued before tags<noscript> iframe (NEXT_PUBLIC_GTM_ID)NEXT_PUBLIC_GA_ID)dataLayer — typed helper pushes privacy-safe events (allowlisted params only; no raw PII)| Event | Typical trigger |
|---|---|
whatsapp_click | Tracked WhatsApp CTAs (hero, sticky bar, service landings, catalogue) |
phone_call_click | Click-to-call CTAs |
generate_lead | Confirmed quote/lead form success |
select_item / view_item | Catalogue / product exploration |
reviews_view_google_click / review_write_click | Google Reviews CTAs |
Cookie UI: Cookie Consent banner + settings button; consent updates align with GTM/GA4 Consent Mode v2. Analytics scripts are intended for production (NODE_ENV=production).
Step-by-step setup (GTM container, Payload admin tracking settings, Google Ads conversions for form / WhatsApp / phone clicks, deploy and testing): .claude/skills/nextjs-payload-gtm-tracking/SKILL.md.
Configure per brand:
NEXT_PUBLIC_GA_ID=G-XXXXXXXXXX
NEXT_PUBLIC_GTM_ID=GTM-XXXXXXX
| Piece | Details |
|---|---|
| Payload global | Google Reviews (google-reviews): enable flag, Place ID, heading/subheading, review limit (3–5), Maps URL, write-review URL |
| Native reviews | Server fetch via Places API (New) using server-only GOOGLE_PLACES_API_KEY (never NEXT_PUBLIC_*, never stored in Payload) |
| UI | Stars, carousel/scroller, review text, attribution links; tracked view/write CTAs |
| Fallback | If disabled / missing key / missing Place ID → still shows “View on Google” + “Write a Review” Maps links |
| Contact Maps | ContactInformation.mapURL for the business listing (validated Google Maps hosts) |
| Caching | Reviews payload revalidated periodically; graceful last-good fallback while the process is warm |
Production gate: pnpm env:check requires a non-empty GOOGLE_PLACES_API_KEY for production-shaped environments.
| Collection | Purpose |
|---|---|
| Users | Auth-enabled admins for Payload |
| Pages | Draft-enabled layout-builder pages |
| Posts | Blog / news with layout builder |
| Projects | Case-style project pages |
| Services | Service catalogue + landing data |
| PortfolioItems | Portfolio gallery / explorer |
| Media / LeadMedia | Uploads + lead attachment media |
| FAQs / Testimonials | Reusable trust content (FAQs support schema-eligible AEO) |
| Leads | Private inbound quote/contact leads |
| Redirects | Managed URL redirects (SEO migrations) |
| Areas / Categories | Location + taxonomy (GEO / local coverage) |
| CurtainBlindCategories / CurtainBlindProducts | Catalogue-style product lines |
Header, Footer, Homepage, AboutPage, ContactPage, ContactInformation (incl. Google Maps URL), SiteSettings, SEODefaults, SocialMedia, ArchiveSettings, GoogleReviews.
Hero, Content, RichContent, SplitContent, MediaBlock, Banner, CallToAction, Form, QuoteForm, Faqs, Testimonials, ServiceGrid, ProcessSteps, Benefits, Statistics, LocationCoverage, ProjectGallery, RelatedPosts, ArchiveBlock, Code.
@payloadcms/email-nodemailer)@payloadcms/plugin-seo, form-builder, nested-docs, redirects, search@payloadcms/richtext-lexical, live-preview-react, admin-barnext-sitemap, Tailwind CSS v4, Radix/shadcn-style primitivesPre-configured Payload config, authentication, access control, layout builder, draft preview, live preview, on-demand revalidation, SEO, search, redirects, and website App Router — then extended for service-business production use. See Payload Website Template.
Copy .env.example → .env. Required for a healthy local/prod boot:
| Variable | Notes |
|---|---|
DATABASE_URI | PostgreSQL connection string (project-specific DB — never reuse another brand’s DB) |
PAYLOAD_SECRET | ≥ 32 random characters |
NEXT_PUBLIC_SERVER_URL | Public site origin, e.g. https://example.com |
PREVIEW_SECRET | Draft preview |
REVALIDATION_SECRET | On-demand revalidation |
Analytics, Maps & Reviews:
| Variable | Notes |
|---|---|
NEXT_PUBLIC_GTM_ID | Google Tag Manager container ID (integrated in root layout) |
NEXT_PUBLIC_GA_ID | Google Analytics 4 measurement ID |
GOOGLE_PLACES_API_KEY | Server-only Places API (New) for native Google Reviews — never expose as NEXT_PUBLIC_* |
SMTP_* | Lead email delivery |
Run pnpm env:check before production builds.
| Command | Purpose |
|---|---|
pnpm dev | Local development |
pnpm build / pnpm start | Production build & serve |
pnpm payload migrate | Run migrations |
pnpm seed | Optional seed content |
pnpm template:check | Ensure demo artifacts stay removed |
pnpm release:gate | Env + template check + lint + types + tests + build |
pnpm test:unit / test:integration / test:e2e / test:a11y | Quality suites |
Typical flow used for the live UAE sites (Node process behind Nginx / reverse proxy):
cp .env.example .env
# set production DATABASE_URI, secrets, NEXT_PUBLIC_SERVER_URL=https://your-domain.com
pnpm install --frozen-lockfile
pnpm payload migrate
pnpm env:check
pnpm build
pnpm start
# or: node .next/standalone/server.js when using Next standalone output
A/AAAA (and www) to the server.127.0.0.1:3000 or your chosen port).Host, X-Forwarded-For, X-Forwarded-Proto./api/media/...) and admin (/admin).storage/ or your configured media path) across deploys..env outside the public web root; never commit it.next.config.ts sets output: 'standalone'. After pnpm build you can run the standalone server under pm2, systemd, or Docker.
Example pm2:
pnpm build
pm2 start pnpm --name my-site -- start
# or point pm2 at .next/standalone/server.js with HOSTNAME=0.0.0.0 PORT=3000
docker build -t nextjs-payload-website .
docker run --env-file .env -p 3000:3000 nextjs-payload-website
Ensure Postgres is reachable from the container (DATABASE_URI host must work inside the network).
git pull
pnpm install --frozen-lockfile
pnpm payload migrate
pnpm build
# restart process manager / container
Always backup Postgres + media storage before migrate/deploy.
TEMPLATE.md: rename package/brand, swap logo/favicon, new DB + secrets.NEXT_PUBLIC_SERVER_URL and any hardcoded image host allowlists in next.config.ts.pnpm install → pnpm payload migrate → pnpm template:check → pnpm dev..env, database, or upload storage.Isolation tip (as used for Al Mustajid vs Al Rukn): each brand gets its own database, secrets, deploy directory, and env file.
src/
app/(frontend)/ # Public Next.js routes
app/(payload)/ # Payload admin + API
blocks/ # Layout builder blocks
collections/ # CMS collections
globals/ # Site-wide globals
components/ # UI + landing kits
endpoints/ # Custom API (e.g. quote request)
migrations/ # Payload DB migrations
lib/ # SEO, analytics, cache, queries
docs/ # Provenance, plans, ops notes
scripts/ # Seed, import, verify, env checks
tests/ # Unit, integration, e2e, a11y
website template via [email protected] (PostgreSQL). See docs/template-provenance.md.LICENSE.template-payload (upstream attribution).
Small business website for counseling practices with services, team and resources pages on Next.js and MongoDB

Next.js and Payload CMS website kit with an MCP plugin and coding-agent skills for Codex and Claude Code

Event ticketing demo with venues, seat capacity and Stripe checkout using the payload-reserve plugin