https://github.com/hancoson/node-blog-app
:globe_with_meridians: A node+espress+mongoose+react+nextjs blog
https://github.com/hancoson/node-blog-app
blog express fetch mongoose nextjs node react
Last synced: over 1 year ago
JSON representation
:globe_with_meridians: A node+espress+mongoose+react+nextjs blog
- Host: GitHub
- URL: https://github.com/hancoson/node-blog-app
- Owner: Hancoson
- License: apache-2.0
- Created: 2017-10-13T09:12:04.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2019-01-15T11:59:50.000Z (over 7 years ago)
- Last Synced: 2025-04-02T00:34:44.585Z (over 1 year ago)
- Topics: blog, express, fetch, mongoose, nextjs, node, react
- Language: JavaScript
- Homepage: http://www.vsoui.com/2018/05/18/ejs-to-nextjs/
- Size: 776 KB
- Stars: 12
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# node-app
[](https://github.com/Hancoson/node-app/blob/master/LICENSE)
[](https://github.com/Hancoson/node-blog-app)
[](https://github.com/Hancoson/node-blog-app)
This is a demo application that integrates node.js, express, mongoose React and Nextjs to develop a simple blog application.
## 介绍
该项目通过使用 Nextjs 技术,实现了 React 同构方案。采用 Nodejs 搭建服务,结合 Mongoose 数据库,实现了一个简单的博客系统。
也可以参考项目 [v1.0 版本通过 Ejs 模版](https://github.com/Hancoson/node-blog-app/tree/ejs-tpl)的实现,[相关文章>>](http://www.vsoui.com/2017/10/19/node-blog-demo/)。
### 技术实现
- [x] Node > 8.x
- [x] Express
- [x] mongoose
- [x] react > 16.x
- [x] Nextjs
- [x] sass
- [x] isomorphic-unfetch
### 目录结构
```sh
├─server # 服务
│ ├─controllers # 控制器
│ ├─dto #
│ ├─models # 模型
│ ├─routes # 路由
│ └─service
├─pages # 页面
│ ├─…… #
│ └─index.js # 主页面
├─compontents # 组件
│ └─#……
├─config # 配置文件
│ └─#……
├─assets # 静态资源
│ └─#……
├─build # 发布目录
│ └─ #……
├─next.config.js # next配置文件
├─package.json
├─postcss.config.js # postcss配置
├─server.js # 服务入口文件
└─.babelrc
```
## 如何使用
主要针对我当前的项目>> [node-blog-app](https://github.com/Hancoson/node-blog-app) 来说说使用方法:
### Install
```sh
git clone https://github.com/Hancoson/node-blog-app.git
# and
yarn
```
### Install mongodb
```sh
brew install mongodb
```
### Start Mongo
```sh
mongod
# or
brew services start mongodb
```
最后执行:
```sh
mongo
```
### Create a datebase
```sh
use {nodeApp}
```
### Start App
```sh
npm run dev #(start dev)
npm run build #(构建)
npm start #(启动项目)
```