Core Concepts
Understand the mental model behind Laizy CMS — projects, schemas, content models, and tokens.
Core Concepts
Laizy CMS is built around a few simple ideas. Understanding them will make everything else click.
Projects
A project is an isolated workspace for your content. Each project has its own content models, content data, and access controls.
Think of it like a database — you might have one project for your marketing site, another for your docs, and another for a client's e-commerce store.
# List your projects
pnpm laizy project list
# Link this directory to a project
pnpm laizy linkProjects are scoped to an organization. Everyone in the organization can see and manage shared projects, and projects can be shared across organizations with specific roles.
Schemas
A schema is a .laizy file that defines your content models. It lives in your repository, gets version-controlled with Git, and is the single source of truth for your content structure.
model Product {
name: String { required: true }
price: Float { required: true }
description: String
sku: String { unique: true }
}When you run laizy sync, the CLI compares your local schema against the database and generates a migration plan. This is similar to how Prisma Migrate works — your schema file drives the database, not the other way around.
Content Models
A content model is a single model block in your schema. It defines a type of content with named, typed fields.
After syncing, each content model becomes:
- A collection in the database
- A TypeScript interface in the generated client
- A section in the dashboard's content editor
Field Types
Laizy supports these field types:
| Type | Description | Example |
|---|---|---|
String | Text content | titles, slugs, descriptions |
Int | Whole numbers | counts, positions |
Float | Decimal numbers | prices, ratings |
Boolean | True/false | published flags, toggles |
DateTime | Timestamps | created dates, scheduled publish times |
Each field can have constraints that control validation:
model Article {
title: String {
required: true // Must be provided
maxLength: 200 // Character limit
}
slug: String {
required: true
unique: true // No duplicates
}
viewCount: Int {
default: 0 // Default value
}
}Tokens
Laizy uses JWT tokens for authentication outside the dashboard. There are two token types:
Admin tokens
Generated from the Developer page in the dashboard. Admin tokens have full access to schema management, content CRUD, and project settings. The CLI uses admin tokens.
Authorization: Bearer laizy_eyJhbGciOiJI...Frontend tokens
Read-only tokens scoped to published content. Use these in your website or app to fetch content safely from the client side.
Authorization: Bearer laizy_eyJhbGciOiJI...Both token types are prefixed with laizy_ for easy identification. The project context is sent via the x-laizy-project header.
The Laizy workflow
Putting it all together, the typical workflow looks like this:
- Define your schema in
laizy/schema.laizy - Sync to the database with
laizy sync - Generate a TypeScript client with
laizy generate - Create content via CLI, dashboard, or AI chat
- Query content with the type-safe generated client
Every step is a CLI command, which means every step can be automated — by scripts, CI/CD pipelines, or AI agents.