# libra-boot-low **Repository Path**: halavah/libra-boot-low ## Basic Information - **Project Name**: libra-boot-low - **Description**: Low-code generator — 基于 YAML 配置 + Jinja2 模板的低代码生成器,一键生成 Spring Boot + Vue3 完整业务骨架 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-11-13 - **Last Updated**: 2026-11-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README
# 🚀 Libra Boot Low **A YAML and Jinja2 code generator for developers building Spring Boot and Vue business scaffolding.** [![PyPI](https://img.shields.io/pypi/v/libra-boot-low)](https://pypi.org/project/libra-boot-low/) [![Python](https://img.shields.io/badge/Python-3.9+-blue)](https://www.python.org/) [![Spring Boot](https://img.shields.io/badge/generates-Spring%20Boot-6DB33F)](https://spring.io/projects/spring-boot) [![Vue](https://img.shields.io/badge/generates-Vue-42b883)](https://vuejs.org/) [![License](https://img.shields.io/badge/license-MIT-green)](LICENSE) **English** | [简体中文](README.md)
> This README follows the open-source documentation standard: consistent structure and badges, public badge resources only, and release-channel pages for current versions. --- ## 📖 Contents - [Quick start](#quick-start) - [Running screenshots](#screenshots) - [Installation and source](#installation) - [Generation modes](#modes) - [Output and integration](#output) - [Configuration and CLI](#cli) - [Structure](#structure) - [Verification](#verification) - [Contributing](#contributing) - [License](#license) - [Contact](#contact) - [Star History](#star-history) - [Back to top](#back-to-top) --- ## 🚀 Quick start Use Python 3.9 or newer. The source tree supplies the Jinja2 templates and YAML configurations; PyYAML parses YAML, and Jinja2 renders templates. The commands below create an isolated Python environment and install both dependencies: ```sh git clone https://github.com/halavah/libra-boot-low.git cd libra-boot-low python3 -m venv .venv # macOS / Linux source .venv/bin/activate # Windows PowerShell: .venv\Scripts\Activate.ps1 python -m pip install -r requirements.txt python generator.py config/test/t1000.yml generated --dry-run python generator.py config/test/t1000.yml generated ``` The preview lists planned files without writing output or reports. The second command writes the sample module beneath `generated/test/t1000/`, plus a manifest and an `output/` run report. Generation does not execute SQL or launch the generated application. Always pass an explicit output directory; the CLI default points outside the repository. ### Run the generated GUI Also install Node.js 22 or newer with npm. In the same activated Python environment, from the cloned project root: ```sh cd examples/gui-preview npm ci npm run generate npm run dev ``` Open `http://127.0.0.1:18780/`. The example generates a `single` module with domain `shop`, code `products`, and six fields: product name, SKU, category, price, stock and listing status. The category values are 1 (digital accessories), 2 (daily supplies), and 3 (office stationery); status is 0 (unlisted) or 1 (listed). Twelve synthetic products are kept in memory. The page supports querying, resetting filters, pagination, adding, editing, viewing details, deletion and listing-status changes. Restarting the dev server resets its data. The export button only explains that a real export backend is needed; it does not fabricate a downloadable file. `npm run generate` invokes the repository's Python generator with `catalog.yml`. If Python is not on the command path, set the `PYTHON` environment variable to your Python interpreter before running that command. The generator writes to `examples/gui-preview/generated/`. Vite directly imports the generated list, add/edit, detail and API files; they are not hand-redrawn for this screenshot. The example supplies the required `G-*` host components, HTTP adapter and localhost-only in-memory API. This is a generated-page preview, not a production backend or a separate generator control panel. Its adapters cover this single-table product example only; other modes require their own host components and endpoints. Port 18780 must be free. Ctrl+C stops the preview. `npm run build` checks compilation into the example's `dist/`; the static build does not include the development API and is not a standalone production deployment. ## 🖼️ Running screenshots The screenshots show the actual generated `shop/products` Vue pages running in the local preview host. Host controls and API adapters are supplied by the example; all records are synthetic in-memory data. The generator templates and generated page source are not altered for the screenshots. These images do not imply a database or production integration test. ![Generated product list](assets/screenshots/gui-products.png) *Generated list, filters, status actions and pagination.* ![Generated product form](assets/screenshots/gui-product-form.png) *Generated add/edit form with the fields and validation supplied by the YAML configuration.* ## 📦 Installation and source Source code: [GitHub](https://github.com/halavah/libra-boot-low) · [Gitee](https://gitee.com/halavah/libra-boot-low), public, branch `master`. Documentation: this README contains the CLI path, GUI-preview commands, configuration meanings and limitations. The configuration example below can be copied without consulting another document. | Channel | Status | Scope | |---|---|---| | Source clone + `requirements.txt` | Recommended; exercised locally | Includes templates and sample configuration | | [PyPI](https://pypi.org/project/libra-boot-low/) | Published | Current wheel lacks templates and sample configuration; not the complete generation path | | [GitHub Releases](https://github.com/halavah/libra-boot-low/releases) | Release channel | Check actual assets; no filename/version is assumed here | Package versions follow the release channels. Installing the current PyPI wheel alone is not equivalent to running the full source tree. ## 🧩 Generation modes Run `python generator.py --list-modes` for the current registry. | Mode | Purpose | |---|---| | `single` | Single table | | `single-with-file` | Single table with attachments | | `multi-table` | Independent tables | | `multi-table-with-file` | Independent tables with attachments | | `master-detail` | Master/detail | | `master-detail-with-file` | Master/detail with attachments | | `master-detail-modules` | Modular detail tables | | `master-detail-modules-with-file` | Modular detail tables with attachments | | `master-details-tabs` | Multiple detail tabs | | `master-details-tabs-with-file` | Detail tabs with attachments | | `master-details-tabs-dialog` | Tabbed detail dialogs | | `master-details-tabs-dialog-with-file` | Tabbed dialogs with attachments | | `cloud-service` | Separate service contracts, model and service | ## 📂 Output and integration ```text generated/ ├─ .manifest.json └─ test/t1000/ ├─ 00-inbox/ # Input placeholder ├─ 01-design/ # API, database and UI notes ├─ 02-sql/ # SQL and data examples ├─ 02-sql-scripts/ # SQL helper scripts ├─ 03-http/ # HTTP request examples ├─ 03-http-scripts/ # Request/testing helpers ├─ 04-server/ # Java backend └─ 05-web/ # Vue pages and services ``` The exact structure depends on mode and options. Review SQL before execution, integrate generated code into your target project, and supply its database, authentication, UI components and optional runtime dependencies. The generator is not a standalone deployment platform. ## ⌨️ Configuration and CLI | Command/option | Effect | |---|---| | `python generator.py --list-modes` | List registered modes | | `python generator.py config/test/t1000.yml --validate` | Validate configuration only | | `python generator.py config/test/t1000.yml --list` | List configured modules | | `--module CODE` | Select one module | | `--mode MODE` | Override its mode | | `--dry-run` | Preview without writing files | | `--update-index` | Rebuild `config/index.json` | `bash run.sh` opens the interactive launcher. `bash run.sh --all` generates all indexed modules; `bash run.sh --all --domain test` filters that batch to the test domain. PowerShell uses `./run.ps1` with the corresponding options. The Python CLI instead accepts a configuration file and an explicit output directory. ### Minimal configuration Save this as `shop.yml` in the repository root and run `python generator.py shop.yml generated`. Labels are demonstration Chinese text; identifiers and commands are unchanged. ```yaml project: name: "电商演示" code: "shop" group: "com.example.shop" modules: - name: "商品" code: "products" domain: "shop" mode: "single" fields: - {name: "name", label: "商品名称", type: "input", required: true} - {name: "sku", label: "商品编码", type: "input", required: true} - {name: "price", label: "售价", type: "decimal", required: true} ``` `project.name/code` name the project; `group` is the Java package prefix (default `com.libra`). Each module needs `name`, `code`, `domain`, `mode` and a suitable `fields` list; output goes to `{output}/{domain}/{code}`. Each field has an identifier `name`, display `label`, and control/data `type`; `required` defaults to false. Common types are `input`, `textarea`, `number`, `decimal`, `select`, `date`, `datetime`, `date-year`, `date-month` and `upload`. Select options are `{label, value}` entries. Master/detail modes also require their corresponding table structures; the minimal example deliberately covers only the single-table path. ## 🗂️ Structure ```text generator.py # CLI module/ # Configuration, field building and generators templates/ # Jinja2 templates, grouped by mode config/test/ # Complete example configurations tests/ # Configuration, renderer and output tests run.sh / run.ps1 # Launchers examples/gui-preview/ # Generated-page host and synthetic API assets/screenshots/ # GUI screenshots ``` ## ✅ Verification ```sh python -m pip install pytest python -m pytest tests/ -q ``` Local checks exercised the existing tests, real single-table generation, and dry-run across the example configurations. Except for the single-table GUI preview below, other generated applications were not compiled, SQL was not executed and deployed end-to-end behavior was not tested. Treat generated files as code for review, not a certified running application. The GUI preview passes its production build and additionally checks the generated list, filters, form validation, add/edit, detail and pagination behavior against its in-memory API. This does not replace tests of generated Java services, databases, real file exports or production authentication. ## 🤝 Contributing Authorized collaborators create a feature branch from `master`, validate their changes and submit a PR. Public repositories may be forked first. Keep changes focused and state the commands run and any checks omitted. Add regression coverage for configuration, types and templates. Run the existing tests and all example configurations in dry-run mode; verify that dry-run creates neither generated output nor reports. Review real generated files after template changes. Do not run generated SQL against shared databases. ## 📄 License [MIT License](LICENSE). - ✅ Allows commercial use, modification, redistribution and private use. - ⚠️ Keep the copyright and permission notice in copies or substantial portions. Third-party resources retain their own licenses. - No warranty or liability is provided. MIT keeps reuse straightforward while preserving attribution. ## 📮 Contact Maintainer: [halavah](https://github.com/halavah). - [Issues](https://github.com/halavah/libra-boot-low/issues) - [Releases](https://github.com/halavah/libra-boot-low/releases) — use Watch → Custom → Releases to follow releases. ## ⭐ Star History If this project is useful, consider starring it. [![Star History](https://api.star-history.com/svg?repos=halavah/libra-boot-low&type=Date)](https://star-history.com/#halavah/libra-boot-low&Date) ## ⬆ Back to top Made with ❤️. If this project helps you, consider giving it a Star. [⬆ Back to top](#top)