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.0
    License
    Apache-2.0
    Last updated
    2 months ago
    Downloads
    41

    #MoonBit Multi-Language CMS (moonbit-multilang-cms)

    A high-performance, multi-language, full-stack Content Management System (CMS) built entirely in MoonBit using the moonback web server framework and the async runtime.

    #šŸš€ Features

    • Server-Side Rendering (SSR): Dynamic page generation with an adaptive CSS glassmorphic dark-theme UI.
    • Multi-Language Translation Engine (i18n): Fully native translation capabilities supporting fallback locales and simple dictionary lookups for English, Simplified Chinese, Traditional Chinese, and Japanese.
    • Multi-Language Mock Database: A memory-backed store loaded with multi-lingual seed articles, mimicking real-world CMS storage.
    • Automatic & Manual Locale Routing: Uses URL parameters (?lang=zh) and persistent browser cookies to detect, set, and switch language interfaces automatically.
    • Article Management Editor: Web interface and REST API endpoint (POST /api/articles) allowing users to create new articles in their selected language.
    • Reusable content core: Query objects, locale/status filters, safe pagination, validation errors, tag aggregation, slug generation, HTML escaping, open-redirect protection, and engagement metrics are available under src/core.

    #šŸ“‚ Project Architecture

    moonbit-multilang-cms/ ā”œā”€ā”€ cmd/ │ └── main/ │ ā”œā”€ā”€ main.mbt # Web server entry point, routing, and form parsing │ └── moon.pkg # Package config & imports ā”œā”€ā”€ src/ │ ā”œā”€ā”€ i18n/ │ │ ā”œā”€ā”€ i18n.mbt # Translation engine & key-value localizer │ │ ā”œā”€ā”€ i18n_test.mbt # i18n unit tests │ │ └── moon.pkg │ ā”œā”€ā”€ db/ │ │ ā”œā”€ā”€ db.mbt # File-backed database simulation and seeds │ │ ā”œā”€ā”€ db_test.mbt # Database CRUD unit tests │ │ └── moon.pkg │ └── templates/ │ ā”œā”€ā”€ templates.mbt # Server-side HTML/CSS UI layouts & pages │ ā”œā”€ā”€ templates_test.mbt # UI rendering tests │ └── moon.pkg ā”œā”€ā”€ moon.mod # Module definition and dependencies ā”œā”€ā”€ LICENSE # Apache-2.0 license file └── README.md # Project documentation

    #šŸ› ļø Getting Started

    #Prerequisites

    • MoonBit Toolchain: Ensure moon CLI is installed (moonc v0.10.3 or later).
    • C Compiler (Optional): A system C compiler (like gcc, clang, or cl) is required for building native binaries and running native tests.

    #Build and Run

    1. Clone the Repository:
      git clone https://github.com/liuzhiyug/moonbit-multilang-cms.git cd moonbit-multilang-cms

    2. Verify & Compile:
      moon check

    3. Run the Web Server (Native Target):
      moon run cmd/main

      The server will start listening at: http://127.0.0.1:3000

    #Running Tests

    If a system C compiler is available, you can run tests natively:
    moon test

    #šŸ“ License

    This project is licensed under the Apache License 2.0. See the LICENSE file for details.

    Powered by MoonBit

    Site sourceReport issueModulesSkillsBuild queueStatistics

    Ā© 2026 mooncakes.io