最近疫情比较紧张,在家调休,闲着无聊便写了个先后端分离,服务端渲染的博客系统。支持特性:node
使用技术:react.js typescript nextjs nestjs mysql。 GitHub 地址:github.com/zhxuc/wipi (欢迎 star)。mysql
地址:custw.qifengle1412.cn/react
更多页面及特性能够本地启动使用。git
地址:custw.qifengle1412.cn/admin/logingithub
帐户:wipi,密码:wipi123456。(请不要随便删数据哦)sql
git clone --depth=1 https://github.com/zhxuc/wipi.git your-project-name
复制代码
首先安装 MySQL
,推荐使用 docker 进行安装。docker
docker run -d --restart=always --name wipi-mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root mysql
复制代码
而后安装项目 node 依赖。typescript
cd client && yarn
cd server && yarn
复制代码
分别启动前台页面和服务端。shell
cd client && yarn dev
cd server && yarn start:dev
复制代码
打开浏览器,访问 http://localhost:3000
便可访问前台页面,http://localhost:3000/admin
为后台管理页面。后端
服务端接口运行在 http://localhost:4000
。
首次启动,默认建立用户:wipi,密码:wipi(可在 server/src/config
文件中进行修改)。
[PS] 如服务端配置启动失败,请先确认 MySQL 的配置是否正确,配置文件在 server/src/config
。
在服务器使用 pm2 进行部署便可,能够查看deploy.sh
文件。
该项目使用了 MySQL 模糊查询提供搜索接口。若是服务器配置较高,或想体验更强大的搜索服务(elasticsearch),能够参考 elasticsearch
文件下 deploy.sh
文件。
最后说一句: