Core Concepts
Understand the building blocks of Schemaful: schemas, fields, entries, assets, and locales.
Schemas
A schema defines a content type. Think of it as a blueprint for your content. Each schema has an ID, display name, and a collection of fields.
{
id: "blog-post",
name: "Blog Post",
description: "Articles for the company blog",
displayField: "title" // Field shown in entry lists
}Schemas are stored in the cms_schemas table.
Fields
Fields define the structure of content within a schema. Schemaful supports 10 field types:
| Type | Description | Example |
|---|---|---|
| Symbol | Short text (max 256 chars) | Title, slug |
| Text | Long text (unlimited) | Description, excerpt |
| RichText | Structured rich text (JSON) | Article body |
| Integer | Whole numbers | Order, count |
| Number | Decimal numbers | Price, rating |
| Boolean | True/false | Published, featured |
| Date | ISO date string | Publish date |
| Location | Lat/long coordinates | Store location |
| Link | Reference to entry/asset | Author, hero image |
| Array | List of any type above | Tags, gallery |
Fields can be required, localized, and have validations.
Entries
An entry is an instance of a schema—your actual content. Entries are stored per-locale with JSONB data.
{
id: "abc123",
schemaId: "blog-post",
locale: "en",
data: {
title: "Getting Started with Schemaful",
slug: "getting-started",
content: { /* RichText JSON */ },
author: { sys: { id: "author-1", linkType: "Entry" } }
},
publishedAt: "2025-01-15T10:00:00Z"
}Entries can be draft (unpublished) or published. The same entry ID can have different content per locale.
Assets
Assets are media files (images, documents, videos) with localized metadata.
{
id: "img-001",
locale: "en",
title: "Hero Image",
description: "Homepage hero banner",
fileName: "hero.jpg",
contentType: "image/jpeg",
url: "https://cdn.example.com/hero.jpg",
width: 1920,
height: 1080
}Assets are referenced from entries using Link fields with linkType: "Asset".
Locales
Locales define the languages your content supports. Each locale has a code, name, and optional fallback chain.
// Default locale
{ code: "en", name: "English", isDefault: true }
// With fallback chain
{ code: "fr-CA", name: "French (Canada)", fallbackCode: "fr" }
{ code: "fr", name: "French", fallbackCode: "en" }When content is missing in a locale, Schemaful falls back through the chain.fr-CA → fr → en
Links & References
The Link field type creates references between content.
// Entry link
{
sys: {
id: "author-123",
linkType: "Entry"
}
}
// Asset link
{
sys: {
id: "image-456",
linkType: "Asset"
}
}When fetching entries, you can resolve links to include the full referenced content (avoiding N+1 queries).
Next Steps
- • Query content with the tRPC API
- • Deploy your CMS with self-hosting