Workflow: Creating Content Types (Schema) - NIAID-Data-Ecosystem/nde-strapi GitHub Wiki

Create Content Types

This guide is intended for developers who need to modify or extend the content schema in Strapi by creating new collection types, single types, or components.


When to Use

Create or update content types when:

  • A new feature or page requires structured content.
  • You need to add new fields or relationships to existing types.

How to Create or Modify Content Types

Developers are encouraged to use the Strapi Admin UI to create and manage content types for most use cases. It provides a visual interface and ensures consistent structure and validation. There are two main ways to update content schema:

1. Via the Strapi Admin UI

  • Make sure your local development server is running:
 yarn develop
 # or
 npm run develop
  • Open your browser and navigate to http://localhost:1337/admin.
  • Go to Content-Type Builder from the left sidebar.
  • Create a new Collection Type, Single Type, or Component.
  • Add fields, validation, and relationships.
  • Save to apply changes.

2. Via Code (advanced)

  • Navigate to /src/api/ or /src/components/ in your project.
  • Define or edit model schemas in JSON or JavaScript.
  • Commit changes.

Make the content-type API route publicly available

  • Make sure your local development server is running:
 yarn develop
 # or
 npm run develop
  • Open your browser and navigate to http://localhost:1337/admin.
  • Go to Setting > User & Permissions Plugin > Roles from the left sidebar.
  • Toggle the desired permissions and save to apply changes.

Relevant Strapi Documentation