Skip to content

FoldCMS

Build content-rich applications with full type safety, access at build time as well as runtime, and the power of Effect.

🎯 Full Type Safety

End-to-end type safety powered by Effect Schema. Your editor knows your content structure better than you do. No codegen, no manual types—just pure TypeScript elegance.

⚡ Zero Runtime Cost

Build once, query instantly. All content compiled to SQLite at build time. No GraphQL layers, no API calls, no runtime overhead. Just blazingly fast queries.

🗄️ SQLite Performance

Efficient querying with automatic indexing. Orders of magnitude faster than file system reads. Your content is always ready, always fast.

🔗 Type-Safe Relations

Define relationships between collections with complete type inference. Single, array, and map relations—all fully typed. TypeScript knows the exact return type of every query.


schemas.ts
import { Schema } from "effect";
const PostSchema = Schema.Struct({
id: Schema.String,
title: Schema.String,
authorId: Schema.String,
tags: Schema.Array(Schema.String),
publishedAt: Schema.DateFromString,
});

JSON Files

Perfect for structured data like products, authors, and configuration.

jsonFilesLoader(ProductSchema, {
folder: "content/products"
})

YAML Files

Human-friendly format for categories, tags, and settings.

yamlFilesLoader(CategorySchema, {
folder: "content/categories"
})

MDX

Rich content with frontmatter, code blocks, and React components.

mdxLoader(BlogPostSchema, {
folder: "content/blog",
bundlerOptions: {}
})

Custom Loaders

Stream-based API for loading from anywhere: databases, APIs, or custom formats.

Stream.fromIterableEffect(
Effect.tryPromise(() =>
fetch("/api/data")
)
)

FoldCMS supports powerful, type-safe relationships between your content:

Single Relations

One-to-one relationships. Returns Option<T>.

relations: {
authorId: {
type: "single",
field: "authorId",
target: "authors"
}
}

Array Relations

One-to-many relationships. Returns readonly T[].

relations: {
tagIds: {
type: "array",
field: "tagIds",
target: "tags"
}
}

Map Relations

Key-value relationships. Returns ReadonlyMap<string, T>.

relations: {
translations: {
type: "map",
field: "i18nMap",
target: "content"
}
}

FoldCMS is framework-agnostic. Build once during deployment, query anywhere in your application.


Built on Effect, the most powerful TypeScript framework for building robust applications.

Composable

Build complex workflows from simple, reusable pieces. Effect’s composition model makes your CMS logic readable and maintainable.

Testable

Pure functional architecture means testing is effortless. No mocks, no stubs—just supply dependencies and validate outputs.

Reliable

Structured errors instead of thrown exceptions. Know exactly what can fail and handle it elegantly with LoadingError, ValidationError, and TransformationError.


Get started in minutes
# Install FoldCMS
bun add @foldcms/core effect @effect/platform @effect/sql-sqlite-bun
# Create your first collection
import { defineCollection, makeCms, build } from "@foldcms/core";
import { jsonFilesLoader } from "@foldcms/core/loaders";
const posts = defineCollection({
loadingSchema: PostSchema,
loader: jsonFilesLoader(PostSchema, { folder: "content/posts" })
});
const { CmsTag, CmsLayer } = makeCms({ collections: { posts } });
// Build and query
yield* build({ collections: { posts } });
const cms = yield* CmsTag;
const allPosts = yield* cms.getAll("posts");

  • 🎯 Type-Safe Schemas - Effect Schema for runtime validation + TypeScript types
  • ⚡ Stream-Based Loading - Efficient data processing with Effect Streams
  • 🗄️ SQLite Storage - Fast queries with automatic indexing
  • 🔗 Typed Relations - Single, array, and map relations with full type inference
  • 📦 Multiple Loaders - JSON, YAML, MDX, JSON Lines, and custom loaders
  • 🔄 Transformations - Transform data during loading with Effect pipelines
  • ✅ Validation - Custom validation rules that run at build time
  • ☁️ Asset Sync - Built-in utilities for syncing to S3-compatible storage
  • 🧪 Testable - Effect-based architecture makes testing trivial
  • 📝 Open Source - MIT licensed and community-driven

Ready to build something amazing?

Get started with FoldCMS today and experience content management with full type safety, zero runtime cost, and the power of Effect.