• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

yblog: yblog是一个基于SpringBoot架构开发的博客系统,采用了SpringBoot、SpringSecu ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

yblog

开源软件地址:

https://gitee.com/youzhengjie/springBootBlog

开源软件介绍:

yblog

yblog

yblog,一个简单、功能齐全的SpringBoot博客系统

star

  yblog是基于SpringBoot架构开发的博客:博文管理统计图表接口监控访问记录附件管理用户管理友链管理监控管理抓取博文代码生成器以及第三方登录等功能,且一直会对本项目进行加强,请各位大佬多多指点,一起共同进步。文章无需自己写,可以使用作者自己编写的全自动爬虫工具即可,只需轻轻一点,万千文章到手。

新增功能

  • yblog内置代码生成器,目前可以生成pojo、dao、service以及数据库/表,因为是自己写的生成器,所以会有一些不足,有关代码生成功能后续会进行优化

CSDN个人主页

https://blog.csdn.net/weixin_50071998?type=blog

SpringBoot版yblog仓库地址

GitHub: https://github.com/youzhengjie9/yblog
Gitee: https://gitee.com/youzhengjie/springBootBlog

SpringCloud微服务版cloud-yblog仓库地址

GitHub: https://github.com/youzhengjie9/cloud-yblog
Gitee: https://gitee.com/youzhengjie/cloud-yblog

目标

虽说博客系统已不是新鲜玩意,但是我觉得把一个普通的项目做的更完善、功能更多的话你就不普通,我也会秉承着这个理念一直把项目完善下去
本人是大二的菜鸟,项目中如有不足,请大佬赐教,一起共同进步吧!!!

技术栈

后端

名称官网
Spring Boothttps://spring.io/projects/spring-boot
Redishttp://www.redis.cn/
RabbitMQhttps://www.rabbitmq.com/
elasticSearchhttps://www.elastic.co/cn/elasticsearch/
MyBatishttp://www.mybatis.org/mybatis-3/zh/index.html
Spring Securityhttps://spring.io/projects/spring-security/
PageHelperhttp://git.oschina.net/free/Mybatis_PageHelper
Mavenhttp://maven.apache.org/
MySQLhttps://www.mysql.com/
Swagger2https://swagger.io/
Druidhttps://github.com/alibaba/druid
fastjsonhttps://github.com/alibaba/fastjson/
log4jhttp://logging.apache.org/log4j/1.2/
thumbnailatorhttps://github.com/coobird/thumbnailator
Nginxhttp://nginx.org/en/download.html

前端

名称描述官网
jQuery函数库http://jquery.com/
Bootstrap前端框架https://v3.bootcss.com/
echarts可视化图表库https://echarts.apache.org/zh/index.html
Thymeleaf模板引擎https://www.thymeleaf.org/
TinyMCE富文本编辑器http://tinymce.ax-z.cn/
alertJs弹框插件https://gitee.com/ydq/alertjs
layui模块化前端UI框架https://www.layui.com/

安装教程

Windows部署
  • 1.找到sql包的sql文件并导入到自己的数据库中

  • 2.修改application.yml中的redis、mysql、elasticsearch、邮件发送校验码、rabbitmq即可

  • 3.启动redis、mysql、elasticsearch、rabbitmq的服务

  • 4.执行elasticSearchTest的es创建索引命令和执行下面的添加数据代码

  • 第一点注意:如需使用爬虫功能,则需要对mysql做出如下配置。

  • 1.修改mysql的配置文件mysql/bin/my.ini, 添加如下内容:

[client]default-character-set=utf8mb4 [mysql]default-character-set=utf8mb4 [mysqld]character-set-client-handshake=FALSEcharacter-set-server=utf8mb4collation-server=utf8mb4_unicode_ciinit_connect='SET NAMES utf8mb4'
  • 2.重启数据库服务。点击此电脑,右键打开管理,点击服务和应用程序、点击服务、找到MYSQL服务,右键重新启动即可

  • 3.进入mysql命令行,输入ALTER TABLE TABLE_NAME CONVERT TO CHARACTER SET utf8mb4;把mysql的utf8编码切换成utf8mb4,以支持爬取的emoji表情,不然遇到4字节的宽字符就会插入异常了。

  • 第二点注意:本项目使用了Nginx做负载均衡,本机器的nginx.conf文件如下:

worker_processes  1;events {    worker_connections  1024;}http {    include       mime.types;    default_type  application/octet-stream;    sendfile        on;    keepalive_timeout  65;upstream yblog.cn{	server localhost:8080 weight=1;	server localhost:8081 weight=1;	server localhost:8082 weight=1;}    server {        listen       80;        server_name  localhost;        location / {            root   html;            index  index.html index.htm;			proxy_pass http://yblog.cn;        }              error_page   500 502 503 504  /50x.html;        location = /50x.html {            root   html;        }        }}
  • 在Run/Debug Configurations的SpringBoot environment设置VM options

  • 把三个服务分别设置成-Dserver.port=8080、-Dserver.port=8081、-Dserver.port=8082

  • 所以我们只需要把项目的8080、8081、8082端口打开,然后访问localhost:80即可实现负载均衡。

  • 评论模块需要自己去https://www.leancloud.cn/ 注册,获取AppID、AppKey,并加入到下面对应的js

new Valine({        el: '#vcomments',        appId: 'xxx',        appKey: 'yyy',        placeholder: '请输入内容',        pageSize: 3 ,        recordIP: true,        avatar:'',        requiredFields: ['nick']    });

,弄好了之后评论功能就能运行了。

  • 执行下面的SQL语句,往数据库添加后台菜单数据:
    INSERT INTO `t_menu` VALUES (1, 1, '[{\"id\":1,\"title\":\"工作空间\",\"type\":0,\"icon\":\"layui-icon layui-icon-console\",\"href\":\"\",\"children\":[{\"id\":10,\"title\":\"控制后台\",\"icon\":\"layui-icon layui-icon-console\",\"type\":1,\"openType\":\"_iframe\",\"href\":\"/pear/toconsole\"},{\"id\":14,\"title\":\"百度一下\",\"icon\":\"layui-icon layui-icon-console\",\"type\":1,\"openType\":\"_iframe\",\"href\":\"http://www.baidu.com\"}]},{\"id\":\"component\",\"title\":\"文章管理\",\"icon\":\"layui-icon layui-icon-component\",\"type\":0,\"href\":\"\",\"children\":[{\"id\":203,\"title\":\"发布文章\",\"icon\":\"layui-icon layui-icon-console\",\"type\":1,\"openType\":\"_iframe\",\"href\":\"/pear/topublish\"},{\"id\":205,\"title\":\"文章管理\",\"icon\":\"layui-icon layui-icon-console\",\"type\":1,\"openType\":\"_iframe\",\"href\":\"/pear/toArticleManager\"},{\"id\":207,\"title\":\"分类管理\",\"icon\":\"layui-icon layui-icon-console\",\"type\":1,\"openType\":\"_iframe\",\"href\":\"/pear/toCategory\"},{\"id\":208,\"title\":\"标签管理\",\"icon\":\"layui-icon layui-icon-console\",\"type\":1,\"openType\":\"_iframe\",\"href\":\"/pear/toTag\"}]},{\"id\":\"result\",\"title\":\"常用工具\",\"icon\":\"layui-icon layui-icon-auz\",\"type\":0,\"href\":\"\",\"children\":[{\"id\":\"success\",\"title\":\"附件管理\",\"icon\":\"layui-icon layui-icon-face-smile\",\"type\":1,\"openType\":\"_iframe\",\"href\":\"/pear/toFileUpload\"},{\"id\":\"failure\",\"title\":\"爬取数据\",\"icon\":\"layui-icon layui-icon-face-cry\",\"type\":1,\"openType\":\"_iframe\",\"href\":\"/pear/toCatchData\"}]},{\"id\":\"error\",\"title\":\"用户管理\",\"icon\":\"layui-icon layui-icon-face-cry\",\"type\":0,\"href\":\"\",\"children\":[{\"id\":403,\"title\":\"用户管理\",\"icon\":\"layui-icon layui-icon-face-smile\",\"type\":1,\"openType\":\"_iframe\",\"href\":\"/pear/toUserManager\"},{\"id\":404,\"title\":\"友链管理\",\"icon\":\"layui-icon layui-icon-face-cry\",\"type\":1,\"openType\":\"_iframe\",\"href\":\"/pear/toLink\"},{\"id\":500,\"title\":\"个人资料\",\"icon\":\"layui-icon layui-icon-face-cry\",\"type\":1,\"openType\":\"_iframe\",\"href\":\"/pear/touser\"}]},{\"id\":\"system\",\"title\":\"访客管理\",\"icon\":\"layui-icon layui-icon-set-fill\",\"type\":0,\"href\":\"\",\"children\":[{\"id\":601,\"title\":\"访客记录\",\"icon\":\"layui-icon layui-icon-face-smile\",\"type\":1,\"openType\":\"_iframe\",\"href\":\"/pear/toVisitor\"},{\"id\":602,\"title\":\"黑名单\",\"icon\":\"layui-icon layui-icon-face-cry\",\"type\":1,\"openType\":\"_iframe\",\"href\":\"/pear/toBlack\"},{\"id\":604,\"title\":\"拦截记录\",\"icon\":\"layui-icon layui-icon-face-cry\",\"type\":1,\"openType\":\"_iframe\",\"href\":\"/pear/toInterceptorLog\"},{\"id\":605,\"title\":\"行为日志\",\"icon\":\"layui-icon layui-icon-face-cry\",\"type\":1,\"openType\":\"_iframe\",\"href\":\"/pear/toLog\"}]},{\"id\":\"common\",\"title\":\"监控管理\",\"icon\":\"layui-icon layui-icon-component\",\"type\":0,\"href\":\"\",\"children\":[{\"id\":701,\"title\":\"数据监控\",\"icon\":\"layui-icon layui-icon-console\",\"type\":0,\"children\":[{\"id\":2011,\"title\":\"RabbitMQ\",\"icon\":\"layui-icon layui-icon-face-smile\",\"type\":1,\"openType\":\"_iframe\",\"href\":\"http://localhost:15672/\"},{\"id\":2014,\"title\":\"ElasticSearch\",\"icon\":\"layui-icon layui-icon-face-cry\",\"type\":1,\"openType\":\"_iframe\",\"href\":\"http://localhost:5601/\"},{\"id\":2010,\"title\":\"Druid\",\"icon\":\"layui-icon layui-icon-face-cry\",\"type\":1,\"openType\":\"_iframe\",\"href\":\"http://127.0.0.1:8080/druid/index.html\"}]},{\"id\":2017,\"title\":\"接口监控\",\"icon\":\"layui-icon layui-icon-face-smile\",\"type\":1,\"openType\":\"_iframe\",\"href\":\"/pear/monitorInterface\"}]},{\"id\":\"echarts\",\"title\":\"数据图表\",\"icon\":\"layui-icon layui-icon-chart\",\"type\":0,\"href\":\"\",\"children\":[{\"id\":12121,\"title\":\"数据图表\",\"icon\":\"layui-icon layui-icon-face-smile\",\"type\":1,\"openType\":\"_iframe\",\"href\":\"/pear/toEcharts\"}]},{\"id\":\"code\",\"title\":\"系统设置\",\"icon\":\"layui-icon layui-icon-util\",\"type\":0,\"href\":\"\",\"children\":[{\"id\":801,\"title\":\"系统设置\",\"icon\":\"layui-icon layui-icon-util\",\"type\":1,\"openType\":\"_iframe\",\"href\":\"/pear/toSetting\"}]}]');INSERT INTO `t_menu` VALUES (2, 2, '[{\"id\":1,\"title\":\"工作空间\",\"type\":0,\"icon\":\"layui-icon layui-icon-console\",\"href\":\"\",\"children\":[{\"id\":10,\"title\":\"控制后台\",\"icon\":\"layui-icon layui-icon-console\",\"type\":1,\"openType\":\"_iframe\",\"href\":\"/pear/toconsole\"},{\"id\":14,\"title\":\"百度一下\",\"icon\":\"layui-icon layui-icon-console\",\"type\":1,\"openType\":\"_iframe\",\"href\":\"http://www.baidu.com\"}]},{\"id\":\"component\",\"title\":\"文章管理\",\"icon\":\"layui-icon layui-icon-component\",\"type\":0,\"href\":\"\",\"children\":[{\"id\":203,\"title\":\"发布文章\",\"icon\":\"layui-icon layui-icon-console\",\"type\":1,\"openType\":\"_iframe\",\"href\":\"/pear/topublish\"},{\"id\":208,\"title\":\"标签管理\",\"icon\":\"layui-icon layui-icon-console\",\"type\":1,\"openType\":\"_iframe\",\"href\":\"/pear/toTag\"}]},{\"id\":\"result\",\"title\":\"常用工具\",\"icon\":\"layui-icon layui-icon-auz\",\"type\":0,\"href\":\"\",\"children\":[{\"id\":\"success\",\"title\":\"附件管理\",\"icon\":\"layui-icon layui-icon-face-smile\",\"type\":1,\"openType\":\"_iframe\",\"href\":\"/pear/toFileUpload\"},{\"id\":\"failure\",\"title\":\"爬取数据\",\"icon\":\"layui-icon layui-icon-face-cry\",\"type\":1,\"openType\":\"_iframe\",\"href\":\"/pear/toCatchData\"}]},{\"id\":\"error\",\"title\":\"用户管理\",\"icon\":\"layui-icon layui-icon-face-cry\",\"type\":0,\"href\":\"\",\"children\":[{\"id\":500,\"title\":\"个人资料\",\"icon\":\"layui-icon layui-icon-face-cry\",\"type\":1,\"openType\":\"_iframe\",\"href\":\"/pear/touser\"}]},{\"id\":\"echarts\",\"title\":\"数据图表\",\"icon\":\"layui-icon layui-icon-chart\",\"type\":0,\"href\":\"\",\"children\":[{\"id\":12121,\"title\":\"数据图表\",\"icon\":\"layui-icon layui-icon-face-smile\",\"type\":1,\"openType\":\"_iframe\",\"href\":\"/pear/toEcharts\"}]},{\"id\":\"code\",\"title\":\"系统设置\",\"icon\":\"layui-icon layui-icon-util\",\"type\":0,\"href\":\"\",\"children\":[{\"id\":801,\"title\":\"系统设置\",\"icon\":\"layui-icon layui-icon-util\",\"type\":1,\"openType\":\"_iframe\",\"href\":\"/pear/toSetting\"}]}]');
第三方登录
gitee
  • 接入gitee第三方授权配置,先在gitee的第三方应用上对网站进行授权,获得Client ID和Client Secret,并且要设置回调地址
  • 然后开启Nginx反向代理到80端口即可。
GitHub (需要用nginx 80端口)
  • GitHub第三方配置有点复杂,也弄了一两天,主要还是GitHub中国地区登录很慢
  • 我们只需要把com.boot.GitHubConstant的CLIENT_ID和CLIENT_SECRET换成自己的
  • 然后在login.html的GitHub第三方登录超链接中client_id=xxx换成自己的id,即可
Linux+Docker容器化部署
  • 前提:你的Linux系统必须要安装了Docker。(然后按顺序执行下面的命令)

  • 首先要启动docker,因为docker默认是关闭的,需要自己去开启

  • systemctl start docker    #启动docker容器systemctl start firewalld  #打开防火墙firewall-cmd --list-port   #查看防火墙已经打开的端口######重要:记得打开端口firewall-cmd --zone=public --add-port=8080/tcp --permanent  #打开8080端口firewall-cmd --zone=public --add-port=9090/tcp --permanent  #打开9090端口firewall-cmd --zone=public --add-port=5672/tcp --permanent  #打开5672端口firewall-cmd --zone=public --add-port=15672/tcp --permanent #打开15672端口firewall-cmd 
                          

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap