GithubHelp home page GithubHelp logo

nealyang / react-express-blog-demo Goto Github PK

View Code? Open in Web Editor NEW
1.9K 68.0 438.0 67.41 MB

:fire: React full stack+Express+Mongo implementation blog website tutorial :new_moon_with_face:

JavaScript 99.81% CSS 0.18% HTML 0.01%
react demo mongoose redux-saga

react-express-blog-demo's Introduction

Hi👋 I'm Nealyang

  • 🔭 I’m currently working on Alibaba group
  • 🌱 I’m currently learning React,JavaScript

I think these code repositories are okay...

📊 some stats

📊 Weekly development breakdown

TypeScript   9 hrs 34 mins   ███████████████▓░░░░░░░░░   62.97 % 
JavaScript   5 hrs 13 mins   ████████▓░░░░░░░░░░░░░░░░   34.36 % 
SCSS         15 mins         ▒░░░░░░░░░░░░░░░░░░░░░░░░   01.71 % 
HTML         7 mins          ▒░░░░░░░░░░░░░░░░░░░░░░░░   00.85 % 

react-express-blog-demo's People

Contributors

nealyang avatar webpuy 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  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

react-express-blog-demo's Issues

CPU占用太高

博主,npm start之后,cpu就达到100%(win7 64、10G内存),把除了浏览器和两个启动的cmd窗口之外的应用都关了

npm run buildt error.

When I use the command npm run buildt,the console drop these error.I don't know why.

ReferenceError: Unknown plugin "transform-decorators-legacy" specified in "/ Users/rabo/Desktop/.babelrc" at 0, attempted to resolve relative to "/Users/ rabo/Desktop"

如何在项目中使用nodemailer

按照网上的教程安装以后 报各种缺少依赖模块的错误。看了一下别人用的都是放在server端的,他们的前后台有2个依赖环境的,跟作者这个不太一样。。。

state设计

请问一下,state结构的那个图,你是用什么软件画的啊,可以推荐一下吗?谢谢啦!

Error: connect ECONNREFUSED 127.0.0.1:3030

你好,非常感谢你Blog的开源,
我 git clone了你的项目,安装了依赖,初始化了mongodb的admin/admin,
然后进行npm start,出现了一个错误
在弹出的http://127.0.0.1:3000/页面,出现网络连接错误。
输出的信息表示是数据权限错误,不能连接到127.0.0.1:3030
下面是我cmd的输出信息,请问怎么样解决这个问题呢?
----------------------------------------------------------------------------------------------------------------------C:\Users\lenovo\Desktop\React-Express-Blog-Demo>npm start

[email protected] start C:\Users\lenovo\Desktop\React-Express-Blog-Demo

npm run watch-client & npm run start-dev-api

[email protected] watch-client C:\Users\lenovo\Desktop\React-Express-Bl
og-Demo
cross-env NODE_ENV=development node ./server/index.js

C:\Users\lenovo\Desktop\React-Express-Blog-Demo\app\index.js
clean-webpack-plugin: C:\Users\lenovo\Desktop\React-Express-Blog-Demo\build has
been removed.
build [= ] 10%===>open http://127.0.0.1:3000 in a browser to view the
app
build [== ] 15%webpack: wait until bundle finished: /__webpack_hmr
Build completed in 42.499s

webpack built df36efa870cb7f0046d2 in 42497ms
Hash: df36efa870cb7f0046d2
Version: webpack 3.10.0
Time: 42497ms
Asset Size Chunks Chun
k Names
d02fe8e3725c82dc54a287cf3b11039e.png 986 kB [emitted] [big]
b2299473f5628502c981b5a381307646.png 9.25 kB [emitted]
cddb5f2e8bc3caa6d0596f66274d54d5.jpg 12.2 kB [emitted]
f26996dee7e34d4f043302efa66f184a.png 888 kB [emitted] [big]
8f0078d321fdb9ab666606bbe0a1d929.png 1.33 MB [emitted] [big]
c95d7b3c64e890326489e808d77d8941.jpg 38.4 kB [emitted]
90a6f773e5a34a9a0ad0818b98511dd7.jpeg 9.69 kB [emitted]
vendor-df36efa8.js 9.17 MB 0 [emitted] [big] vend
or
index-df36efa8.js 763 kB 1 [emitted] [big] inde
x
manifest-df36efa8.js 31.2 kB 2 [emitted] mani
fest
index.html 329 bytes [emitted]
[2twT] ./app/index.js 1.57 kB {1} [built]
[3Sk7] ./node_modules/react-hot-loader/patch.js 40 bytes {0} [built]
[3r6y] ./node_modules/react-router-dom/es/NavLink.js 2.66 kB {0} [built]
[4M2W] ./node_modules/core-js/shim.js 8.18 kB {0} [built]
[52Em] ./node_modules/react-router-dom/es/Prompt.js 131 bytes {0} [built]
[F8kA] ./node_modules/react-router-dom/es/index.js 925 bytes {0} [built]
[O27J] ./node_modules/react-dom/index.js 59 bytes {0} [built]
[PGPo] ./node_modules/react-router-dom/es/Redirect.js 137 bytes {0} [built]
[R1Tp] (webpack)-hot-middleware/client.js?path=http://127.0.0.1:3000/__webpack_h
mr 7.35 kB {0} [built]
[RH2O] ./node_modules/react-redux/es/index.js 230 bytes {0} [built]
[U7vG] ./node_modules/react/react.js 56 bytes {0} [built]
[0] multi react-hot-loader/patch webpack-hot-middleware/client?path=http://12
7.0.0.1:3000/__webpack_hmr babel-polyfill ./app/index.js 64 bytes {1} [built]
[1] multi react react-dom react-router-dom 52 bytes {0} [built]
[dCLN] ./node_modules/react-router-dom/es/Router.js 131 bytes {0} [built]
[j1ja] ./node_modules/babel-polyfill/lib/index.js 833 bytes {0} [built]
+ 1504 hidden modules
Child html-webpack-plugin for "index.html":
Asset Size Chunks Chunk Names
index.html 1.45 MB 0
[3IRH] (webpack)/buildin/module.js 517 bytes {0} [built]
[DuR2] (webpack)/buildin/global.js 509 bytes {0} [built]
[M4fF] ./node_modules/lodash/lodash.js 540 kB {0} [built]
[a/t9] ./node_modules/html-webpack-plugin/lib/loader.js!./node_modules/html-
webpack-plugin/default_index.ejs 538 bytes {0} [built]
webpack: Compiled successfully.
C:\Users\lenovo\Desktop\React-Express-Blog-Demo\node_modules\http-proxy\lib\http
-proxy\index.js:119
throw err;
^

Error: connect ECONNREFUSED 127.0.0.1:3030
at Object._errnoException (util.js:1024:11)
at _exceptionWithHostPort (util.js:1046:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1182:14)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] watch-client: cross-env NODE_ENV=development node ./server/index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] watch-client script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\lenovo\AppData\Roaming\npm-cache_logs\2017-12-11T14_21_49
_855Z-debug.log

[email protected] start-dev-api C:\Users\lenovo\Desktop\React-Express-B
log-Demo
nodemon --watch server/api server/api/index.js

