GithubHelp home page GithubHelp logo

miansen / springboot-react-blog Goto Github PK

View Code? Open in Web Editor NEW
113.0 4.0 33.0 2.46 MB

使用 springboot 和 react 开发的博客系统

License: MIT License

Java 38.17% JavaScript 53.04% HTML 1.17% CSS 6.15% Dockerfile 0.01% Less 1.46%
springboot mybatis react redux ant-design tell

springboot-react-blog's Introduction

springboot-react-blog

在线预览:http://101.34.121.225:3008

技术栈

  • SpringBoot
  • MyBatis
  • React
  • Redux
  • antd

功能

  • 首页浏览
  • 登录
  • 注册
  • 发文章
  • 评论
  • 通知
  • 文章详情
  • 主题详情
  • 作者详情

预览

快速开始

本地运行

需求环境

  • JDK 1.8 或以上
  • MySQL 5.7
  • Maven 3.5 或以上
  • Nodejs 10.13 或以上
  • yarn 1.12.3 或以上

1.克隆项目到本地:https://github.com/miansen/springboot-react-blog.git

2.创建 MySQL 数据库 tell,字符集 utf8mb4。

3.将项目下的 tell-server/src/main/resources/db/init.sql 文件导入到 tell 数据库。

4.修改数据源配置

打开数据源配置文件 tell-server/src/main/resources/application-dev.yml

spring:
  datasource:
    #  数据源基本配置(请换成你自己的)
    username: root
    password: 123
    url: jdbc:mysql://127.0.0.1:3306/tell?autoReconnect=true&useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8
    driver-class-name: com.mysql.jdbc.Driver

usernamepasswordurl 换成你自己的。

5.启动后台服务

进入 tell-server 目录,输入以下命令:

mvn install
mvn package
mvn spring-boot:run

6.启动前端界面

进入 tell-front 目录,输入以下命令:

yarn install
yarn start

7.打开浏览器访问即可,至此成功运行。

服务器 Docker 运行

需求环境

  • Docker
  • Docker-compose

1.克隆项目到服务器上:https://github.com/miansen/springboot-react-blog.git

2.cd springboot-react-blog 进入项目

3.修改 axios.js 配置

打开文件 tell-front/src/axios/axios.js,修改后端接口的配置。将 localhost 修改成你服务器的域名或者 IP,将端口 8080 改成 8090

const Axios = axios.create({
    baseURL: 'http://localhost:8080'
});

4.运行 docker-compose up -d 命令启动容器,-d 是后台运行的意思。

5.浏览器运行 http://ip:3008 , 后台地址 http://ip:8090

6.关闭容器 docker-compose down

7.查看日志 docker-compose logs -f server

P.S. 第一次运行会比较慢,请耐心等待。

反馈

issues

贡献

欢迎大家提 issues,谢谢!

License

MIT

springboot-react-blog's People

Contributors

miansen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

springboot-react-blog's Issues

request of options 403

miansen你好,
我按照提示,将前后端部署在了服务器上,然后访问服务(http://120.24.74.113:3000/ ),get请求是ok的,但是options请求返回403,排查了很久但是仍未解决,请问作者您之前有遇到过这种情况吗?
任何回复将不甚感激。
祝新春快乐!
Cora

数据访问不到

您好 我是React初学者 刚刚克隆了你的项目 我把所有配置都弄完了 [发现怎么也获取不到数据 一直出现服务器异常

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.