[Open Source] Next-Generation Code Generator: Generate Code Like Jenkins Builds, with Convenient Collaboration

Open SourceProcess Management
2026-06-28 05:24 0 次浏览 • 0 次下载 0KB
[Open Source] Next-Generation Code Generator: Generate Code Like Jenkins Builds, with Convenient Collaboration

1. Project Overview

AI Code

A next-generation code generator that generates code just like Jenkins builds packages, making team collaboration easier. It supports incremental code generation and modular management based on framework modules. It provides template development interfaces, allowing you to freely define your own templates and generate up to 70% of the code. It also supports Docker startup for rapid deployment.

2. Open Source License

Licensed under MIT

3. Screenshots

Usage

Database:

Uses the H2 database by default, with compatibility for MySQL statement mode;

Management URL after startup:
http://127.0.0.1:8080/h2
Username and password: sa/sa
Address:/tmp/aicode

After making the changes, you can start the application directly. The default port is 8080. Open the following URL in your browser: [http://127.0.0.1:8080/index.html](http://127.0.0.1:8080/index.html). Default login credentials: admin / 888888. Try logging in. You can modify this account's data in the database. The corresponding table is named account.

Image

Refer to the results of existing projects.

Image

Add Template Repository

After logging in, you can add your own template repositories.

Image

Create Project

Once you have a template, you can create a project and follow the step-by-step instructions to complete the process. (The GIF animation here requires you to log in to your account to view it due to OSC restrictions.)

Image

Building projects

Building is very simple. Just click the button to automatically generate the project, download the template, generate the code, and submit it to the Git repository. The logs displayed here are delivered via WebSocket and saved in the log documentation, so you can review them repeatedly. Very convenient! (The GIF animation here requires you to log in to your account to view it due to OSC restrictions.)

Image

Next, click the Build Project button to start the automatic project build.

Start the Project

After generating the project code, you can find the source code in your Git or SVN repository. You can also download the source code directly, import it into your development environment, and run it. Note that you must modify the configuration file and database connection settings; otherwise, the default configuration will not work. Below are screenshots from a test demonstration for reference, including the code interface and the running project. The author uses IDEA, the best Java development tool, bar none. When developing, use the best tools available instead of settling for less.

Image

The Swagger interface is shown below. The author uses a simple table for demonstration purposes, but you can implement models of any complexity.

Image

Once you experience efficient code generation and abstract thinking, you will realize that turning regular, repetitive code into templates can serve you for a much longer time. At that point, you will discover that programming is not just about coding; it is also about designing. As the saying goes, the highest level of martial arts is winning without techniques. That is exactly the idea. Let your code serve you longer so you have more time to learn new technologies and knowledge. Making a single line of code written today deliver greater value in the future is what we should think about and strive for. We look forward to your contributions and the growth of the template ecosystem. We are currently organizing distributed and microservices framework templates integrating RabbitMQ, Kafka, and RocketMQ. There will be even more exciting developments ahead!

4. Feature Overview

Features

Generate your own code in the same way Jenkins builds packages. Unlike other complete open-source projects, ai-code focuses on abstracting integrated technology frameworks and MVC models. Consider this scenario: a new business requirement arises, but you want to use the same technology stack. The usual approach might be to find an existing project, remove and modify parts of it, extract a relatively clean framework, then redefine the new business models, entity classes, interfaces, and other components. After that, you still have to write a lot of CRUD code. Sometimes we really dislike repeating these tasks, but we have no choice. If you agree that this work is meaningless and tedious, raise your hand! So, is there a way to build a tool that allows you to design a new business model, obtain the SQL script, and then select different combinations of technology frameworks through the tool? Just like Spring Boot, which integrates various technologies, but with the ability to automatically generate common components such as MyBatis mapper, DAO/DTO, service, controller, UI, and other functionality. What about automatically integrating commonly used tools, encryption algorithms, and other utilities, such as Swagger, Gradle, and Maven? The answer is yes. This is exactly the idea behind ai-code. It provides flexible customization and allows business requirements to change freely. As long as you have the SQL script, everything can be done with just a few clicks: select and generate. No more repeatedly performing those tedious tasks that have been repeated countless times. This is the fundamental concept and philosophy behind ai-code.

Now let's look at the conventional open-source approach. It usually involves complete projects, such as RBAC-based management systems that include permissions, regions, departments, logs, and other common features. There is nothing wrong with this approach, as these features are indeed widely applicable. However, integrating such projects into your own system still requires modifications. Coding styles may differ, design conventions may not meet your expectations, and maintenance may be slow. Nevertheless, these projects are still useful. This is why there are so many open-source projects for e-commerce platforms, permission management, and regional management. They are great resources to follow and learn from, and you can even use them directly.

These two approaches address code reuse from different perspectives. ai-code simply hopes to inspire new ideas and encourage abstract thinking, integration thinking, and a future-oriented approach to development. We look forward to seeing better projects emerge. Based on ai-code, we welcome everyone to contribute technology templates so that more people can benefit from them. Thank you all for your contributions.

Template Engine

The following template engines are currently supported:

1.freemarker

2.beetl

5. Tech Stack

Template Writing Guide:

The template syntax is written in FreeMarker. An entity class is defined and can be found in the project under io.aicode.base.core.TemplateData. The built-in variables are roughly as shown in the following image.

Image

If you need to write your own templates, simply follow the rules provided here. If you want to refer to existing templates, check the links shared at the top. You can modify an existing template according to your needs and share it with everyone else, allowing others to benefit from the convenience brought by your technical expertise.

Project Technical Highlights

  • spring mvc

  • mybatis H2

  • freemarker

  • websocket

  • java reflection

  • angular framework

  • git,svn client

  • jwt

  • gradle

The project supports both K8s and Docker deployment, allowing you to get started quickly in just 5 minutes. It has already been used in more than 10 projects, including funded projects. The templates have undergone multiple rounds of revisions and integration, making them highly practical. New features are being added gradually, and your feedback and experience are welcome. This is a code generation framework built around FreeMarker. Currently, the project supports reverse generation of Java code from SQL. The extent of code generation depends on the templates used. The currently integrated templates include:

- Swagger Lombok
- Spring Cloud (full ecosystem)
- Angular
- Spring Boot
- RocketMQ Kafka RabbitMQ Dubbo
- MySQL TiDB PostgreSQL CockroachDB Redis JetCache Ignite
- ES

Template sharing address: /helixin/aicode_template. The SQL scripts contain the templates, which are automatically downloaded to your local environment when you build the project and deleted after code generation is complete. You can open-source your templates in this repository or create your own private repository for personal use. The goal is to write repetitive code only once, then use template technology and abstract thinking to serve more projects.

The frameworks listed above cover commonly used technologies. Currently, you only need to prepare your SQL script and create a project on this project page. Aicode will automatically create the database for reverse code generation and download the frameworks from your template repository. Of course, you can also use the templates we have already developed. Code is generated in one continuous workflow from DAO -> Service -> Controller -> Frontend, with interfaces automatically connected according to predefined rules. This means you can run your project immediately after generation. In addition, once you configure your Git or SVN repository address as needed, the generated project code will be automatically committed to the corresponding repository, eliminating the hassle of manual copying. You only need to run git clone git://xxxxx.git in your development tool. If the templates are well-designed, they can save approximately 50% of coding effort, eliminating the need to develop common functionality from scratch, such as create, delete, query, update, pagination, conditional queries, relational queries, relational pagination queries, and more. Your main concern is ensuring that your business logic and model relationships are properly configured so the system can automate the generation process. We provide a web UI management interface where you can log in to manage code generation. Through the interface, you can configure model relationships and display properties, quickly completing customized development from the database layer to the frontend.

More content, please refer to README.md document

#1
资源直链https://gitee.com/helixin/aicode
去下载
星河码客

发现和分享优质开源项目,传承互联网精神,为开发者服务。

关于本站

联系我们

微信/广告合作:ITcloub (备注星河码客)

免责声明:本站资源版权归原作者所有,仅供学习与交流。如有侵权,请通过「关于我们 - 侵权投诉」联系删除。

Powered by Nuxt · Deployed on Cloudflare