[nodemon] 1.12.5
[nodemon] to restart at any time, enter rs
[nodemon] watching: C:\Users\lenovo\Desktop\React-Express-Blog-Demo\server\api/*
/
[nodemon] starting node server/api/index.js
(node:16260) DeprecationWarning: open() is deprecated in mongoose >= 4.11.0, u
se openUri() instead, or set the useMongoClient option if using connect()
or createConnection(). See http://mongoosejs.com/docs/connections.html#use-mon
go-client
数据库连接成功
===> api server is running at 127.0.0.1:3030

登录时的warning

Warning: _renderNewRootComponent(): Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate. Check the render method of AppIndex.

@Nealyang 这个是因为loginFlow中使用了两次yield put吗

req.session.userInfo为undefined

博主你好请教一下,使用express-session设置了session,但是浏览器的application下的cookies仍然为空,req.session.userInfo为undefined。只有发送一个登陆请求到后端时,在对应的请求文件下才有cookies,但刷新后又会消失。希望博主指点一下

提问

能否说明下 生产环境的部署 thank you

about react ssr

你好,我想问下,涉及到react ssr的话,移动端如果有下拉刷新或者上拉加载的情况,react ssr可以怎么做?

webpack打包问题。

修改了webpack配置,增加了一个打包配置:、
"build": "cross-env NODE_ENV=production webpack --config webpack.prod.js"

然后执行 npm run build。报错如下

ERROR in ./app/index.js
Module build failed: ReferenceError: [BABEL] D:\yp\React-Blog-Demo\app\index.js: Unknown option: D:\yp\React-Blog-Demo.babelrc.env.production.preset. Check out http://babeljs.io/docs/usage/options/ for more information about options.

# A common cause of this error is the presence of a configuration options object without the corresponding preset name. Example:

Invalid:
{ presets: [{option: value}] }
Valid:
{ presets: [['presetName', {option: value}]] }

For more detailed information on preset configuration, please see http://babeljs.io/docs/plugins/#pluginpresets-options.
at Logger.error (D:\yp\React-Blog-Demo\node_modules\babel-core\lib\transformation\file\logger.js:41:11)
at OptionManager.mergeOptions (D:\yp\React-Blog-Demo\node_modules\babel-core\lib\transformation\file\options\option-manager.js:226:20)
at OptionManager.init (D:\yp\React-Blog-Demo\node_modules\babel-core\lib\transformation\file\options\option-manager.js:368:12)
at File.initOptions (D:\yp\React-Blog-Demo\node_modules\babel-core\lib\transformation\file\index.js:212:65)
at new File (D:\yp\React-Blog-Demo\node_modules\babel-core\lib\transformation\file\index.js:135:24)
at Pipeline.transform (D:\yp\React-Blog-Demo\node_modules\babel-core\lib\transformation\pipeline.js:46:16)
at transpile (D:\yp\React-Blog-Demo\node_modules\babel-loader\lib\index.js:50:20)
at Object.module.exports (D:\yp\React-Blog-Demo\node_modules\babel-loader\lib\index.js:173:20)
@ multi babel-polyfill ./app/index.js

运行报以下这个错误

非常感谢你可以开源,看你的代码。学习了好多东西呢。

./src/containers/home/components/login/LoginForm.js
Line 4: Import in body of module; reorder to top import/first

Search for the keywords to learn more about each error.

English Version

I found this is good, can i help you to make english version?

高并发下,token过期怎么处理?

你好,我通过你的项目自己写了一个博客,在里面新加了评论,token功能等,react+koa+mongodb+redis 个人技术博客

但是现在遇到了一个问题,就当你在高并发或者不断刷新时,会提示token已经使用过一次,请重新登录。我这边的规则是token使用了一次就不能再继续使用,所以会出现多个请求带着相同的token来请求,这就导致后面的请求可能会出现token已经使用了一次而需要重新登录的问题,目前解决的方案是把请求里带的token头以key存到redis里,但是还是有可能会出现redis里没有这个token的key,想问下还有没有其他的解决办法呢?

npm start 异常

F:\node_boke\React-Express-Blog-Demo\node_modules\http-proxy\lib\http-proxy\index.js:119
throw err;
^

Error: connect ECONNREFUSED 127.0.0.1:3030
at Object.exports._errnoException (util.js:1024:11)
at exports._exceptionWithHostPort (util.js:1047:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1150:14)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] watch-client: cross-env NODE_ENV=development node ./server/index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] watch-client script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\zhongtingbing\AppData\Roaming\npm-cache_logs\2017-12-01T01_16_44_581Z-debug.log

[email protected] start-dev-api F:\node_boke\React-Express-Blog-Demo
nodemon --watch server/api server/api/index.js

[nodemon] 1.12.1
[nodemon] to restart at any time, enter rs
[nodemon] watching: F:\node_boke\React-Express-Blog-Demo\server\api/**/*
[nodemon] starting node server/api/index.js
(node:5424) DeprecationWarning: open() is deprecated in mongoose >= 4.11.0, use openUri() instead, or set the useMongoClient option if using connect() or createConnection(). See http://mongoosejs.com/docs/connections.htm
l#use-mongo-client
数据库连接成功
===> api server is running at 127.0.0.1:3030

