A modern, full-stack monorepo template built with Next.js App Router, Contentful CMS, Shadcn UI, and TurboRepo for building scalable web applications with a top-tier content management system.

This monorepo demonstrates modern web development practices with a focus on developer experience, performance, and maintainability.
turbo-next-contentful/
βββ apps/
β βββ web/ # Next.js frontend application
βββ packages/
β βββ ui/ # Shared UI components (Shadcn UI)
β βββ eslint-config/ # Shared ESLint configuration
β βββ typescript-config/ # Shared TypeScript configuration
βββ turbo.json # TurboRepo configuration
- Next.js 14 App Router - Modern React framework with file-based routing
- TypeScript - Type-safe development experience
- Shadcn UI + Tailwind CSS - Beautiful, accessible UI components
- Server Components - Optimized rendering and performance
- Dynamic Page Builder - Flexible content layouts from Contentful
- Blog System - Full-featured blog with rich text support
- SEO Optimized - Built-in metadata, sitemaps, and structured data
- Contentful CMS - Headless content management system
- GraphQL Integration - Type-safe content fetching with codegen
- Rich Text Rendering - Custom rich text components
- Preview Mode - Live preview of draft content
- Image Optimization - Automatic image optimization and delivery
- TurboRepo - Monorepo build system with intelligent caching
- Shared Packages - Reusable components, configs, and utilities
- ESLint & Prettier - Code quality and formatting
- TypeScript - End-to-end type safety
- Node.js 18+
- pnpm (recommended package manager)
- Contentful account and space
git clone <your-repo-url>
cd turbo-next-contentful
pnpm install
Create a .env.local
file in apps/web/
:
# Contentful Configuration
CONTENTFUL_SPACE_ID=your_space_id
CONTENTFUL_ACCESS_TOKEN=your_access_token
CONTENTFUL_PREVIEW_ACCESS_TOKEN=your_preview_token
CONTENTFUL_ENVIRONMENT=master
# Preview Mode
CONTENTFUL_PREVIEW_SECRET=your_preview_secret
pnpm run dev
This starts the Next.js application at http://localhost:3000.
The application supports various content types through Contentful:
- Pages - Dynamic pages with flexible page builder
- Blog Posts - Articles with rich text content
- Global Settings - Site-wide configuration
- Navigation - Header and footer content
- Reusable Sections - Hero, CTA, FAQ, Feature cards
Flexible content sections that can be mixed and matched:
- Hero sections with call-to-actions
- Feature cards with icons
- FAQ accordions
- Call-to-action blocks
Mobile-first approach with Tailwind CSS utilities and responsive components.
- Server-side rendering with Next.js App Router
- Optimized images with Contentful's delivery API
- Static generation where possible
- Intelligent caching with TurboRepo
- Automatic sitemap generation
- Structured data (JSON-LD)
- Meta tags and Open Graph support
- Dynamic robots.txt
- Connect your repository to Vercel
- Set the root directory to
apps/web
- Configure environment variables
- Deploy automatically on git push
The Next.js app can be deployed to any platform that supports Node.js applications.
Shared components go in packages/ui/src/components/
. App-specific components go in apps/web/src/components/
.
- Create content types in Contentful
- Run
pnpm run codegen
to generate TypeScript types - Add components to render the new content types
The project uses Tailwind CSS with a shared configuration. Customize tailwind.config.ts
in the respective packages.
pnpm run dev
- Start development serverspnpm run build
- Build all applicationspnpm run codegen
- Generate TypeScript types from Contentful schemapnpm run lint
- Run ESLint across all packagespnpm run type-check
- Run TypeScript checks
Contributions are welcome! Please read our contributing guidelines and code of conduct before submitting pull requests.