moonbit-multilang-cms

    A full-stack multi-language CMS built with MoonBit, moonback and async.

    cms
    web
    i18n
    multilang
    moonback
    Download zip
    Author
    Version
    0.1.2
    License
    Apache-2.0
    Last updated
    2 months ago
    Downloads
    41

    #MoonBit Multi-Language CMS

    MoonBit Multi-Language CMS is a small, strongly typed content platform for multilingual editorial sites. It combines server-rendered pages, locale-aware content workflows, an in-memory data layer, and reusable content services in a single MoonBit module.

    #Project positioning

    The project is designed for teams that need a predictable content core without introducing a large application framework. The public API is organized around content records, catalog queries, workflow transitions, rendering, feeds, storage envelopes, and operational policies. The web application in cmd/main provides a runnable reference site; the reusable logic lives in src/core and the supporting packages under src.

    #Core capabilities

    • Multilingual content records with locale fallback, tags, validation, pagination, and status transitions.
    • Markdown parsing and safe HTML rendering for headings, lists, quotes, code blocks, links, and inline formatting.
    • Catalog, revision history, search indexing, duplicate detection, batch validation, and import/export helpers.
    • SSR reference pages, article creation endpoint, RSS/JSON Feed/sitemap generation, and URL/query parsing.
    • Access policies, webhook delivery tracking, notification queues, rate limiting, scheduled publication, audit trails, health reports, and metrics.
    • Native-friendly deterministic tests and no application database or network service required for the core package.

    #Quick start

    Prerequisites: the current stable MoonBit toolchain and a native C compiler for native tests. The supported runtime target for this module is native: the reference HTTP server and its moonback networking stack use native socket APIs.

    git clone https://github.com/liuzhiyug/moonbit-multilang-cms.git cd moonbit-multilang-cms moon update moon fmt --check moon check --deny-warn moon test --deny-warn --target native

    Run the reference server locally:

    moon run cmd/main

    It listens on http://127.0.0.1:3000 by default.

    #CLI and HTTP surface

    The runnable entry point is cmd/main. It starts the reference server and exposes:

    RoutePurpose
    GET /Localized article index; use ?lang=en, ?lang=zh, or a cookie for locale selection.
    GET /article?id=<id>Localized article detail page.
    GET /editorArticle editor page.
    POST /api/articlesCreates an article from form fields title, author, content, and locale.

    For library consumers, import the src/core package and compose ContentCatalog, CmsService, ContentQuery, SearchIndex, or the operational components directly.

    #Architecture

    cmd/main reference HTTP application and routing src/core content domain, workflows, rendering, storage, operations src/db deterministic in-memory article store and seed data src/i18n locale dictionaries and translation lookup src/templates server-rendered HTML views benchmarks reproducible local measurement notes

    The core is deliberately split into cohesive modules. Domain records and queries are independent from transport code; operational concerns such as caching, events, metrics, auditing, and rate limiting can be adopted separately.

    #Benchmarks

    The repository records local wall-clock measurements in benchmarks/README.md. They are intended for regression comparison on the same machine and toolchain, not as cross-machine performance claims.

    #Testing and quality gates

    Run the complete local quality gate with:

    moon fmt --check moon check --deny-warn moon test --deny-warn --target native moon info git diff --check

    The test suite covers validation boundaries, pagination, locale routing, Markdown rendering, storage round trips, catalog revisions, workflow transitions, search updates, webhook delivery, quotas, snapshots, health aggregation, and operational failure paths.

    #CI

    GitHub Actions runs formatting, strict checking, package metadata generation, and native tests on Ubuntu, macOS, and Windows. Dependency synchronization is performed before the checks so the workflow exercises the declared module graph. See .github/workflows/check.yml.

    #License

    Licensed under the Apache License 2.0.

    Powered by MoonBit

    Site sourceReport issueModulesSkillsBuild queueStatistics

    © 2026 mooncakes.io