请问这怎么解决?

mac运行正常,windows下有问题是怎么回事啊

macbook是没问题的,windows下运行,前端页面出来了,但是请求数据有问题,数据库都确定正常运行了。

Error: connect ECONNREFUSED 127.0.0.1:3030
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] watch-client: cross-env NODE_ENV=development node server/index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] watch-client script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\koo\AppData\Roaming\npm-cache_logs\2019-07-04T01_51_30_650Z-debug.log

[email protected] start-dev-api E:\exersice\项目案例\React-Express-Blog-Demo-master
nodemon --watch server/api server/api/index.js

[nodemon] 1.17.5
[nodemon] to restart at any time, enter rs
[nodemon] watching: E:\exersice\项目案例\React-Express-Blog-Demo-master\server\api/**/*
[nodemon] starting node server/api/index.js
数据库连接成功
===> api server is running at localhost:3030

项目无法运行,报错如下,请问是什么原因呢?

F:\React-Express-Blog-Demo-master\node_modules_http-proxy@1.16.2@http-proxy\lib\http-proxy\index.js:119
throw err;
^

Error: connect ECONNREFUSED 127.0.0.1:3030
at Object._errnoException (util.js:1024:11)
at _exceptionWithHostPort (util.js:1046:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1182:14)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] watch-client: cross-env NODE_ENV=development node ./server/index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] watch-client script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache_logs\2017-12-09T13_01_36_981Z-debug.log

[email protected] start-dev-api F:\React-Express-Blog-Demo-master
nodemon --watch server/api server/api/index.js

[nodemon] 1.12.5
[nodemon] to restart at any time, enter rs
[nodemon] watching: F:\React-Express-Blog-Demo-master\server\api/**/*
[nodemon] starting node server/api/index.js
(node:21188) DeprecationWarning: open() is deprecated in mongoose >= 4.11.0, use openUri() instead, or set the useMongoClient option if using connect() or createConnection(). See http://mongoosejs.com/docs/con
nections.html#use-mongo-client
数据库连接成功
===> api server is running at 127.0.0.1:3030

散热严重

电脑只开了浏览器和vscode。Mac pro。开启服务后风扇开始疯狂旋转,散热也马上增加。关掉服务后正常了。怀疑是哪里有内存泄漏。

Cannot GET /

C:\Users\rever\Desktop\React-Express-Blog-Demo-master>npm start

[email protected] start C:\Users\rever\Desktop\React-Express-Blog-Demo-master
npm run watch-client & npm run start-dev-api

[email protected] watch-client C:\Users\rever\Desktop\React-Express-Blog-Demo-master
cross-env NODE_ENV=development node ./server/index.js

C:\Users\rever\Desktop\React-Express-Blog-Demo-master\app\index.js
clean-webpack-plugin: C:\Users\rever\Desktop\React-Express-Blog-Demo-master\build has been removed.
build [== ] 10%===>open http://127.0.0.1:3000 in a browser to view the app
build [======= ] 35%webpack: wait until bundle finished: /index.html
Build completed in 17.371s

