Skip to content

Content Types

Chukfi adapts to your business domain, not the other way around. Define any content type — blog posts, job openings, events, staff profiles — and Chukfi generates everything: database schema, REST API, and TypeScript types.

  1. Open the Content Types panel in the admin sidebar
  2. Click + New and give it a name (e.g., “Job Openings”)
  3. Add fields — each field has a name and a type (Text, Rich Text, Date, Number, Boolean, Media)
  4. Save — Chukfi generates the schema, migrations, and TypeScript types

For example, defining a “Job Openings” type with fields title, salary, location, and deadline automatically creates:

// Auto-generated by `chukfi codegen`
export interface JobOpenings {
title: string;
salary: string;
location: string;
deadline: string;
}
Type Description Use For
Text Single-line string Titles, names, short labels
Rich Text Formatted HTML content Blog posts, page bodies, descriptions
Date ISO 8601 date Event dates, deadlines, publish schedules
Number Integer or float Counts, prices, ratings
Boolean true/false toggle Feature flags, visibility toggles
Media File reference (S3-backed) Hero images, PDFs, downloads

After defining content types, regenerate TypeScript types for your frontend:

Terminal window
npx chukfi codegen --out src/types

This writes a chukfi-types.ts file with interfaces for every content type and a union type for type-safe queries. Import it directly into your Astro components for full IDE autocompletion.