nextjs-cms

Getting Started

Go from an empty folder to a running admin panel with your own content types.

This section walks you through creating a project, understanding what's inside it, building your first section, and tuning cms.config.ts.

The development loop

Once installed, working with nextjs-cms is a three-step loop:

  1. Edit a *.section.ts file (add a field, change an option, create a new section).

  2. Sync the database:

    Terminal
    pnpm nextjs-cms --dev update-sections
  3. Refresh the admin. In development, section files are hot-reloaded, so the form updates without restarting next dev.

Good to know:

Only changes that affect the database need update-sections: new or renamed fields, new sections, column changes (like a text field's maxLength, which sets the VARCHAR length, or required, which sets NOT NULL), and index changes. Purely visual changes such as a label, placeholder, icon, or order are picked up on refresh. When in doubt, run it: it compares your sections with the database and only acts on the differences.