webpack built 4901e96648c0ec792123 in 17374ms
Hash: 4901e96648c0ec792123
Version: webpack 3.10.0
Time: 17374ms
Asset Size Chunks Chunk Names
b2299473f5628502c981b5a381307646.png 9.25 kB [emitted]
cddb5f2e8bc3caa6d0596f66274d54d5.jpg 12.2 kB [emitted]
f26996dee7e34d4f043302efa66f184a.png 888 kB [emitted] [big]
8f0078d321fdb9ab666606bbe0a1d929.png 1.33 MB [emitted] [big]
d02fe8e3725c82dc54a287cf3b11039e.png 986 kB [emitted] [big]
c95d7b3c64e890326489e808d77d8941.jpg 38.4 kB [emitted]
90a6f773e5a34a9a0ad0818b98511dd7.jpeg 9.69 kB [emitted]
vendor-4901e966.js 9.17 MB 0 [emitted] [big] vendor
index-4901e966.js 732 kB 1 [emitted] [big] index
manifest-4901e966.js 31.2 kB 2 [emitted] manifest
index.html 329 bytes [emitted]
[2twT] ./app/index.js 1.59 kB {1} [built]
[3IRH] (webpack)/buildin/module.js 517 bytes {0} [built]
[3Sk7] ./node_modules/react-hot-loader/patch.js 40 bytes {0} [built]
[6cJI] ./node_modules/react-router-dom/es/Switch.js 131 bytes {0} [built]
[9uhF] ./node_modules/react-router-dom/es/StaticRouter.js 149 bytes {0} [built]
[F8kA] ./node_modules/react-router-dom/es/index.js 925 bytes {0} [built]
[O27J] ./node_modules/react-dom/index.js 59 bytes {0} [built]
[PGPo] ./node_modules/react-router-dom/es/Redirect.js 137 bytes {0} [built]
[R1Tp] (webpack)-hot-middleware/client.js?path=http://127.0.0.1:3000/__webpack_hmr 7.35 kB {0} [built]
[U7vG] ./node_modules/react/react.js 56 bytes {0} [built]
[j1ja] ./node_modules/babel-polyfill/lib/index.js 833 bytes {0} [built]
[tfLY] ./node_modules/react-router-dom/es/withRouter.js 143 bytes {0} [built]
[zkX4] ./node_modules/babel-polyfill/node_modules/regenerator-runtime/runtime.js 24.4 kB {0} [built]
[0] multi react-hot-loader/patch webpack-hot-middleware/client?path=http://127.0.0.1:3000/__webpack_hmr babel-polyfill ./app/index.js 64 bytes {1} [built]
[1] multi react react-dom react-router-dom 52 bytes {0} [built]
+ 1505 hidden modules
Child html-webpack-plugin for "index.html":
Asset Size Chunks Chunk Names
index.html 1.45 MB 0
[3IRH] (webpack)/buildin/module.js 517 bytes {0} [built]
[DuR2] (webpack)/buildin/global.js 509 bytes {0} [built]
[M4fF] ./node_modules/lodash/lodash.js 540 kB {0} [built]
[a/t9] ./node_modules/html-webpack-plugin/lib/loader.js!./node_modules/html-webpack-plugin/default_index.ejs 538 bytes {0} [built]
webpack: Compiled successfully.
C:\Users\rever\Desktop\React-Express-Blog-Demo-master\node_modules\http-proxy\lib\http-proxy\index.js:119
throw err;
^

Error: connect ECONNREFUSED 127.0.0.1:3030
at Object._errnoException (util.js:1024:11)
at _exceptionWithHostPort (util.js:1046:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1182:14)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] watch-client: cross-env NODE_ENV=development node ./server/index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] watch-client script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\rever\AppData\Roaming\npm-cache_logs\2017-12-17T14_11_57_370Z-debug.log

[email protected] start-dev-api C:\Users\rever\Desktop\React-Express-Blog-Demo-master
nodemon --watch server/api server/api/index.js

[nodemon] 1.13.3
[nodemon] to restart at any time, enter rs
[nodemon] watching: C:\Users\rever\Desktop\React-Express-Blog-Demo-master\server\api/**/*
[nodemon] starting node server/api/index.js
(node:6368) DeprecationWarning: open() is deprecated in mongoose >= 4.11.0, use openUri() instead, or set the useMongoClient option if using connect() or createConnection(). See http://mongoosejs.com/docs/connections.html#use-mongo-client
数据库连接成功
===> api server is running at 127.0.0.1:3030

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.