1 Star 0 Fork 58

小雄 / coffee-boot

forked from Kevin / coffee-boot 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

Coffee Admin

Downloads Build Status Build Status

简介

Coffee Admin权限管理系统,基于VUE3.x、SpringBoot2.x、Sa-Token、MyBatis-Plus、Mybatis-Plus Dynamic Datasource等技术实现的前后端分离的权限管理系统。 可用于学习参考和项目开发。

特性

  • WEB容器使用了undertow,相较于tomcat,并发性更好,性能要好一些。
  • Lombok,消除冗长的java代码,更加简化。
  • Mybatis Plus,可以简化CRUD开发。
  • Mybatis Plus Generator,生成前后端代码,简化开发工作量。
  • 使用java新特性,Stream API、lambda表达式等。
  • Hutool工具集合,减少项目工具类的编写。
  • Sa-Token权限认证框架,细分到页面按钮级别。
  • EasyExcel,方便导入导出功能,自定义Convert类,实现了数据字典的转化。
  • Guava,非常方便的java工具集,提供了类似Lists.newArrayList()和Sets.newHashSet()等静态方法。
  • @DS注解,支持多数据源切换。
  • Fastjson,方便了JSON的格式化和解析。
  • Alibaba Java Coding Guidelines插件,IDEA插件,提高代码质量。
  • MinIO,分布式文件存储。
  • 前端框架采用最新技术栈,Vue3 & Vite,打包更快更轻。
  • 前端框架采用TypeScript和Eslint,规范代码,提高项目可持续性和可维护性。

演示环境

演示地址:http://skysong.gitee.io/coffee-ui

备注:哪里有Linux服务器呢?

预览

项目地址

项目结构

coffee-boot
├── coffee-admin -- 内置功能,后台管理
├── coffee-codegen -- 内置功能,代码生成
├── coffee-common --内置功能,通用工具
├── coffee-framework -- 内置功能,核心模块
├── coffee-system -- 内置功能,系统模块
├── coffee-oss -- 内置功能,OSS文件存储模块

核心依赖

依赖 版本
Spring Boot 2.5.8
Sa Token 1.29.0
Mybatis Plus 3.5.1
Mybatis Plus Generator 3.4.1
Hutool 5.7.21
Guava 30.1.1-jre
EasyExcel 3.0.5
Fastjson 1.2.79
Minio 8.3.7

内置功能

1、菜单管理
2、字典管理
3、部门管理
4、岗位管理
5、角色管理
6、用户管理
7、参数设置
8、行政区域
9、在线用户
10、操作日志
11、账户设置

前端安装

# 安装依赖
pnpm install

# 运行项目
pnpm serve

# 打包发布
pnpm build

前端说明

  • vue-vben-admin - 基于该前端框架开发,不定期同步更新。

环境安装

1、安装Mysql数据库,安装Redis,安装MinIO文件存储。
2、执行./doc/db/schema.sql,创建数据库。
3、执行./doc/db/coffee.sql,创建数据表和插入基础数据。

Docker常用命令

1、查看镜像
docker images

2、查看所有容器
docker ps -a

3、拉取镜像
docker pull redis:latest

4、参数解释
--name,设置运行的镜像名称
-p,映射端口,虚拟机端口:docker端口
-e,设置环境变量
-v,挂载目录/文件,虚拟机目录/文件:docker目录/文件
--privileged=true,设置特权,比如为mysql获取root权限
-d,守护进程后台运行
-it,启动并运行
--restart=always,在docker服务重启后,自动重启mysql服务,也可以把docker服务作为开机启动,这样mysql就可以跟着开机启动了
--link,设置容器别名

Docker安装Redis

1、拉取镜像
docker pull redis:latest

2、启动并运行
docker run -itd --name redis -p 6379:6379 redis

Docker安装Mysql

1、拉取镜像
docker pull mysql:5.7

2、创建目录并授权
mkdir -p /data/docker/mysql/data /data/docker/mysql/conf
chmod -R 755 /data/docker

3、创建配置文件并授权
cd /data/docker/mysql/conf
touch my.cnf
vi /data/docker/mysql/conf/my.cnf
chmod 755 /data/docker/mysql/conf/my.cnf
my.cnf内容如下:
[client]
port=3306
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld]
character_set_server=utf8
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
lower_case_table_names=1

4、启动并运行
docker run -itd --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 --privileged=true -v /data/docker/mysql/conf/my.cnf:/etc/mysql/my.cnf -v /data/docker/mysql/data:/var/lib/mysql -v /data/docker/mysql/logs:/var/log/mysql mysql:5.7

5、远程连接,无法访问
a)进入容器,docker exec -it containerId /bin/bash
b)进入MySql,mysql -uroot
c)切换数据库,use mysql
d)修改权限,grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option;
e)刷新权限,flush privileges;

