Convert Figma logo to code with AI

hs-web logohsweb-framework

hsweb (haʊs wɛb) 是一个基于spring-boot 2.x开发 ,首个使用全响应式编程的企业级后台管理系统基础项目。

8,314
3,046
8,314
4

Top Related Projects

An powerful enhanced toolkit of MyBatis for simplify development

40,000

🔥「企业级低代码平台」前后端分离架构SpringBoot 2.x/3.x,SpringCloud,Ant Design&Vue3,Mybatis,Shiro,JWT。强大的代码生成器让前后端代码一键生成,无需写任何代码! 引领新的开发模式OnlineCoding->代码生成->手工MERGE,帮助Java项目解决70%重复工作,让开发更关注业务,既能快速提高效率,帮助公司节省成本,同时又不失灵活性。

21,181

eladmin jpa 版本:项目基于 Spring Boot 2.6.4、 Jpa、 Spring Security、Redis、Vue的前后端分离的后台管理系统,项目采用分模块开发方式, 权限控制采用 RBAC,支持数据字典与数据权限管理,支持一键生成前后端代码,支持动态路由

:seedling::rocket:一个基于Spring Boot & MyBatis的种子项目,用于快速构建中小型API、RESTful API项目~

🔥 官方推荐 🔥 RuoYi-Vue 全新 Pro 版本,优化重构所有功能。基于 Spring Boot + MyBatis Plus + Vue & Element 实现的后台管理系统 + 微信小程序,支持 RBAC 动态权限、数据权限、SaaS 多租户、Flowable 工作流、三方登录、支付、短信、商城、CRM、ERP、AI 大模型等功能。你的 ⭐️ Star ⭐️,是作者生发的动力!

🚀一个用来深入学习并实战 Spring Boot 的项目。

Quick Overview

hsweb-framework is an open-source Java framework for building enterprise-grade web applications. It provides a comprehensive set of tools and modules for rapid development, including a powerful permission system, dynamic form engine, and workflow management capabilities.

Pros

  • Modular architecture allowing for flexible customization and extension
  • Robust permission and authentication system out of the box
  • Built-in support for dynamic forms and workflow management
  • Active development and community support

Cons

  • Steeper learning curve compared to some simpler frameworks
  • Documentation primarily in Chinese, which may be challenging for non-Chinese speakers
  • Some modules may be overly complex for simpler applications
  • Limited third-party integrations compared to more popular frameworks

Code Examples

  1. Creating a RESTful API endpoint:
@RestController
@RequestMapping("/api/user")
public class UserController {
    @GetMapping("/{id}")
    public ResponseEntity<User> getUser(@PathVariable String id) {
        // Logic to fetch user by id
        return ResponseEntity.ok(user);
    }
}
  1. Implementing dynamic form handling:
@Autowired
private DynamicFormService dynamicFormService;

@PostMapping("/save-form")
public ResponseEntity<String> saveForm(@RequestBody DynamicFormEntity form) {
    dynamicFormService.saveOrUpdate(form);
    return ResponseEntity.ok("Form saved successfully");
}
  1. Using the permission system:
@RequiresPermissions("user:view")
@GetMapping("/users")
public List<User> listUsers() {
    // Logic to list users
    return userList;
}

Getting Started

To start using hsweb-framework, add the following dependency to your Maven pom.xml:

<dependency>
    <groupId>org.hswebframework.web</groupId>
    <artifactId>hsweb-starter</artifactId>
    <version>4.0.15-SNAPSHOT</version>
</dependency>

Then, create a Spring Boot application class:

@SpringBootApplication
@EnableHswebFramework
public class MyApplication {
    public static void main(String[] args) {
        SpringApplication.run(MyApplication.class, args);
    }
}

Configure your application properties and start building your modules using hsweb-framework's components and services.

Competitor Comparisons

An powerful enhanced toolkit of MyBatis for simplify development

Pros of mybatis-plus

  • Simpler and more lightweight, focusing specifically on MyBatis enhancement
  • Extensive code generation capabilities for rapid development
  • Strong community support and frequent updates

Cons of mybatis-plus

  • Less comprehensive than hsweb-framework, which offers a full-stack solution
  • May require additional libraries for features like security and authorization
  • Limited built-in support for complex business logic implementations

Code Comparison

mybatis-plus:

@TableName("user")
public class User {
    @TableId(type = IdType.AUTO)
    private Long id;
    private String name;
    private Integer age;
}

hsweb-framework:

@Table(name = "s_user")
public class User extends GenericEntity<String> {
    @Column(length = 128)
    private String name;
    @Column
    private Integer age;
}

Both frameworks simplify entity definitions, but mybatis-plus uses annotations specific to its ecosystem, while hsweb-framework leverages more standard JPA annotations. mybatis-plus focuses on database-related features, whereas hsweb-framework provides a broader set of annotations and utilities for building enterprise applications.

40,000

🔥「企业级低代码平台」前后端分离架构SpringBoot 2.x/3.x,SpringCloud,Ant Design&Vue3,Mybatis,Shiro,JWT。强大的代码生成器让前后端代码一键生成,无需写任何代码! 引领新的开发模式OnlineCoding->代码生成->手工MERGE,帮助Java项目解决70%重复工作,让开发更关注业务,既能快速提高效率,帮助公司节省成本,同时又不失灵活性。

