logo
Baysoffire

Read me

Robin CMS

A modern, block-based content management system built with Payload CMS 3 and Next.js 15. Robin CMS gives content editors a visual, component-driven editing experience with a fully themeable frontend powered by Tailwind CSS 4, Motion (Framer Motion), and Material Design 3 design tokens.


Table of Contents


Description

Robin CMS is a headless CMS with a tightly integrated Next.js frontend. Pages are composed from a library of reusable content blocks, each with per-block color, spacing, and layout overrides. The admin panel provides color pickers that pull preset values straight from the global theme, making it easy to stay on-brand while still allowing creative flexibility per section.

Tech Stack

LayerTechnology
CMSPayload CMS 3 (v3.76.1)
FrameworkNext.js 15 (App Router)
RuntimeReact 19
DatabaseMongoDB (via Mongoose adapter)
StylingTailwind CSS 4, CSS custom properties
AnimationMotion (Framer Motion) v12
Rich TextLexical editor
Markdownreact-markdown, remark-gfm, rehype-highlight, rehype-slug
MediaSharp image processing, Vercel Blob storage
Lightboxyet-another-react-lightbox
Package Managerpnpm

Installation

Prerequisites

  • Node.js ^20.9.0 or >=22.0.0
  • pnpm (recommended)
  • MongoDB instance (local or Atlas)

Steps

bash# 1. Clone the repository
git clone https://github.com/<your-org>/robin-cms-payload.git
cd robin-cms-payload

# 2. Install dependencies
pnpm install

# 3. Create a .env file in the root
cp .env.example .env
# Then fill in the required values (see Configuration below)

# 4. Generate Payload types and import map
pnpm payload generate:types
pnpm payload generate:importmap

# 5. Start the dev server
pnpm dev

The site will be available at http://localhost:3000 and the admin panel at http://localhost:3000/admin.


Usage

Development

bashpnpm dev          # Start Next.js + Payload in development mode

Production

bashpnpm build        # Build for production
pnpm start        # Start the production server

Other Commands

bashpnpm lint                       # Run ESLint
pnpm payload generate:types     # Regenerate TypeScript types from Payload config
pnpm payload generate:importmap # Regenerate the admin import map

Features

  • Block-Based Page Builder — Compose pages from 19 content blocks with drag-and-drop ordering in the admin panel.
  • Global Theme & Styling — Centrally manage brand colors, surface colors, text colors, typography (Google Fonts), font scale, border radius, button styling, and animation settings.
  • Per-Block Color Overrides — Every content block has a "Block Colors" group that lets editors override the background, primary text, and secondary text colors with a theme-aware color picker.
  • Background Patterns — Layer any of 40 tileable SVG patterns (across 8 categories) over a block's background, with configurable pattern color and opacity.
  • Per-Block Typography Overrides — Selected blocks expose a "Typography" group to override the font family, weight, and size for that block only, defaulting to the global theme.
  • Per-Block Spacing Overrides — Blocks include a "Block Spacing" group for custom padding and margin (top/right/bottom/left) with preset and custom pixel values.
  • Theme-Aware Color Picker — Admin color picker component that fetches live theme values and presents them as labeled quick-select presets alongside a full hex picker.
  • Font Select Field — Admin font picker supporting Google Fonts with live preview for headings, body, buttons, and navigation.
  • Responsive Design — Mobile-first layouts with Tailwind CSS 4 utility classes.
  • Animations — Configurable entrance animations (fadeUp, fadeIn, slideLeft, slideRight, scale) per block, powered by Motion with spring physics. Animation intensity is globally adjustable (subtle/standard/expressive).
  • Hero Scroll Effects — Optional scroll-driven visual effects on hero background images: Zoom In, Parallax Depth Shift, and Blur. Effects are powered by Motion's useScroll / useTransform and can be switched off per block.
  • Rich Text Editing — Lexical-based rich text editor with inline toolbar, lists, links, media embeds, and more.
  • Markdown Document Block — Write or upload GFM Markdown with syntax highlighting and auto-generated table of contents.
  • Carousel Block — Image carousel with autoplay, snap scrolling, infinite loop, configurable aspect ratios, and lightbox-style captions.
  • Card Grid Block — Versatile card layouts (standard, horizontal, overlay, minimal) with 1–4 column grids and per-card styling options.
  • Contact Form Block — Built-in contact form with honeypot, timestamp, and rate-limit anti-spam protection. Submissions are stored in the Contact Messages collection.
  • SEO Ready — Global SEO defaults, per-page meta overrides (title, description, keywords), Open Graph images, and robots.txt configuration.
  • Header & Footer Builders — Configurable navigation with dropdown menus, CTA buttons, multi-column footers, social links, and newsletter section.
  • Media Management — Automatic image resizing with Sharp (thumbnail, card, hero, og sizes), focal point editing, and optional Vercel Blob storage.
  • Image Compressor — Built-in admin provider for client-side image compression before upload.
  • Live Preview — Preview pages at mobile (375×667), tablet (768×1024), and desktop (1440×900) breakpoints directly in the admin panel.
  • Saved Blocks Library — Save any configured block as a reusable template. Import saved blocks into any page with one click from the "Import Saved Block" drawer, organized by category with search.
  • Version Control — Drafts with autosave and scheduled publishing for Pages.
  • Vote / Feedback Popup — Scroll-triggered 5-star rating popup with optional text feedback. Configurable per-site via Site Settings. Both feedback fields (name and message) are fully optional — clicking Send with empty fields still shows the thank-you message.
  • GraphQL & REST APIs — Auto-generated APIs for all collections and globals, plus custom vote endpoints.