Docker安装MinIO

1、拉取镜像
docker pull minio/minio

2、创建目录并授权
mkdir -p /data/docker/minio/data
chmod -R 755 /data/docker

3、启动并运行
docker run -d -p 9000:9000 -p 9001:9001 --name=minio -v /data/docker/minio/data:/data quay.io/minio/minio server /data/data-{1...4} --console-address ":9001" --address ":9000"

MinIO文件存储

部署

一、打包命令:指定prod环境,进行打包
    mvn clean package -DskipTests -Pprod
二、启动
    1、Windows环境,运行./doc/bin/run.bat
    2、Linux环境,运行./doc/bin/linux/startup.sh
三、注意事项
    1、Linux执行脚本,需要先授权,chmod +x startup.sh
    2、run.bat或startup.sh,需要和coffee-admin.jar放在同一个目录运行
    3、指定端口,需要修改脚本,并添加server.port参数,示例:--server.port=9090
四、服务器部署目录结构
    /opt
    ├── coffee
    ├──── coffee-ui
    ├──── coffee-boot
    ├────── startup.sh
    ├────── coffee-admin.jar

nginx配置

    location / {
        root   /opt/coffee/coffee-ui;
        try_files $uri $uri/ @router;
        index  index.html index.htm;
    }
    
    location @router {
        rewrite ^.*$ /index.html last;
    }
    
    location ^~ /api {
        proxy_pass  http://localhost:9090/api;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header REMOTE-HOST $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

使用帮助

代码同步方法(示例)

1、fork代码,fork from https://gitee.com/skysong/coffee-ui
2、创建自己的分支,进行开发,feature-dev
3、码云强制同步

4、合并代码,merge into feature-dev

代码生成(CodeGenerator)

    /** 按照个人需要,进行修改 */
    public static final String AUTHOR = "Kevin";
    public static final String PROJECT_PATH = "D:\\tempCode";
    public static final String PACKAGE_PARENT = "com.coffee";
    public static final String MODULE_NAME = "system";

    /** 生成SQL脚本的上级菜单的ID,要开发的功能,需要放到XXX菜单下面,请找到XXX菜单的ID */
    public static final String PARENT_MENU_ID = "1406064334403878913";

    /** admin的ID,可以不用修改 */
    public static final String CREATE_BY = "1";
    public static final String UPDATE_BY = "1";

    /** 默认菜单图标,可以不用修改,SQL脚本生成之后,在页面选择图标,进行修改即可 */
    public static final String ICON = "ant-design:unordered-list-outlined";

    // 是否导出excel
    public static final Boolean exportExcel = false;

    public static void main(String[] args) {
        new CodeGenerator().generate(
                "sys_example"
        );
    }

EasyExcel使用

excel标题宽度
两个字:@ColumnWidth(10)
四个字:@ColumnWidth(15)

Java编码规范(Java开发手册更新至嵩山版)

Java开发手册

Java规范

1、大道至简

2、IDEA安装Alibaba Java Coding Guidelines插件,编码规约扫描,代码中不要出现警告

建表规范

1、ID主键,bigint(20),雪花算法

2、审计字段,create_by、create_time、update_by、update_time

3、表中字段类型,主要采用varchar,万一迁移oracle、sqlserver数据库呢,好兼容

Vue编码规范

1、全局通用组件放在/src/components目录

2、业务组件放在./components目录

3、文件夹,使用camelCase命名格式

4、*.vue文件使用PascalCase命名格式,index.vue除外

5、属于类的*.js文件,使用PascalCase命名格式,index.js除外

6、属于Api的*.js文件,统一加上Api后缀,使用camelCase命名格式

7、其他类型的*.js文件,使用camelCase命名格式

8、样式文件、图片文件等,使用kebab-case命名格式

9、api模块和view模块,一一对应

10、方便记忆规则和项目开发

CSS编码规范

CSS编码规范,BEM:就是块(block)、元素(element)、修饰符(modifier)

.block{}
.block__element{}
.block--modifier{}

.block 代表了更高级别的抽象或组件。
.block__element 代表.block的后代,用于形成一个完整的.block的整体。
.block--modifier代表.block的不同状态或不同版本

QQ群,问题反馈和Bug修复

805450144

Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

简介

Coffee Admin权限管理系统,基于VUE3.x、SpringBoot2.x、SpringSecurity、MyBatis-Plus等技术实现的前后端分离的权限管理系统。 可用于学习参考和项目开发。 展开 收起
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/xiongq_com/coffee-boot.git
git@gitee.com:xiongq_com/coffee-boot.git
xiongq_com
coffee-boot
coffee-boot
master

搜索帮助