Giter Club home page Giter Club logo

bdf3's Introduction

BDF3

BDF3 是基于 Spring Boot 组件化的渐进式企业级开发框架。 提供一系列企业级通用模块功能,使用 BDF3 框架在业务项目,我们可以直接专注到业务功能模块的开发。

欢迎大家联系我们:技术交流、商业合作、共建开源等。

非多租户模式: 演示 BDF3 框架.gif

多租户模式: 演示 BDF3 框架(多租户).gif

特征

  • 零配置,开箱即用。基于 Spring Boot 自动配置机制实现
  • 前端界面可视化开发,基于 Dorado 展现中间件实现
  • 前端组件标准化,后端开发者也能轻松开发前端
  • 抽象业务通用能力,提供通用功能模块,这些通用模块开箱即用,如权限管理、多租户、工作流、报表、实时通信、公众号、微程序、云数据库管理、规则引擎、日志、菜单、认证、字典、数据导入和导出等等
  • 基于角色的权限授权,权限粒度为组件级别
  • 开发企业管理系统效率极高
  • 多数据源智能切换、开启事务
  • 多租户支持,横向无限扩展,传统项目零代码切换为多租户项目
  • 提供丰富多样的主页面选择
  • 功能组件化,自由选择需要的组件
  • 基于 JPA 实现的极简、可读性高的结构化查询 Linq,与 Dorado 无缝集成
  • 基于 Spring Security 实现的认证与授权,开箱即用

在线演示

其中,公司 ID 为 master,用户名/密码为 admin/123456

开发文档

请使用手机扫描本文章最后的 QQ(609822297)群二维码,加群获取开发文档。

快速开始

BDF3 基于 Spring Boot 自动配置机制实现,做到了零配置,开箱即用,没有额外学习成本,BDF3 也提供了一系列 pom 类型的 Starter 模块,也 Spring Boot 提供的 Starter 模块类似,Starter 模块简化了 BDF3 的模块依赖管理,让项目依赖变得更为简单,好维护。

第一步:初始化一个标准的 Maven 项目

创建一个标准的 Maven 项目,名称为 bdf3-sample,项目打包类型为 jar,项目的父项目指向 bdf3-starter-parent。最终生成的 pom文件如下:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <!-- 继承的 BDF3 提供的依赖管理的父项目 -->
  <parent>
    <groupId>com.bstek.bdf3</groupId>
    <artifactId>bdf3-starter-parent</artifactId>
    <version>1.1.0-SNAPSHOT</version>
  </parent>
  <artifactId>bdf3-sample</artifactId>
  <dependencies>
    <!-- 添加 BDF3 提供的预定义依赖 Starter,BDF3 还提供了其他的 Starter -->
    <dependency>
      <groupId>com.bstek.bdf3</groupId>
      <artifactId>bdf3-starter</artifactId>
    </dependency>
    <!-- 开发测试工具 -->
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-devtools</artifactId>
      <scope>provided</scope>
    </dependency>
    <!-- 数据库驱动,正式场景改为 mysql、oracle 等等数据库驱动 -->
    <dependency> 
      <groupId>com.h2database</groupId>
      <artifactId>h2</artifactId> 
    </dependency>
  </dependencies>
  <!-- BDF3 提供的模块存放的 maven 私服仓库 -->
  <repositories>
    <repository>
      <id>bsdn-maven-repository</id>
      <url>http://nexus.bsdn.org/content/groups/public/</url>
    </repository>
  </repositories>
</project>

第二步:启动类

package com.bstek.bdf3.sample;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;

/**
 * @author Kevin Yang (mailto:[email protected])
 * @since 2016年12月10日
 */
@SpringBootApplication  // Spring Boot 启动类注解
@EnableCaching          // 开启缓存功能注解
public class SampleApplication {

    public static void main(String[] args) throws Exception {
		    SpringApplication.run(SampleApplication.class, args);
    }
  
}

通过以上两个步骤,一个基本的BDF3 框架的项目就搭建好了。直接运行项目的启动类(运行 main 静态方法)示例下载

数据源与 JPA 配置

在 Spring 的配置中,如下配置:

# 文件 application.properties
# 服务器端口设置
server.port = 8080
# 项目上下文路由
server.context-path=/bdf
# 是否打印sql语句
spring.jpa.showSql=true
#hibernate 反向创建表设置,update启动时更新表结构,create 启动时重新创建表结构,none 启动时不检查
spring.jpa.hibernate.ddl-auto=update
# Spring Boot 热部署设置,添加以下文件匹配规则,改动不重启。
spring.devtools.restart.additional-exclude=com/**
#数据库脚本的编码设置为 UTF-8
spring.datasource.sql-script-encoding=UTF-8

# 数据源配置,pom 中需要引入对应的数据库 jdbc 依赖,以下使用 mysql 数据库为例
spring.datasource.continue-on-error=true
spring.datasource.url=jdbc:mysql://localhost:3306/bdf3
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
# 如果数据库为非嵌入式数据库,这个属性第一次启动的时候一定要设置为ALWAYS,用于初始化数据,初始化好后,可以关闭,也可以不关闭,有自己决定
spring.datasource.initialization-mode=ALWAYS

Spring Boot 文档教程

Spring Boot 文档教程

交流群

bdf3's People

Contributors

cnxobo avatar dependabot[bot] avatar j-cafe avatar lucasyue avatar muxiangqiu avatar tanyicheng avatar williamsese 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.