Configuration

Environment Variables

Create a .env file in the project root with the following variables:

env# Required
MONGODB_URI=mongodb+srv://<user>:<password>@<cluster>.mongodb.net/<database>
PAYLOAD_SECRET=<a-long-random-string>

# Optional
NEXT_PUBLIC_SERVER_URL=http://localhost:3000

Global Settings (Admin Panel)

GlobalPathPurpose
Site Settings/admin/globals/site-settingsSite title, description, logos, favicon, SEO defaults, social links, analytics IDs, custom scripts, vote popup settings
Theme & Styling/admin/globals/themeBrand colors (primary, secondary, accent, highlight, dark), surface colors, text colors, typography & font scale, heading overrides (h1–h6), layout (container width, section padding, border radius), button styling & hover effects, animation settings
Header/admin/globals/headerLogo, navigation items (up to 8) with dropdown children, CTA button, sticky/transparent options
Footer/admin/globals/footerMulti-column link lists (up to 4), description, newsletter section, bottom bar with copyright and links, optional social links

Collections

CollectionSlugDescription
PagespagesContent pages built from 19 blocks. Supports drafts, autosave, scheduled publishing, per-page SEO, and optional background color.
MediamediaUploaded images, videos, and PDFs. Auto-generates thumbnail (400×300), card (768×512), hero (1920×auto), and og (1200×630) sizes.
UsersusersAdmin and editor accounts with Payload built-in auth. Roles: admin, editor, or viewer (read-only).
VotesvotesStores star ratings and optional text feedback from the vote popup. Fingerprint-based duplicate prevention. Public read/create; authenticated update/delete.
Contact Messagescontact-messagesStores contact form submissions (name, email, message). Public create; authenticated read/update/delete. Messages can be marked as read in the admin panel.
Saved Blockssaved-blocksReusable block templates that can be imported into any page. Each entry stores a name, optional category, description, and a single configured block (15 block types supported).

Blocks

Robin CMS includes 19 content blocks, each configurable with per-block color and spacing overrides:

