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.
Requirements, the create-nextjs-cms prompts, and the first-run setup.
Project StructureWhat every file and folder in a new project does.
Your First SectionBuild a blog section, sync the database, and use it in the admin.
ConfigurationThe options in cms.config.ts you'll reach for first.
The development loop
Once installed, working with nextjs-cms is a three-step loop:
-
Edit a
*.section.tsfile (add a field, change an option, create a new section). -
Sync the database:
Terminalpnpm nextjs-cms --dev update-sections -
Refresh the admin. In development, section files are hot-reloaded, so the form updates without restarting
next dev.
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.