【前端篇】基于 React + NodeJS + Express + MongoDB 开发的一个社区系统

#1

小度鱼(前端篇)

介绍

小度鱼,是基于 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

3 Likes
#2

项目又有新的更新,增加了socket.io,对应的功能如下
1、通知
2、新帖子拉取(在首页的时候,有新的帖子会主动推送)
3、累计当前在线用户

1 Like
#3

界面简洁漂亮,刚刚注册了。有时间再看看源码,谢谢分享!

1 Like
#4

使用redux了吗?

#5

当然使用了哈

#6

我是windows 10系统,下载程序然后 npm install ,也相应修改,但是npm run dev 老是报这个 错,

请问该怎么让程序在我的系统里运行?就是开发部署怎么能成功呢?

#7

不错哦哦哦哦哦哦

#8

怎么还没有回复?项目运行不了,没法研究盒学习啊,继续开发也不行啊,
加了个小鱼的qq群,还被拒绝了,真奇怪。。

#9

你好,我没有建QQ群哦
window环境,可能会有一些问题,不能保证能正常运行
另外,从你错误提示上看,是window设置node环境变量的问题,解决方法可以看这个帖子的解决方法

#10

我没有安装mongodb会对安装程序有影响吗?我试了这个回复里的指引,还是没能运行成功,
已经加你qq了,希望有机会给我远程安装下。多谢了。