A blog system based on Nuxt.js 🇨🇳
JavaScript Vue CSS
Clone or download
Latest commit fabecdc Aug 9, 2018
Permalink
Failed to load latest commit information.
assets/css fix tag css Jul 26, 2018
components fix rss and ui Jul 3, 2018
layouts modify page Jul 25, 2018
middleware smtp Jul 2, 2018
pages fix search Jul 25, 2018
plugins add comment template Jun 8, 2018
public gitignore Jul 2, 2018
server update editor Aug 9, 2018
static v2.3.0 Apr 17, 2018
store update editor Aug 9, 2018
.editorconfig init v2.2.0 Jan 24, 2018
.eslintrc.js update admin Apr 27, 2018
.gitignore github oauth Jul 3, 2018
.travis.yml update yarn.lock Jul 26, 2018
README.en.md travis Jul 26, 2018
README.md all Jul 12, 2018
backpack.config.js set production env Jan 29, 2018
ecosystem.config.js update editor Aug 9, 2018
favicon.ico v2.3.0 Apr 17, 2018
nuxt.config.js modify page Jul 25, 2018
package.json update editor Aug 9, 2018
start.js v2.3.0 Apr 17, 2018
yarn.lock update editor Aug 9, 2018

README.md

Build Status License

VueBlog

English Doc

VueBlog是一个轻量级的博客应用

技术栈

  • 前端:Nuxt.js + Vuex
  • 后端: Mongoose + Koa

功能特性

  • 支持服务端渲染
  • PWA渐进式web应用
  • 轻量级Markdown编辑器
  • 支持标签、归档、搜索草稿箱等功能

本地运行

安装MongoDB数据库和Node.js环境。

# install dependencies
npm install # or yarn

# serve in dev mode, with hot reload at http://127.0.0.1:3000
npm run dev

# build for production
npm run build

# serve in production mode
npm start

注意: 不要使用http://localhost:3000访问,而是用http://127.0.0.1:3000

全局配置

全局配置文件/server/config/index.js

默认用户名:q,默认密码:q

export default {
  // 初始化管理员信息,后台可以修改
  user: {
    role: 'superAdmin',
    username: 'q',
    password: 'q',
    email: 'qq22337383@gmail.com',
    nickname: 'VueBlog',
    motto: 'Never too old to learn',
    avatar: 'avatar.png'
  },
  jwt: {
    secret: 'vueblog'
  },
  // 数据库配置,默认即可
  mongodb: {
    host: '127.0.0.1',
    database: 'vueblog',
    port: 27017,
    username: '',
    password: ''
  },
  // 可选,评论功能需要配置github登录的密钥
  githubConfig: {
    githubClient: '',
    githubSecret: '',
    scope: 'user'
  },
  // 可选,评论通知的SMTP邮箱配置,目前只支持qq邮箱
  emailConfig: {
    user: '',
    pass: ''
  },
  app: {
    domain: '', // 可选,线上域名,比如https://www.86886.wang
    host: '127.0.0.1',
    port: 3000,
    routerBaseApi: 'api'
  }
}

线上部署

如果需要部署到线上看下效果,可以参考这里Nuxt项目自动化部署手册

如果感觉自动化部署太麻烦,可以简单部署上线

# install dependencies
npm install # or yarn

# build for production
npm run build

# serve in production mode
pm2 start npm --name "vueblog" -- start

开源协议

GPL-3.0