Skip to main content
MDCMS is organized as a Bun monorepo with Nx for task orchestration. The workspace is split into four applications and four shared packages.

Overview

The root package.json declares workspaces:
{
  "workspaces": ["apps/*", "packages/*"]
}
Bun handles dependency resolution and linking. Nx manages build ordering, caching, and parallel task execution across the workspace.

Dependency Graph

Applications

apps/server

Package@mdcms/server
Entrysrc/index.ts
Port4000
Dev commandbun nx dev server
The Elysia HTTP server is the core of MDCMS. It exposes the REST API for content CRUD, schema registry, authentication, media uploads, webhooks, and environment management. Key dependencies: Elysia, Drizzle ORM, better-auth, @mdcms/shared, @mdcms/modules.

apps/cli

Package@mdcms/cli
Binarymdcms
Dev commandbun nx dev cli
The command-line tool for managing MDCMS projects from your terminal or CI/CD pipelines. Available commands:
CommandDescription
initInteractive project setup wizard
loginAuthenticate via browser OAuth flow
logoutClear stored credentials
pushPush local content to the server
pullPull content from the server to local files
schema-syncSync schema definitions to the server
statusShow sync status between local and server
migrateRun content migrations
Dependencies: @mdcms/shared, @mdcms/modules.

apps/studio-example

Package@mdcms/studio-example
FrameworkNext.js 15.2
Port4173
Dev commandbun nx dev studio-example
A demo Next.js application that embeds the <Studio /> component from @mdcms/studio. Used for local development and testing of the Studio UI. Not published to any registry. Dependencies: @mdcms/studio, @mdcms/sdk.

apps/studio-review

Package@mdcms/studio-review
Port3000
Dev commandbun nx dev studio-review
An internal visual review application that renders deterministic scenarios for PR review. Deployed as a standalone Vercel deployment, allowing reviewers to see UI changes across predefined states without needing a full local setup. Dependencies: @mdcms/studio.

Shared Packages

packages/shared

Package@mdcms/shared
The foundational package that all other packages depend on. Contains contracts, types, and utilities shared across the entire monorepo. Key exports:
ExportPurpose
defineConfigConfiguration builder for mdcms.config.ts
defineTypeContent type definition helper
referenceTyped reference field helper
API_V1_BASE_PATHAPI version path constant
RuntimeErrorBase error class for structured errors
Content response typesTypeScript types for API responses
Schema typesTypeScript types for schema definitions

packages/sdk

Package@mdcms/sdk
The TypeScript client SDK for querying MDCMS content from your application at build time or runtime. Key exports:
ExportPurpose
createClientFactory function to create a configured MDCMS client
MdcmsApiErrorError class for API-level errors
MdcmsClientErrorError class for client-level errors (network, config)
Dependencies: @mdcms/shared.

packages/studio

Package@mdcms/studio
The embeddable React UI component that provides the full visual editing experience — dashboard, content editor, media management, and settings. Built with:
LibraryPurpose
React 19UI framework
TipTap 3.7Rich text / MDX editor
Radix UIAccessible component primitives
TailwindCSSStyling
TanStack React QueryServer state management
LucideIcon library
Dependencies: @mdcms/shared.

packages/modules

Package@mdcms/modules
The module registry that provides extensibility. Modules can register server actions, CLI commands, and Studio UI extensions. Built-in modules:
ModuleDescription
core.systemCore system functionality
domain.contentContent domain operations
Dependencies: @mdcms/shared.