Coder Social home page Coder Social logo

essay's Introduction

Build Status Version License

演示站

Essay - 简约而不简单的博客系统

功能特性

  • 支持服务端渲染
  • PWA渐进式web应用
  • 轻量级Markdown编辑器
  • 支持标签、分类、搜索、单页、评论、邮件通知、草稿箱等功能

运行

启动数据库

首先安装MongoDB数据库和Node.js环境,然后启动数据库

# yourDBpath 表示你自定义的数据库目录,任意位置皆可
$ sudo mongod --dbpath yourDBpath

运行项目

$ git clone https://github.com/wmui/essay

$ cd essay

$ yarn # 

$ npm run dev # 访问 http://127.0.0.1:3025

注意: 不要用localhost访问,因为cookie的domain只支持了 127.0.0.1

配置说明

配置文件在server/config目录下,它涵盖了全局所有配置信息

module.exports = {
    mongodb: {
        host: '127.0.0.1',
        database: 'essay_dev',
        port: 27017,
        user: '',
        pass: '',
    },
    app: {
        domain: 'http://127.0.0.1:3025',
        siteName: 'Essay',
    },
    // 管理员信息,仅初始化一次
    admin: {
        user: 'admin',
        pass: '123456',
        email: '[email protected]',
    },
    // 如果要上线记得修改 secret,确保安全性
    jwt: {
        expiresIn: 365 * 86400,
        secret: 'essay',
    },
    // 如果要发送通知邮件,需要配置 SMTP 服务
    email: {
        host: 'smtp.qq.com',
        user: '[email protected]',
        pass: '',
    },
    // 如果需要支持 GitHub 登录,需要配置 clientID 和 secret
    github: {
        id: '9588f02db3f89d176f36',
        secret: '10f4f1daa81764664fafb2e50be2c6985ef139f8',
        scope: 'user',
    },
    // 如果需要支持自动化部署,需要配置服务器 IP,项目repo地址,服务器目录
    pm2: {
        host: '116.196.17.78',
        repo: '[email protected]:wmui/essay.git',
        path: '/root/essay',
    },
}

管理员默认登录邮箱:[email protected],默认密码:123456

线上部署

如果需要部署到线上,可以参考这里Node项目自动化部署

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

$ git clone https://github.com/wmui/essay

$ cd essay

$ yarn

$ npm run build

pm2 start npm --name "Essay" -- start # pm2 启动

交流圈

你在学习这个开源项目的过程中,遇到了任何问题,或是有好的建议,都欢迎加入下方的微信交流群(不仅限于技术交流哦)

开源协议

GPL-3.0

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.