Generate both sides together
Produce backend layers and React / Next.js admin pages from PO classes, reducing repetitive CRUD implementation.
SPARROW CODER / ADMIN APPLICATION GENERATOR
sparrow-coder
Turn your PO classes into a Clean Architecture backend and frontend pages that follow your package conventions. Templates and metadata handle the repetitive work.
model → applicationGenerate both sides
sparrow-examplereact-next-admin01 / CAPABILITIES
Controllers, services, DAOs, mappers, lists and forms start from the same business model.
Produce backend layers and React / Next.js admin pages from PO classes, reducing repetitive CRUD implementation.
Organize code by responsibility, package name and module prefix, using dependency inversion and leaving room for business logic.
Use column_configs to customize visible columns, filters, row menus and status commands for your application.
02 / CLEAN ARCHITECTURE
Use sparrow-example for the backend and react-next-admin inside sparrow-js for the frontend. Two independent applications, one business definition.
API entry points & conversion
Domain logic & business rules
Infrastructure & implementations
Persistence interfaces & access
Separate responsibilities through interfaces and dependency inversion, keeping domain logic decoupled from storage implementations.
Spring Boot + React / Next.jsBuild and run independently03 / WORKFLOW
Download your project, write the PO classes, generate the code, then continue building in your own application.
In Project Configuration, set the project names, business package, frontend project name, module prefix, architecture and scaffold. Configure internationalization and a parent module if needed, then use zip-download to download your backend and frontend business project.
Run mvn clean package -Dmaven.test.skip=true for the backend, then start the module artifact with java -jar. In the generated frontend directory, run npm install and npm run dev. Build and start the two applications separately.
In your generated business project, use com.sparrow.coder.po.Department (parent) and com.sparrow.coder.po.UserExample (child) as references. Copy them into your own PO package, such as com.yourcompany.po, and change the package declaration. Describe metadata with @Table and @Column; link the parent table with @ListDatasource(type = ListDatasourceType.TABLE, params = "t_department"). Do not generate business code directly from the official example classes.
Return to sparrow-coder, select a table and click Generate Code (/coder/generate.json). PO metadata and templates produce the DAO, Domain, Adapter and Infrastructure layers, plus frontend lists and forms. No AI is involved.
Return to your business project, rebuild and restart the backend and frontend to activate the generated code. Continue implementing your business logic on top of the generated architecture.
Use column_configs in t_table_config to control visible columns, filters, row menus and status commands. Parent-child relationships can automatically produce dropdowns or association controls.
04 / MODEL FIRST
Use @Table and @Column for table and field metadata, and @ListDatasource for relationships. Templates turn those definitions into code and controls.
Department is the parent table and UserExample is the child. Link departmentId to t_department to generate dropdowns or association controls.
Department1 → NUserExamplepackage com.yourcompany.po;
@Table(name = "t_user_example")
@Data
public class UserExample extends PO {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "id", columnDefinition = "int COMMENT 'ID'")
private Long id;
@Column(name = "user_name", nullable = false,
columnDefinition = "varchar(32) COMMENT '用户名'")
private String userName;
@Column(name = "department_id",
columnDefinition = "int COMMENT '部门ID'")
@ListDatasource(type = ListDatasourceType.TABLE,
params = "t_department")
private Long departmentId;
}05 / QUICK START
Install dependencies, configure services and start the generator in order. Expand each step to copy commands and adapt them to your environment.
Node.js is only needed for the frontend.
Place dependencies, the frontend workspace and the generator under ~/workspace/sparrow. Place the backend scaffold directly under ~/workspace.
mkdir -p ~/workspace/sparrow
cd ~/workspace/sparrow
git clone https://github.com/sparrowzoo/sparrow-shell.git
git clone https://github.com/sparrowzoo/sparrow-starter.git
git clone https://github.com/sparrowzoo/sparrow-file.git
git clone https://github.com/sparrowzoo/sparrow-passport-ddd.git
git clone https://github.com/sparrowzoo/sparrow-js.git
git clone https://github.com/sparrowzoo/sparrow-coder.git
cd ~/workspace
git clone https://github.com/sparrowzoo/sparrow-example.gitsparrow-example and sparrow are sibling directories. react-next-admin lives inside sparrow-js. Node.js is only required to run the frontend.
Install the core framework first, followed by the integration starter, file services and authentication framework. Build sparrow-coder last.
cd ~/workspace/sparrow/sparrow-shell
mvn clean install -Dmaven.test.skip=true
cd ../sparrow-starter
mvn clean install -Dmaven.test.skip=true
cd ../sparrow-file
mvn clean install -Dmaven.test.skip=true
cd ../sparrow-passport-ddd
mvn clean install -Dmaven.test.skip=true
cd ../sparrow-coder
mvn clean install -Dmaven.test.skip=truesparrow-shell provides infra-bom and sparrow-bom, so it must be installed first.
Start MySQL, create the sparrow database and import the project configuration, table configuration and example table scripts.
cd ~/workspace/sparrow/sparrow-coder
mysql -uroot -p -e "CREATE DATABASE IF NOT EXISTS sparrow;"
mysql -uroot -p sparrow < ddl/t_project_config.sql
mysql -uroot -p sparrow < ddl/t_table_config.sql
mysql -uroot -p sparrow < ddl/t_user_example.sqlEdit coder-main-spring-boot/src/main/resources/application.properties to set your workspace paths, database connection and Redis settings.
workspace=/Users/<your-name>/workspace
project_root=sparrow
frontend_project_root=sparrow/sparrow-js
spring.datasource.druid.url=jdbc:mysql://127.0.0.1/sparrow?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=UTC
spring.datasource.druid.username=root
spring.datasource.druid.password=<your-password>
spring.redis.host=127.0.0.1
spring.redis.port=6379These paths use macOS conventions. Replace the username, database password and service addresses with your local values.
Edit coder-main-spring-boot/src/main/configs/dev.properties so the generator can load its frontend static resources.
physical_resource={your_home_path}/workspace/sparrow/sparrow-js/sourceReplace your_home_path with your actual home directory and ensure the path matches the location of sparrow-js.
The dev environment uses port 8888 by default. Open the home page and sign in to start configuring projects.
cd ~/workspace/sparrow/sparrow-coder/coder-main-spring-boot
mvn spring-boot:runHome: http://localhost:8888; API docs: http://localhost:8888/doc.html; Druid monitor: http://localhost:8888/druid (default username and password: druid).
bomcoder-protocolcoder-pocoder-dao-apicoder-dao-sparrowcoder-dao-mybatiscoder-domaincoder-infrastructurecoder-adaptercoder-spring-startercoder-main-spring-bootddlSUPPORT / FAQ
Confirm that all dependency repositories are cloned, then run mvn clean install in the order shown in the setup guide. Install sparrow-shell first because the other modules depend on its POMs.
Check that MySQL is running, the sparrow database exists, and the connection URL, username and password in application.properties are correct.
Check workspace and frontend_project_root in application.properties, as well as physical_resource in dev.properties. Each path must resolve to the correct local directory.
No. Department and UserExample are references. Copy them into your business project's own PO package and update the package declaration before generation. The generator uses your PO metadata and does not require AI.
BUILD WITH SPARROW
Define your project and PO classes. Save your time for the logic that makes your business different.