BlockSlugDescription
HeroheroFull-screen, split, centered, or minimal hero sections with background images, overlays, scroll-driven visual effects (zoom, parallax, blur), bottom gradients, and CTA buttons.
Rich TextrichTextLexical rich text content with single or two-column layouts and configurable max widths (narrow/medium/wide/full).
Image + TextimageTextSide-by-side image and rich text with configurable image size (33%/50%/66%), position, vertical alignment, and rounded corners. Supports an Image Only layout with 4 width options (small/medium/large/full), 12 image mask shapes (circle, rounded, blob, wave, heart, star, flower, burst, splash, torn paper, cross, teardrop), up to 3 CTA buttons (with optional Heroicons) below text, and a text-only layout option.
Call to ActionctaStandard, banner, card, or inline CTA sections with up to 3 buttons (filled, outlined, tonal, text, elevated).
Accordion / TabsaccordionTabsCollapsible accordion or tabbed content with animated transitions, optional icons, and configurable default-open index.
Card GridcardGridStandard, horizontal, overlay, or minimal card layouts in 1–4 column grids with card styling variants (elevated/filled/outlined) and per-card buttons.
CarouselcarouselImage carousel with standard, fill, or mixed layouts. Supports autoplay, snap scrolling, infinite loop, arrow/dot navigation, and configurable aspect ratios.
Quote / TestimonialquoteCard, minimal, or large-featured quote styles with author info, role, and avatar.
Photo GallerygalleryGrid, masonry, carousel, or single-featured layouts with lightbox support, configurable columns, and rounded corners.
Bento GallerybentoGalleryScroll-driven bento-grid gallery with a Ken Burns zoom that animates toward a focus image, plus an optional floating title with configurable visibility.
VideovideoYouTube and Vimeo embeds with custom poster images, aspect ratios (16:9, 4:3, 1:1), and configurable max widths.
Markdown DocumentmarkdownDocGFM Markdown content written in-editor or uploaded as a .md file. Auto-generates table of contents from headings. Supports syntax highlighting.
EmbedembedRaw HTML embed code for iframes, widgets, maps, etc. Configurable max width and alignment.
SeparatorseparatorDecorative dividers — wave, blob, hand-drawn, slant, or simple line — with color, gradient, flip, and animation options.
SpacerspacerVertical spacing with preset sizes (32–128 px) or custom pixel heights (8–500 px).
Contact FormcontactFormContact form with name, email, and message fields. Anti-spam protection via honeypot, timestamp check, and IP rate limiting. Submissions saved to the Contact Messages collection.
TimelinetimelineHorizontal (immersive, full-background-image tabs) or vertical (classic alternating left/right) timeline layout. Items have a date label, title, subtitle, description, and optional image.
Horizontal TexthorizontalTextMarquee-style text that scrolls horizontally across the screen, with configurable font, weight, size, speed, direction, separator, and an optional letter fly-in animation.
Vinyl PlayervinylPlayerInteractive turntable showcase that slides up to 5 records onto a spinning vinyl, each with a cover sleeve, center label, track details, and optional audio playback.

Saved Blocks (Reusable Block Templates)

The Saved Blocks collection lets editors save fully configured blocks as reusable templates. When editing a page, click the "Import Saved Block" button above the layout blocks area to open a slide-out drawer where you can browse, search, and filter saved blocks by category, then import them into the page with one click.

How It Works

  1. Create a saved block — Go to /admin/collections/saved-blocks and click "Create New". Give it a name, pick a category, and configure the block exactly as you want it.
  2. Import into a page — Open any existing page, click "Import Saved Block" in the Content tab, and select a template from the drawer. The block is appended to the page layout with all its saved settings.
  3. Customise per page — After importing, you can edit any field on the imported block without affecting the original saved template.

Categories

CategoryIntended Use
HeroesHero section templates
ContentRich text, accordion, embed blocks
MediaGallery, carousel, video blocks
NavigationNavigation-related blocks
Call to ActionCTA block templates
TestimonialsQuote / testimonial blocks
LayoutSpacer, separator, structural blocks
OtherEverything else

Note: The page must be saved at least once before importing saved blocks (the import uses the REST API to append the block to the page layout).

Per-Block Color Overrides

Every content block (except Spacer and Separator) includes a Block Colors group with:

  • Background Color — Override the section background.
  • Primary Text Color — Override heading and body text color (--color-text-primary).
  • Secondary Text Color — Override subtitle and caption color (--color-text-secondary).
  • Button Background / Text Color — Override the filled-button colors for the block.
  • Background Pattern — Layer one of 40 tileable SVG patterns over the background, with configurable pattern color and opacity.

Each color field uses the theme-aware color picker that shows your theme's saved colors as labeled presets for quick selection.

Per-Block Spacing Overrides

All blocks include a Block Spacing group with two collapsible sub-groups:

  • Padding — Top, Right, Bottom, Left (none/small/medium/large/custom with pixel value).
  • Margin — Top, Right, Bottom, Left (same options).

Hero Scroll Effects

The Hero block supports an optional Scroll Effect that animates the background image as the section scrolls out of the viewport. The field only appears when a background image is set and defaults to None (off).

EffectValueBehaviour
NonenoneNo scroll-driven effect (default).
Zoom InzoomInThe background image scales from 1× to 1.25× as the hero scrolls out of view.
Parallax Depth ShiftparallaxThe image translates vertically at 30 % of the scroll speed, creating a depth/layering illusion.
BlurblurThe image progressively blurs from 0 px to 20 px as it exits the viewport.

Effects are implemented with Motion's useScroll and useTransform hooks and applied to a motion.div wrapper around the hero image. The hero section uses overflow-hidden to prevent visual overflow from zoomed or shifted images.


Vote Popup

A scroll-triggered feedback widget that collects star ratings and optional text feedback from visitors.

How It Works

  1. Scroll trigger — The popup appears once the user has scrolled past a configurable percentage of the page (default: 75 %).
  2. Star rating — A 5-star system with emoji feedback (😡 → 🤩). Clicking a star immediately submits the rating via POST /api/vote.
  3. Optional feedback — After rating, a reply form slides in with a "First name" input and a free-text textarea. Both fields are fully optional — clicking "Send Feedback" with empty fields immediately shows the thank-you message without making an additional API call.
  4. localStorage persistence — Votes and dismiss state are persisted so the popup won't re-appear after a vote or explicit dismiss.
  5. Minimize / Dismiss — Users can minimise the popup to a floating pill or dismiss it entirely.
  6. Average score — After submission the popup fetches and displays the average score for the current block.
  7. Delete vote — A "Delete my vote" link allows users to remove their rating.

Configuration (Admin → Site Settings → Vote Popup)

SettingDefaultDescription
EnabledfalseToggle the popup on/off site-wide
Scroll %75Page scroll percentage to trigger visibility (5–100)
Block IDsite-popup-voteIdentifier for grouping votes
HeadingHow was your experience?Popup title
SubheadingYour feedback helps us improve.Popup subtitle
Reply PromptTell us more about your experience...Textarea placeholder
Thank You MessageThank you for your feedback!Shown after submission
Accent Color#ff9529Star and highlight color (theme-aware picker)
Background ColorPopup card background (theme-aware picker)
Text ColorPrimary text color (theme-aware picker)
Text Secondary ColorSecondary text color (theme-aware picker)
Border Radiusglobalglobal / 0 / 4 / 8 / 16 / 24 / 9999
Shadowlargenone / small / medium / large

API Routes

Viewer (Demo) Role

Robin CMS includes a Viewer role designed for demo or stakeholder access. A viewer can log into the admin panel and browse every collection and global, but cannot create, update, or delete any content.

RoleReadCreateUpdateDelete
AdminYesYesYesYes
EditorYesYesYesYes
ViewerYesNoNoNo

To create a demo account, go to Users → Create New in the admin panel and set the role to Viewer.


MethodEndpointDescription
POST/api/contactSubmit a contact form message. Includes honeypot, timestamp, and rate-limit anti-spam checks.
POST/api/voteSubmit a star rating (1–5) for a block. Fingerprint-based duplicate detection. Can also update an existing vote with a reply and first name.
DELETE/api/voteDelete a single vote by voteId, or all votes for a block by blockId.
GET/api/vote-resultsReturns aggregated results: total votes, per-block average ratings, score distributions (1–5), and text replies.
*/api/[...slug]Auto-generated Payload REST API for all collections and globals.
*/api/graphqlAuto-generated Payload GraphQL endpoint.

License

MIT