🚀 Ship faster with premium components 🚀
Search documentation v1.5.0

Seed

Seeding the database

Running npm run db:seed populates your remote database with the default records required for the CMS to function. The seed script is idempotent — it checks for existing records before inserting, so it is safe to run multiple times without duplicating data. You can modify the seed data in the db/data.ts file.

If any of the required environment variables (ADMIN_EMAIL, ADMIN_USER, ADMIN_PASS) are missing from your .env file, the seed will abort early with an error. Make sure these are set before running.

For complete setup instructions, please refer to the Setup docs.

Users

Two user accounts are created on first seed:

A non-interactive system user is also created. This is an internal account used to track records created by the CMS itself (default states, types, fields, and blocks). It cannot log in and cannot be modified from the CMS. It should not be modified directly from the database.

Make sure to change your admin credentials in .env before seeding a production database.

Roles

Five roles are seeded with pre-configured permission sets:

RoleDescription
admin Full system access. All permissions. Cannot be deleted.
editor Manage all content and types. Full content CRUD, type and state management, user read access.
author Create and manage own content only.
viewer Read-only access to content, types, states, and users.
content-viewer Content read access only.

Each role’s content permissions are automatically scoped to all seeded content types. See Roles & Permissions for the full permission breakdown. With the exception of admin, you can freely modify these roles after initial setup.

Content States

Three system states are seeded that cannot be deleted:

State NameSystem StateDescription
Draft DRAFT Content is being actively edited and is not publicly visible.
Published PUBLISHED Content is published and publicly visible.
Archived ARCHIVED Content is no longer active but kept for historical reference.

Content Types

Three content types are seeded as a starting point:

TypeNameSupports BlocksNotes
page Pages Yes System type. Cannot be deleted. Used for main content pages.
blog Blog Posts Yes Pre-configured with some example fields.
author Authors No Pre-configured with an example. Designed to be referenced by other types.

The page type is a system type and cannot be deleted. The blog and author types are removable and serve as examples you can modify or replace.

Content Fields

Fields are seeded for each default content type. With some exceptions for the page type, you can freely modify these fields after initial setup in your Types page.

Content Entries

Three example entries are seeded to give you something to work with immediately:

TypeNameState
page Homepage Published — available at /
blog Getting Started Draft — available at /blog/getting-started
author John Doe Published — referenced by the Getting Started post

Content Blocks

Some default content blocks are also created for the homepage to help you get started. All of this data can be changed after your initial setup, or you can also removed them entirely from the seeding by deleting them from the db/data.ts file.