AI-powered CMS Core for personal blogs, creator homepages & content websites.
Overview
MX Space Core is a headless CMS server built with NestJS, MongoDB, and Redis. Beyond standard blog features (posts, pages, notes, comments, categories, feeds, search), it ships with a full AI content workflow — summary generation, multi-language translation, comment moderation, and writing assistance — powered by pluggable LLM providers.
# Enable Corepack for pnpm
corepack enable
# Install dependencies
pnpm install
# Start MongoDB + Redis (via Docker)
docker compose up -d mongo redis
# Start dev server (port 2333)
pnpm dev
The API is available at http://localhost:2333. In development mode, routes have no /api/v2 prefix.
Docker Deployment
The fastest way to get a production instance running:
# Clone and enter the project
git clone https://github.com/mx-space/core.git && cd core
# Edit environment variables
cp docker-compose.server.yml docker-compose.prod.yml
# Edit docker-compose.prod.yml — set JWT_SECRET, ALLOWED_ORIGINS, etc.
# Start all services
docker compose -f docker-compose.prod.yml up -d
Or use the prebuilt image directly:
docker pull innei/mx-server:latest
The image supports linux/amd64 and linux/arm64.
Available Commands
Run from the repository root:
Command
Description
pnpm dev
Start development server (watch mode)
pnpm build
Build the core application
pnpm bundle
Create production bundle (tsdown)
pnpm test
Run test suite (Vitest)
pnpm lint
Run ESLint with auto-fix
pnpm typecheck
TypeScript type checking
pnpm format
Format code with Prettier
Running Tests
# Run all tests
pnpm test
# Run a specific test file
pnpm test -- test/src/modules/user/user.service.spec.ts
# Run tests matching a pattern
pnpm test -- --testNamePattern="should create user"
# Watch mode
pnpm -C apps/core run test:watch
Environment Variables
Variable
Description
Default
JWT_SECRET
Secret for JWT signing
Required
ALLOWED_ORIGINS
CORS allowed origins (comma-separated)
—
DB_HOST
MongoDB host
localhost
REDIS_HOST
Redis host
localhost
REDIS_PORT
Redis port
6379
REDIS_PASSWORD
Redis password
—
MONGO_CONNECTION
Full MongoDB connection string (overrides DB_HOST)
—
ENCRYPT_ENABLE
Enable field encryption
false
ENCRYPT_KEY
64-char hex encryption key
—
THROTTLE_TTL
Rate limit window (seconds)
10
THROTTLE_LIMIT
Max requests per window
100
PORT
Server port
2333
TZ
Timezone
Asia/Shanghai
DISABLE_CACHE
Disable Redis caching
false
Configuration can also be provided via CLI arguments or YAML files. See apps/core/src/app.config.ts for the full config schema.
API Response Format
All responses are automatically transformed by interceptors:
All response keys are converted to snake_case (e.g., createdAt → created_at).
Upgrading
v10 → v11
v11 refactors the Aggregate API: categories and pageMeta are removed from GET /aggregate; a new GET /aggregate/site endpoint is added for lightweight site metadata. See Upgrading to v11.
v9 → v10
v10 includes a breaking auth system refactor. See Upgrading to v10.
MX Space Core
AI-powered CMS Core for personal blogs, creator homepages & content websites.
Overview
MX Space Core is a headless CMS server built with NestJS, MongoDB, and Redis. Beyond standard blog features (posts, pages, notes, comments, categories, feeds, search), it ships with a full AI content workflow — summary generation, multi-language translation, comment moderation, and writing assistance — powered by pluggable LLM providers.
Key Features
Tech Stack
Monorepo Structure
Core Architecture (
apps/core/src/)Quick Start
Prerequisites
Local Development
The API is available at
http://localhost:2333. In development mode, routes have no/api/v2prefix.Docker Deployment
The fastest way to get a production instance running:
Or use the prebuilt image directly:
The image supports
linux/amd64andlinux/arm64.Available Commands
Run from the repository root:
pnpm devpnpm buildpnpm bundlepnpm testpnpm lintpnpm typecheckpnpm formatRunning Tests
Environment Variables
JWT_SECRETALLOWED_ORIGINSDB_HOSTlocalhostREDIS_HOSTlocalhostREDIS_PORT6379REDIS_PASSWORDMONGO_CONNECTIONENCRYPT_ENABLEfalseENCRYPT_KEYTHROTTLE_TTL10THROTTLE_LIMIT100PORT2333TZAsia/ShanghaiDISABLE_CACHEfalseConfiguration can also be provided via CLI arguments or YAML files. See
apps/core/src/app.config.tsfor the full config schema.API Response Format
All responses are automatically transformed by interceptors:
{ data: [...] }@Paginator) →{ data: [...], pagination: {...} }@Bypass) → raw responseAll response keys are converted to snake_case (e.g.,
createdAt→created_at).Upgrading
v10 → v11
v11 refactors the Aggregate API:
categoriesandpageMetaare removed fromGET /aggregate; a newGET /aggregate/siteendpoint is added for lightweight site metadata. See Upgrading to v11.v9 → v10
v10 includes a breaking auth system refactor. See Upgrading to v10.
Related Projects
License
apps/— AGPLv3 with Additional TermsSee LICENSE for full details.