【前端篇】基于 React + NodeJS + Express + MongoDB 开发的一个社区系统
发布于 7 年前 作者 54sword 9145 次浏览 来自 分享

小度鱼(前端篇)

介绍

小度鱼,是基于 React + NodeJS + Express + MongoDB 开发的一个社区系统 线上站点:https://www.xiaoduyu.com 前端源码地址:https://github.com/54sword/xiaoduyu.com 后端API源码地址:https://github.com/54sword/api.xiaoduyu.com 二维码: 小度鱼

特点

  • 页面极度简洁
  • 单页面应用,前后端分离
  • 使用 React 服务器端渲染,首屏服务端渲染,且完美支持SEO
  • 功能丰富,支持富文本编辑器,头像上传与裁剪,支持邮箱、微博、QQ注册登录,等等
  • 包含组件测试 (jest + enzyme)

开发部署

不保证 Windows 系统的兼容性

1. 安装 Node.js 大于6的版本 [必须]
2. git clone git@github.com:54sword/xiaoduyu.com.git
3. cd xiaoduyu.com
4. npm install
5. 在 ./node_modules/react-qiniu/index.js 第33行,增加一行如下代码
	if (typeof window == 'undefined' || typeof document == 'undefined') { return {} }
6. cp config/index.default.js config/index.js 请根据需要修改 config/index.js 配置文件
7. npm run dev
8. 访问 http://localhost:4000
9. 完成

发布部署

不保证 Windows 系统的兼容性

1. 安装 Node.js 大于6的版本 [必须]
2. git clone git@github.com:54sword/xiaoduyu.com.git
3. cd xiaoduyu.com
4. npm install
5. 在 ./node_modules/react-qiniu/index.js 第33行,增加一行如下代码
	if (typeof window == 'undefined' || typeof document == 'undefined') { return {} }
6. cp config/index.default.js config/index.js 请根据需要修改 config/index.js 配置文件
7. npm run build
8. npm run server
9. 访问 http://localhost:4000
10. 完成

运行测试

不保证 Windows 系统的兼容性

1. 安装 Node.js 大于6的版本 [必须]
2. git clone git@github.com:54sword/xiaoduyu.com.git
3. cd xiaoduyu.com
4. npm install
5. 在 ./node_modules/react-qiniu/index.js 第33行,增加一行如下代码
	if (typeof window == 'undefined' || typeof document == 'undefined') { return {} }
6. cp config/index.default.js config/index.js 请根据需要修改 config/index.js 配置文件
7. cp config/test.default.js config/test.js 请根据需要修改 config/test.js 配置文件
8. npm test
9. 完成

开源协议

MIT

9 回复

更新一下,增加了单元测试

想知道,你的第三方登录,拼装链接请求回调后,认证数据怎么传回到自己的页面

第三方登录,认证完成以后,会跳转到一个指定的后端着陆页面, 然后后端附带token,跳转到一个前端接收token的着陆页面,前端验证token是否有效,有效则登录成功

楼主可以整理一个文档吗 小白想学习一下

@DawnL6 额,目前没有文档,很抱歉!

回到顶部