[Open Source] A Java-Based Code Generator Driven by Data Models: Data + Templates = Content
![[Open Source] A Java-Based Code Generator Driven by Data Models: Data + Templates = Content](https://yy123.ink/api/img/1782594221024-bs9xyw.jpg)
1. Project Overview
MoliCode

MoliCode is a code generator developed in Java. In addition to generating Java code, it can also generate code in other languages. It is a standalone tool that stores code templates in a Git repository and uses them to generate target code. Its main difference from other code generators is that it does not focus on the templates themselves. In other words, it does not concern itself with what kind of code is generated. Instead, it serves as a foundational tool that makes it easy for everyone to create, share, and reuse code templates.
MoliCode is a code generator for java and other language. It's a standalone tool to generate code and store code template in git repository . So I want to make a good tool for everybody to share their code template and generate code easier. that's it.
Code generation can be performed directly from database table models. Configure everything through the UI and generate code with a single click. It is very convenient.

2. Open Source License
Licensed under Apache-2.0
3. Screenshots
Usage Examples
Project List Example

Template Repository Address Configuration for a Project
Configure the template Git URL and pull the Git templates for local use;
If a Git repository contains multiple template collections, configure the relative template path (the name of the subfolder under the Git repository root directory);

Code Generation
Once the project configuration is complete, you can start generating code. Code Generation -> Refresh Templates

Code Generation -> Generate Code from Database

Code Generation -> Code Preview

4. Feature Overview
Simplicity First
Driven by data models: Data + Templates = Content
Easy to Extend
In addition to the built-in tableModel, JSON, and CSV data formats, custom data model parsers are also supported;
Cloud Hosting
Code templates can also be hosted on GitHub for global sharing (recommended). Alternatively, they can be opened from a local file directory.
5. Tech Stack
Source Code and Development Environment Setup
For those who want to read the source code or perform secondary development, here is a brief introduction to the project.
Tech Stack
-
Backend: maven + springboot + springmvc + mybatis + druid;
-
Frontend: iviewAdmin + vue + webpack;
-
Languages: Java + Groovy hybrid compilation;
Special Notes on the Development Environment
It is recommended to open the project using IDEA;
Since IDEA and other IDEs generally cannot recognize Groovy source paths, you need to mark the Groovy folders in multiple submodules as source directories. The directories involved include:
More content, please refer to README.md document