Coder Social home page Coder Social logo

luban's Introduction

crates.io LICENSE Build Status

luban

luban is a generic project generator

install

mac

brew install luban-project/luban/luban
luban --version

linux/unix

curl https://sh.rustup.rs -sSf | sh # 1. install rust: 
cargo install cargo-luban           # 2. install luban: 
cargo luban --version               # 3. check version: 

Known Problems

OS Problem Solve
centos Could not find directory of OpenSSL yum install openssl-devel
ubuntu linker cc not found sudo apt-get install build-essential
ubuntu Could not find directory of OpenSSL sudo apt install libssl-dev & sudo apt instll pkg-config

windows

  1. install rust: following rust-lang
  2. install bullet: cargo install cargo-bullet
  3. check version: cargo bullet --version
  • please install visual studio to get the msvc compiler

usage example

# for the first time, install project template
luban install --name=bullet-spring-java-maven 

# generate project
luban fast-create --name=bullet-spring-java-maven --project=com.foo.example
cd example

# make shell executable
chmod 755 gen/gen.sh
chmod 755 run.sh

# generate code and run
./gen/gen.sh 
./run.sh

bullet-spring-java-maven模板说明

基本项目结构

root --|
    api --|  #对外提供的二方包,只能包含接口和POJO类,不能包含实现
             #后续dubbo接口/grpc接口也需要定义在这里
    app --|  #主体应用程序
        biz --| #业务逻辑层,应该只包含逻辑结构的组织
        clg --| #核心逻辑层,应该只包含核心的领域模型和逻辑,要求纯函数
        dal --| #数据操作层,mysql/redis/hbase/file等
        ext --| #外部防腐层,外部调用,mq接入等
        fun --| #通用方法层,纯函数
    gen --|  #自动代码生成的插件和配置

数据库代码生成

数据库相关的sql脚本在app/src/main/resouces/db/migration目录下
代码生成命令如下:

chmod 755 gen/gen.sh
./gen/gen.sh

项目运行

chmod 755 run.sh
./run.sh

Supported Templates

Java Spring Gradle

cargo bullet install --name=bullet-spring-java
cargo bullet create  --name=bullet-spring-java
cargo bullet build   --name=bullet-spring-java --output=out 

Java Spring Maven

cargo bullet install --name=bullet-spring-java-maven
cargo bullet create  --name=bullet-spring-java-maven
cargo bullet build   --name=bullet-spring-java-maven --output=out

MySQL accumulator

cargo bullet install --name=bullet-sql-accumulator
cargo bullet create  --name=bullet-sql-accumulator
cargo bullet build   --name=bullet-sql-accumulator --output=out 

luban's People

Contributors

soulww avatar thegenius avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.