Git Product home page Git Product logo

blog's Introduction

Blog

前言

blog参考:https://github.com/erikras/react-redux-universal-hot-example
app版:https://github.com/mhbseal/blog-react-native

后端:express + co + mongoose + ...
前端:react + redux + react-router + ...
~~线上地址:http://mhbseal.com~~~
app线上下载地址:https://pan.baidu.com/s/1skP4nu9

准备

安装 nodejs(>=4) 和 mongodb(且启动)

运行

git clone https://github.com/mhbseal/blog.git  // 仓库
// 后端be
cd be && npm install  // 安装
npm start  // 启动
npm run start.noauth  // 启动(初次运行,用此免登陆模式)
// 前端fe
cd fe && npm install  // 安装(可能有点慢)
npm run build.dev // 打包客户端JS
npm start  // 启动

说明

1.访问地址

http://localhost:3004  // 前台地址
http://localhost:3004/admin  // 后台地址

2.几个config文件

/be/config/  //后端配置文件(数据库、session、host、port等)
/fe/src/config/  // 前端配置文件(后台访问目录路径、host、port等)

待优化、已知Bug

1.abort请求
2.immaculate.js的引入

更新日志

0.6.0(2017-02-13)
适配blog的react-native版

0.5.0(2016-09-28)
基于工程,前后端代码彻底分离,升级react,babel及其相应pkg。

1.blog前后端代码彻底分离fe/be
2.apiServer接口格式优化
3.serverLogs优化
4.react->15+,babel->6+,node->6.4+,other->last
5.增加文章点赞功能
6.增加请求时loading动画、失败时toast提示
7.优化文章留言
8.修改后台用户列表bug
9.其他bug修改、功能优化

0.4.0(2015-12-03)
服务一分为2(apiServer + renderServer),基于react + redux + react-router,对renderServer实现前后端同构,首次加载走服务端,脚本加载后走客户端。

1.整体代码架构优化
2.前后端同构

0.3.0(2015-08-07)
基于express + co + mongoose,又重写了blog(代码量不是很大),并对代码结构进行了优化,why?see 0.2.0

1.后台免登陆
2.blog说明

0.2.0(2015-06-09)
基于koa + mongoose,重写了blog,新增了n多功能,并优化了代码,换的目的是体验一下TJ大神的co,用起来确实很nice,但是目前看来和express相比,koa不是很活跃,另外middleware这块...

1.后台权限
2.文章分类自定义
3.文章搜索
4.文章留言
5.单页面
6.SEO
7.后台地址自定义
8.标签云
9.友情链接

0.1.0(2013-10-15)
基于express + mongoose,最简单文章发布系统。

1.文章发布
2.文章分类
3.后台管理

blog's People

Contributors

fsy0718 avatar mhbseal 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

blog's Issues

react界面修改后,无法马上看到效果更新

fe/src/containers/admin/ArticleList.js 中 添加一列“来源” 标题来源作者 。 发现网站上刷新后,“来源”闪了下又回到原来的版本,修改没有生效。 重新启动 npm start 修改还是没有生效,npm run build.dev后,再 npm start 修改就生效了。 不知道您那边是不是也有这个问题?

npm run dev.noauth 后访问不了后台

你好:
根据readme里边的步骤 最后一步开了npm run dev.noauth 后访问http://localhost:3004/admin,提示localhost 拒绝了我们的连接请求。我看mongodb 那边应该是也是运行了的,因为运行npm run dev.noauth的时候有连接的提示:[initandlisten] connection accepted from 127.0.0.1:51482 #2 (1 connection now open)。
控制台并没有报任何错误

OS: win10
node:v4.3.0

期待您的回答

跑不起来,报错

[piping] can't execute file: /Users/baidu/source/react/blog/bin/renderServer.js
[piping] error given was: Error: Cannot find module 'invariant'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function._module3.default._resolveFilename (/Users/baidu/source/react/blog/node_modules/webpack-isomorphic-tools/node_modules/require-hacker/babel-transpiled-modules/require hacker.js:403:34)
    at Function.module._load (/Users/baidu/source/react/blog/node_modules/piping/lib/launcher.js:24:23)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)

can't execute file: /root/blog/bin/renderServer.js

npm -v ->3.9.5
node -v -> v6.2.2

[piping] can't execute file: /root/blog/bin/renderServer.js
[piping] error given was: Error: imports[1] for react-transform-catch-errors does not look like a React component.
    at catchErrors (/root/blog/node_modules/react-transform-catch-errors/lib/index.js:26:11)
    at Object.<anonymous> (/root/blog/fe/src/helpers/Html.js:4:47)
    at Module._compile (module.js:541:32)
    at normalLoader (/root/blog/node_modules/babel-core/lib/api/register/node.js:199:5)
    at Object.require.extensions.(anonymous function) [as .js] (/root/blog/node_modules/babel-core/lib/api/register/node.js:216:7)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Module._load (module.js:409:3)
    at Function.module._load (/root/blog/node_modules/piping/lib/launcher.js:32:16)
    at Module.require (module.js:468:17)
[piping] further repeats of this error will be suppressed...
Hash: 88ce4cd8fb0aa6194a55
Version: webpack 1.13.1
Time: 24863ms

初始化数据

请问下,没有初始化数据吗?没见这块的说明,好像也没找着。。。

blog/fe/src/containers/Article.js中的组件事件为什么都要bind一下

Hi, 我看到在文件blog/fe/src/containers/Article.js中的第78行

this.handleReply.bind(this, comment.user && comment.user.name || comment.admin && comment.admin.name)

这里为什么要bind一下,react0.4以后的版本不是就可以autobind了吗?
我试了一下改成普通的,那么在handleReply方法体里this就是一个null。

我想问一下这里为什么要这样写,是因为用了react-redux造成的吗?

求解释,十分感谢!

babel-register冲突

npm run dev

require('babel-register')(babelConfig) 下
全局引用的是babel5,直接安装babel-register,冲突
使用require('babel-core/register') 会报异常
Error: bind EADDRINUSE null:3004

启动失败-。-

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.