Content infrastructure for the modern web

Aphex is a fully open source CMS built on SvelteKit. One codebase, one deploy, with content stored in your own database. Developers get schema-as-code and typed APIs. Editors get a polished Studio.

pnpm create aphex
Talk to us
post.ts
defineType({
  type: 'document',
  name: 'post',
  title: 'Post',
  fields: [
    { name: 'title',     type: 'string', validation: (Rule) => Rule.required() },
    { name: 'slug',      type: 'slug',   source: 'title' },
    { name: 'excerpt',   type: 'text',   rows: 2 },
    { name: 'heroImage', type: 'image' },
    { name: 'content',   type: 'array',  of: [{ type: 'block' }, { type: 'image' }] },
    { name: 'categories', type: 'array', of: [{ type: 'reference', to: [{ type: 'category' }] }] }
  ]
})
The Aphex Studio editing a post

One definition. Multiple interfaces.

Define a TypeScript content schema once. Aphex turns it into a typed Local API, HTTP endpoints, GraphQL, and a complete editing interface for your headless CMS.

01 / Definition post.ts
defineType({
  type: 'document',
  name: 'post',
  title: 'Post',
  fields: [
    { name: 'title',     type: 'string', validation: (Rule) => Rule.required() },
    { name: 'slug',      type: 'slug',   source: 'title' },
    { name: 'excerpt',   type: 'text',   rows: 2 },
    { name: 'heroImage', type: 'image' },
    { name: 'content',   type: 'array',  of: [{ type: 'block' }, { type: 'image' }] },
    { name: 'categories', type: 'array', of: [{ type: 'reference', to: [{ type: 'category' }] }] }
  ]
})
  1. Local API

    Query your content directly, without a network hop.

    collections.post.find() FindResult<Post>
  2. HTTP API

    Use predictable endpoints from any frontend or service.

    GET /api/documents?type=post 200 OK · application/json
  3. GraphQL

    Ask for exactly the fields each customer surface needs.

    query { allPost { title } } data.allPost
  4. Admin UI

    Give content teams a complete editor from the same model.

    Content / Posts 3 documents

Local API

02
Fully typed

Query your content directly, without a network hop.

collections.post.find() FindResult<Post> View docs

HTTP API

03
Ready to consume

Use predictable endpoints from any frontend or service.

GET /api/documents?type=post 200 OK · application/json View docs

GraphQL

04
Generated schema

Ask for exactly the fields each customer surface needs.

query { allPost { title } } data.allPost View docs

Admin UI

05
Ready to edit

Give content teams a complete editor from the same model.

Content / Posts 3 documents View docs

Built for the people who run the site

Give content teams a Studio shaped around the business, with clear publishing states, safe history, and visual editing when page context matters.

Content models in Aphex Studio

First class AI support

The built-in Assistant helps editors work in context. MCP gives AI clients and coding agents a governed way to understand schemas, inspect content, and prepare changes through the same CMS.

  • Built-in Assistant plus MCP for external AI clients
  • Grounded in your schemas, documents, and editor context
  • Role-scoped tools with reviewable draft changes

Aphex Assistant

CMS-aware answers and content tools

What are we working on?

Ask about your schemas, inspect documents, or use the CMS tools available to your role.

Uses tools allowed by your role

AI can make mistakes. Review content changes before publishing.

Bring the stack you already run

Set up the adapters for your environment, then reference them in your CMS config. Aphex keeps database, storage, auth, and email boundaries explicit, so infrastructure changes don't require redesigning your schemas or editor experience.

Extendable by design

Typed plugins extend schemas, UI, APIs, agent tools, and durable automation without forking the core.

Schema

Contribute new schemas, transform the resolved content model, and normalize writes with typed schema hooks that run before validation.

Active extension
Schema parts / Schema transforms
plugin-seo.ts definePlugin({ name: '@aphexcms/plugin-seo', parts: [{ implements: 'aphex/schema/transform', transform: injectSeoField }, { implements: 'aphex/admin/tool', id: 'seo', component: SeoTool }] }) Typed manifest

Your plugin stays self-contained. Schemas, UI, routes, permissions, encrypted settings, event consumers, and job handlers ship together as one package.

Explore the plugin architecture

Supported by the community

These people and organizations fund the ongoing development of Aphex and help keep the entire CMS open source.

Become a sponsor
1 current sponsor

Open source. The whole thing.

Aphex is fully MIT licensed from Studio to server. The editor, content engine, APIs, adapters, and job system are free to fork, extend, and deploy for every client, team, and website.

Open source
100%
Licensed
MIT
Content lock-in
0
Aphex

Built for the people who make websites. And the people who run them.

Stay up to date with the latest news

No spam. Unsubscribe anytime.

Open source under the MIT license.
Back to top