$ show notum-cz/strapi-next-monorepo-starter
This is an enterprise-ready monorepo starter for content-driven websites, combining Strapi v5 (headless CMS) as the backend and Next.js 16 (App Router) as the frontend, managed with Turborepo and pnpm. In production, it provides a visual page builder with dynamic zones in Strapi, rendered server-side by Next.js with ISR and cache revalidation via Strapi document middleware. The system includes end-user authentication (Better Auth + Strapi JWT), localization (next-intl), media handling (imgproxy), SEO helpers, preview mode, optional CDN purge (Azure Front Door), and observability (Sentry, Azure Monitor). It is not a data research repository; the hybrid nature comes from data seeding workflows and Strapi config-sync exports that version content-model layouts and permissions, but the dominant character is a full-stack web application starter. The architecture is a monorepo with two primary apps (`apps/strapi` and `apps/ui`), shared packages (`packages/design-system`, `packages/logging`, `packages/eslint-config`, `packages/shared-data`, `packages/strapi-types`), a Docusaurus documentation site (`apps/docs`), and a Playwright QA workspace (`qa/tests/playwright`). Key entry points include the Strapi bootstrap and admin panel extensions, the Next.js middleware chain (`proxy.ts`) implementing basic auth, redirects, auth guard, and security headers, catch-all ISR pages, and API routes for revalidation, CDN purge, and Strapi proxying. The primary data flow is content authored in Strapi → published → document middleware triggers UI revalidation → Next.js fetches Strapi content via server-side API clients and renders pages with ISR. External dependencies are modern and pinned (Next.js 16, React 19, Strapi v5, TailwindCSS v4, Better Auth). The codebase demonstrates high craftsmanship with clean abstractions: a composable proxy middleware chain, pluggable CDN and telemetry providers, a typed Strapi API client with pagination, a hierarchy service computing fullPath changes with redirect compaction, and a shared logging package with OpenTelemetry correlation. Testing is comprehensive with Vitest unit tests and Playwright e2e/visual/SEO/accessibility suites. Some scaffolding remains incomplete (e.g., `removeThisWhenYouNeedMe` markers), and the two rich-text editors (CKEditor and TipTap) introduce duplicate rendering paths. Overall, this is a strong, well-documented starter suitable for teams building content-rich websites with a modern stack.
The LLM identified 5 files worth highlighting for reuse:
A logging package providing a pino-based logger with OpenTelemetry correlation, `withSpan` for span wrapping, `logError` normalization, and configurable redaction paths. It is a standalone package (imports only external libraries) and can be extracted into any Node.js application for structured, correlation-aware logging.
A minimal shared-data package exporting `normalizePageFullPath`, `normalizeCachePath`, and `strapiCacheTag`. This serves as a byte-exact contract between Strapi and the UI for cache tags and path normalization, ensuring revalidation keys match. It is fully self-contained and can be reused in any project needing a canonical cache-tag naming convention.
A redirect lookup module implementing stale-while-refresh caching with in-flight request deduplication. It caches CMS-managed redirects in memory, uses a configurable TTL, and deduplicates concurrent lookups. This pattern is reusable for any CMS-driven redirect system and demonstrates careful cache-control design.
A CDN purge provider factory that resolves a provider implementation based on environment variables, returning `null` when unset (inert feature). The bundled provider (Azure Front Door) uses managed identity for authentication. This clean interface pattern allows easy swapping of CDN backends without changing business logic.
A Strapi service that computes `fullPath` changes from a page's parent chain, applies updates as system writes (avoiding re-triggering middleware), and creates or updates redirects with chain/loop compaction. This non-trivial algorithm demonstrates careful state management and is reusable in any CMS that needs automatic path recalculation and redirect management.