OOlgax DXP
Getting started

Project structure

A tour of a project generated by create-olgax-site - the Next.js routes, Payload config, custom blocks folder, scripts and the files you will edit most.

A generated project is a Next.js App Router app with Payload mounted inside it.

my-site/
├─ app/
│  ├─ (frontend)/        Public site, dashboard and the page editor routes
│  └─ (payload)/         Payload admin panel and API routes
├─ components/
│  ├─ blocks/            Your custom page-builder blocks
│  ├─ PageEditor.tsx     The Puck editor wrapper
│  ├─ PageRenderer.tsx   Renders a published page for visitors
│  └─ ...                Dashboard and editor UI
├─ lib/
│  ├─ puck.config.tsx    The one Puck config shared by editor and renderer
│  ├─ i18n.ts            Locales
│  ├─ pages.ts           Page helpers, the home slug
│  └─ ...                Analytics, personalization, server actions
├─ scripts/
│  ├─ seed.ts            Creates the admin user and demo content
│  └─ new-component.mjs  The pnpm new:component generator
├─ payload.config.ts     Collections, localization, database
├─ proxy.ts              Locale routing and the visitor cookie
├─ .env                  Your local environment (not committed)
└─ README.md             Project-level quick reference

The files you will touch most

FileWhy you would edit it
components/blocks/Add and change your own blocks. See Custom components.
lib/puck.config.tsxMerge more component sources, change the page-level (root) fields
lib/i18n.tsAdd a language. See Localization.
scripts/seed.tsChange the demo homepage and admin user
.envSecrets and the database URL. See Configuration.

How a page gets from the editor to a visitor

  1. An editor opens /<slug>/edit. The route requires a signed-in Payload user and loads the latest draft.
  2. PageEditor renders Puck with the config from lib/puck.config.tsx.
  3. Editing autosaves a draft to the pages collection. Publish marks it published.
  4. A visitor requests /<slug>. PageRenderer loads the published page and renders it with the same config.

Because both sides share one config, a block you add in components/blocks/ is available in the editor and on the public page without any extra wiring.

Packages the project depends on

The scaffold installs the published @olgax.com/* packages:

  • @olgax.com/payload-preset for collections and globals
  • @olgax.com/sdk for the component helpers
  • @olgax.com/components for the default blocks
  • @olgax.com/datasource for data-backed blocks

Upgrade them like any dependency: pnpm update "@olgax.com/*".

Questions, ideas or something not working?

Ask in our official Discord, open an issue on GitHub, or edit this page.

On this page