[Open Source] An automated Web platform for system design and code generation, providing code automation capabilities.
![[Open Source] An automated Web platform for system design and code generation, providing code automation capabilities.](https://yy123.ink/api/img/1782589229708-i8y1nu.jpg)
1. Project Overview
Youran Automated Code Platform
This is an automated web platform featuring system design and code generation capabilities. Using this platform can significantly improve developer productivity.
2. Open Source License
Licensed under Apache-2.0
3. Screenshots
Page Screenshots
Project Management

Incremental Preview

Field Management

ER Diagram

Code Preview

Template List

Custom Charts

4. Feature Overview
Java frontend and backend code generation [incremental generation], with frontend and backend separation. The backend uses spring-boot, mybatis, mapstruct, swagger, and easyexcel. The frontend uses vue-admin-template. Supports one-to-many and many-to-many relationships, with customizable Freemarker code templates.
The following features are included:
- ★★★ Git-based incremental code generation. See README.md for the underlying principles: Supports generating code directly to remote Git repositories and regenerating code after metadata changes (only the differences are generated).
- ★★★ Custom Templates: If the built-in code templates do not meet your requirements, you can develop your own exclusive code templates based on your team's technology stack.
- ★★★ Custom Charts: Based on existing entities, you can configure custom detail tables and aggregate tables, configure ECharts charts, and display multiple charts together on a single dashboard.
- ★ Reverse Engineering: If you have already completed your application's database table structure design, please use theReverse Engineeringfeature to import table creation SQL statements into the project, automatically generating entities and fields.
- Many-to-Many Relationships: Supports establishing many-to-many relationships between two entities. A relationship table will be generated in MySQL. You can configure whether either entity holds a reference to the other. The entity holding the reference will automatically generate functionality for maintaining the relationship.
- Foreign Key Associations: When adding a field, you can specify whether it is a foreign key. Foreign key fields must reference the primary key of another entity, enablingOne-to-OneorOne-to-Manyrelationships.
- Cascading Extensions: Cascading fields can be configured on foreign key fields or many-to-many entities. These fields can be used as query conditions for the associated entity and can also be displayed in query results.
- Entity ER Diagrams: On the entity list page, select multiple related entities and click theView ER Diagrambutton to generate an entity relationship diagram.
- Code Preview: Browse generated code online without downloading it. You can also preview the differences between newly generated code and the previous version after metadata changes.
- Can generate Excel import and export functionality (based on easyexcel), with an option to enable or disable the Lombok plugin.
- Project SharingOptional Features: You need to integrate your company's own unified login system, after which you can share the project with team members for collaborative maintenance. This feature is disabled by default.
[Git Incremental Code Generation] is the core feature of this system.
For example: You have already implemented extensive business logic based on the generated code. Suddenly, your requirements change, and you need to add several fields or a new table. In this situation, usingGit Incremental Code Generationcan significantly reduce repetitive manual work. The specific steps are as follows:
- Update the metadata on the Code Automation Platform.
- On the project list page, click the buttonCommit to Git
- Return to your code's master branch and execute the following Git operation: fetch
- Merge the remote auto branch into the current branch.
Prerequisite!!! You must enable the following option in the project configuration before manually modifying any code:Enable Git Repository. The auto branch must never be deleted, and no code development should be performed on the auto branch.
This feature supports repeated execution of the "Modify Metadata" and "Generate Code" operations. It is recommended that you use this platform for incremental code generation throughout the entire software iteration cycle.
5. Tech Stack
Installation Steps
Step 1: Environment and Configuration
- Install the required dependencies yourself: MySQL database and JDK 8.
- Download and extract the ZIP installation package.
- Create the tables in MySQL in advance. The SQL script is located at: /schema/init.sql in the installation package.
- Modify the database configuration in the configuration file: /conf/application-local.yml
Step 2: Startup
Startup script: /bin/startup.cmd
System access URL:
- http://localhost:8088
When accessing the system for the first time, you need to import the built-in code templates:
- Java backend template: Source code ZIP archive
- Vue frontend template: Source code ZIP archive
Usage instructions
1. Recommended ApproachRecommended(Design the models in this project and synchronize the code to Git.)
- Create an empty repository on a code hosting platform such as GitLab or GitHub.
- Create a project on this platform and enter the Git repository URL.
- Create entities [Required]
- Create entity fields [Required]
- Create other metadata [Optional]
- ExecuteCommit to Git
2. Traditional ApproachNot Recommended(Perform reverse engineering after designing the database table structure.)
- Design the database table structure in advance.
- Create a project on this platform and execute reverse engineering using your SQL table creation statements.Reverse Engineering
- Adjust field properties (reverse engineering imports only limited field information, so some properties are assigned default values).
- Generate Code
Getting Started Example
This is a simple project example. You only need to download the project's metadata file and follow the steps below. With just a few clicks, you can preview the generated code.
- Project Management -> Import Metadata
- Project Management -> Actions -> Edit -> Select Code Template
- Project Management -> Use Template -> Code Preview
Terminology
- Project: A project represents an independent application system. A complete Java Web system can be generated based on a single project.
- Entity: An entity corresponds to a business table in the database and a complete set of CRUD operations. Entities can also have relationships such as 'one-to-many' and 'many-to-many'.
- Field: A field here refers to both a field in a database business table and a field in a Java entity class. Each field has numerous configurable properties.
- Enumeration: It is recommended to define groups of constants that rarely change as enumerations. Corresponding enum classes will be generated in the Java code.
- Index: An index in a MySQL business table.
- Many-to-Many Relationship: A relationship between two entities. An intermediate table is generated to store the IDs of both entities.
Generated Results Showcase