Pros of JeecgBoot

  • More comprehensive out-of-the-box features, including a code generator and low-code development platform
  • Stronger focus on rapid application development and prototyping
  • Larger community and more frequent updates

Cons of JeecgBoot

  • Steeper learning curve due to its extensive feature set
  • Potentially more complex codebase, which may impact customization and maintenance
  • Heavier framework with more dependencies

Code Comparison

JeecgBoot example (controller):

@RestController
@RequestMapping("/test")
@Slf4j
public class TestController {
    @GetMapping(value = "/hello")
    public Result<String> hello() {
        Result<String> result = new Result<String>();
        result.setResult("Hello World!");
        return result;
    }
}

hsweb-framework example (controller):

@RestController
@RequestMapping("/test")
public class TestController {
    @GetMapping("/hello")
    public ResponseEntity<String> hello() {
        return ResponseEntity.ok("Hello World!");
    }
}

Both frameworks provide similar basic functionality, but JeecgBoot includes additional features like built-in Result wrapper and logging annotations. hsweb-framework's approach is more lightweight and closer to standard Spring Boot conventions.

21,181

eladmin jpa 版本:项目基于 Spring Boot 2.6.4、 Jpa、 Spring Security、Redis、Vue的前后端分离的后台管理系统,项目采用分模块开发方式, 权限控制采用 RBAC,支持数据字典与数据权限管理,支持一键生成前后端代码,支持动态路由

Pros of eladmin

  • More focused on admin panel functionality, providing a comprehensive solution for backend management systems
  • Offers a modern and user-friendly UI with Vue.js frontend
  • Includes built-in user management, role-based access control, and data dictionary features

Cons of eladmin

  • Less flexible and customizable compared to hsweb-framework's modular architecture
  • Smaller community and fewer contributors, potentially leading to slower development and issue resolution
  • More opinionated in its approach, which may not suit all project requirements

Code Comparison

eladmin (Java):

@Data
@Entity
@Table(name="sys_user")
public class User extends BaseEntity implements Serializable {
    @Column(unique = true)
    private String username;
    private String password;
    private String email;
    private String phone;
}

hsweb-framework (Java):

@Table(name = "s_user")
public interface UserEntity extends Entity {
    @Property(column = "username")
    String getUsername();
    void setUsername(String username);
    @Property(column = "password")
    String getPassword();
    void setPassword(String password);
}

Both frameworks use annotations for entity mapping, but hsweb-framework employs interfaces for entities, potentially offering more flexibility in implementation.

:seedling::rocket:一个基于Spring Boot & MyBatis的种子项目,用于快速构建中小型API、RESTful API项目~

Pros of spring-boot-api-project-seed

  • Lightweight and focused on providing a basic structure for RESTful API projects
  • Includes Swagger for API documentation out of the box
  • Simpler learning curve for developers new to Spring Boot

Cons of spring-boot-api-project-seed

  • Less comprehensive feature set compared to hsweb-framework
  • Limited built-in security features
  • Fewer advanced components for complex enterprise applications

Code Comparison

hsweb-framework:

@RestController
@RequestMapping("/user")
public class UserController implements SimpleGenericEntityController<User, String> {
    @Autowired
    private UserService userService;

    @Override
    public CrudService<User, String> getService() {
        return userService;
    }
}

spring-boot-api-project-seed:

@RestController
@RequestMapping("/users")
public class UserController {
    @Autowired
    private UserService userService;

    @PostMapping
    public Result add(@RequestBody User user) {
        userService.save(user);
        return ResultGenerator.genSuccessResult();
    }
}

The code comparison shows that hsweb-framework uses a more generic approach with interfaces, while spring-boot-api-project-seed opts for a simpler, more straightforward implementation. hsweb-framework's approach allows for more reusable and extensible code, but may have a steeper learning curve. spring-boot-api-project-seed's approach is more intuitive for beginners but may require more boilerplate code for complex scenarios.

🔥 官方推荐 🔥 RuoYi-Vue 全新 Pro 版本,优化重构所有功能。基于 Spring Boot + MyBatis Plus + Vue & Element 实现的后台管理系统 + 微信小程序,支持 RBAC 动态权限、数据权限、SaaS 多租户、Flowable 工作流、三方登录、支付、短信、商城、CRM、ERP、AI 大模型等功能。你的 ⭐️ Star ⭐️,是作者生发的动力!

Pros of ruoyi-vue-pro

  • More comprehensive documentation and guides for developers
  • Includes a Vue.js-based frontend, offering a complete full-stack solution
  • Active community with frequent updates and contributions

Cons of ruoyi-vue-pro

  • Steeper learning curve due to its extensive feature set
  • Potentially heavier resource consumption for smaller projects
  • Less flexibility for customization compared to hsweb-framework

Code Comparison

ruoyi-vue-pro:

@PreAuthorize("@ss.hasPermission('system:user:list')")
@GetMapping("/list")
public TableDataInfo list(SysUser user) {
    startPage();
    List<SysUser> list = userService.selectUserList(user);
    return getDataTable(list);
}

hsweb-framework:

@GetMapping
@Authorize(action = Permission.ACTION_QUERY)
public Mono<PagerResult<UserEntity>> list(QueryParamEntity query) {
    return userService.queryPager(query);
}

The code snippets demonstrate different approaches to user list retrieval and authorization. ruoyi-vue-pro uses Spring Security's @PreAuthorize annotation, while hsweb-framework employs its custom @Authorize annotation. ruoyi-vue-pro's implementation includes pagination, whereas hsweb-framework uses reactive programming with Mono.

Both frameworks offer robust solutions for enterprise applications, with ruoyi-vue-pro providing a more opinionated, full-stack approach and hsweb-framework offering greater flexibility for customization.

🚀一个用来深入学习并实战 Spring Boot 的项目。

Pros of spring-boot-demo

  • More comprehensive and diverse set of examples covering various Spring Boot features
  • Better organized structure with separate modules for different functionalities
  • More active development and frequent updates

Cons of spring-boot-demo

  • Lacks a cohesive framework approach, focusing more on individual examples
  • May be overwhelming for beginners due to the large number of modules
  • Less focus on enterprise-level features compared to hsweb-framework

Code Comparison

spring-boot-demo:

@SpringBootApplication
@EnableCaching
public class SpringBootDemoCacheRedisApplication {
    public static void main(String[] args) {
        SpringApplication.run(SpringBootDemoCacheRedisApplication.class, args);
    }
}

hsweb-framework:

@Configuration
@ComponentScan(basePackages = "org.hswebframework.web")
@MapperScan(basePackages = "org.hswebframework.web.dao")
@EnableAspectJAutoProxy
@EnableTransactionManagement
public class DefaultSystemConfiguration {
    // Configuration details
}

The code comparison shows that spring-boot-demo focuses on simplicity and ease of use, while hsweb-framework provides a more comprehensive configuration setup for enterprise applications. spring-boot-demo's approach is more suitable for learning and quick prototyping, whereas hsweb-framework is geared towards building robust, scalable systems.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

hsweb4 基于spring-boot2,全响应式的后台管理框架

Codecov Build Status License

功能,特性

  • 基于r2dbc ,easy-orm 的通用响应式CRUD
    • H2,Mysql,SqlServer,PostgreSQL
  • 响应式r2dbc事务控制
  • 响应式权限控制,以及权限信息获取
    • RBAC权限控制
    • 数据权限控制
    • 双因子验证
  • 多维度权限管理功能
  • 响应式缓存
  • 非响应式支持(mvc,jdbc)
  • 内置业务功能
    • 权限管理
      • 用户管理
      • 权限设置
      • 权限分配
    • 文件上传
      • 静态文件上传
      • 文件秒传
    • 数据字典

示例

https://github.com/zhou-hao/hsweb4-examples

应用场景

  1. 完全开源的后台管理系统.
  2. 模块化的后台管理系统.
  3. 功能可拓展的后台管理系统.
  4. 集成各种常用功能的后台管理系统.
  5. 前后分离的后台管理系统.

注意: 项目主要基于spring-boot,spring-webflux. 在使用hsweb之前,你应该对 project-reactor , spring-boot 有一定的了解.

项目模块太多?不要被吓到.我们不推荐将本项目直接clone后修改,运行.而是使用maven依赖的方式使用hsweb. 选择自己需要的模块进行依赖,正式版发布后,所有模块都将发布到maven中央仓库.

文档

各个模块的使用方式查看对应模块下的 README.md,在使用之前, 你可以先粗略浏览一下各个模块,对每个模块的作用有大致的了解.

核心技术选型

  1. Java 8
  2. Maven3
  3. Spring Boot 2.x
  4. Project Reactor 响应式编程框架
  5. hsweb easy orm 对r2dbc的orm封装

模块简介

模块说明
hsweb-authorization权限控制
hsweb-commons基础通用功能
hsweb-concurrent并发包,缓存,等
hsweb-core框架核心,基础工具类
hsweb-datasource数据源
hsweb-logging日志
hsweb-starter模块启动器
hsweb-system系统常用功能

核心特性

  1. 响应式,首个基于spring-webflux,r2dbc,从头到位的响应式.
  2. DSL风格,可拓展的通用curd,支持前端直接传参数,无需担心任何sql注入.
  //where name = #{name}
  createQuery()
          .where("name",name)
          .fetch();

          //update s_user set name = #{user.name} where id = #{user.id}
          createUpdate()
          .set(user::getName)
          .where(user::getId)
          .execute();

  1. 类JPA增删改

@Table(name = "s_entity")
public class MyEntity {
    
    @Id
    private String id;
    
    @Column
    private String name;

    @Column
    private Long createTime;
}

直接注入即可实现增删改查


@Autowire
private ReactiveRepository<MyEntity, String> repository;

  1. 灵活的权限控制

@PostMapping("/account")
@SaveAction
public Mono<String> addAccount(@RequestBody Mono<Account> account){
     return accountService.doSave(account);
}

License

Apache 2.0

Stargazers over time