Skip to content

Commit 64c9e3f

Browse files
committed
init
0 parents  commit 64c9e3f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+33392
-0
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
end_of_line = lf
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

.eslintrc.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
module.exports = {
2+
3+
root: true,
4+
parser: 'babel-eslint',
5+
env: {
6+
browser: true,
7+
node: true
8+
},
9+
extends: '',
10+
// required to lint *.vue files
11+
plugins: [
12+
'html'
13+
],
14+
// add your custom rules here
15+
rules: {
16+
'space-before-function-paren': [
17+
0,
18+
{
19+
anonymous: 'always',
20+
named: 'never'
21+
}
22+
],
23+
'no-unused-vars': 0
24+
},
25+
globals: {}
26+
}

.gitignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# dependencies
2+
node_modules
3+
4+
# logs
5+
npm-debug.log
6+
7+
# Nuxt build
8+
.nuxt
9+
10+
# Nuxt generate
11+
dist
12+
13+
# pwa
14+
sw.*
15+
16+
# public
17+
public/*
18+
19+
NOTE.md
20+
21+
build
22+

.travis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
language: node_js
2+
node_js:
3+
- "8.9.1"
4+
install:
5+
- yarn
6+
script:
7+
- npm run build

.vscode/launch.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
// 使用 IntelliSense 了解相关属性。
3+
// 悬停以查看现有属性的描述。
4+
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "node",
9+
"request": "launch",
10+
"name": "Launch via NPM",
11+
"runtimeExecutable": "yarn",
12+
"runtimeArgs": [
13+
"server"
14+
],
15+
"restart": true
16+
}
17+
]
18+
}

README.en.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<a href="https://travis-ci.org/wmui/vueblog"><img src="https://travis-ci.org/wmui/vueblog.svg?branch=master" alt="Build Status"></a>
2+
<a href="https://github.com/wmui/vueblog"><img src="https://img.shields.io/badge/license-AGPL-blue.svg" alt="License"></a>
3+
4+
## VueBlog
5+
6+
[中文文档](https://github.com/wmui/vueblog/blob/master/README.md)
7+
8+
<div style="text-align:center;">
9+
<p><a href="https://www.86886.wang" target="_blank">Live Demo</a></p>
10+
</div>
11+
12+
VueBlog is a lightweight blog application
13+
14+
### Technology stack
15+
16+
- FrontEnd: Nuxt.js and Vuex
17+
- BackEnd: Mongoose and Koa
18+
19+
### Features
20+
21+
- Server Side Rendering.
22+
- Progressive Web App.
23+
- A lightweight markdown editor based on Vue.js.
24+
25+
### Build Setup
26+
27+
First install [MongoDB](https://www.mongodb.com/download-center?jmp=nav#community) and [Node.js](https://nodejs.org/en/)
28+
29+
``` bash
30+
# install dependencies
31+
npm install # or yarn
32+
33+
# serve in dev mode, with hot reload at http://127.0.0.1:3000
34+
npm run dev
35+
36+
# build for production
37+
npm run build
38+
39+
# serve in production mode
40+
npm start
41+
```
42+
43+
**Tips:** Useing `http://127.0.0.1:3000` replace `http://localhost:3000` visit your local project
44+
45+
### Global config
46+
47+
The config file is `/server/config/index.js`.
48+
49+
The default uername is `q` and password is `q`.
50+
51+
```javascript
52+
export default {
53+
user: {
54+
role: 'superAdmin',
55+
username: 'q',
56+
password: 'q',
57+
58+
nickname: 'VueBlog',
59+
motto: 'Never too old to learn',
60+
avatar: 'avatar.png'
61+
},
62+
jwt: {
63+
secret: 'vueblog'
64+
},
65+
mongodb: {
66+
host: '127.0.0.1',
67+
database: 'vueblog',
68+
port: 27017,
69+
username: '',
70+
password: ''
71+
},
72+
githubConfig: {
73+
githubClient: '',
74+
githubSecret: '',
75+
scope: 'user'
76+
},
77+
emailConfig: {
78+
user: '',
79+
pass: ''
80+
},
81+
app: {
82+
domain: '',
83+
host: '127.0.0.1',
84+
port: 3000,
85+
routerBaseApi: 'api'
86+
}
87+
}
88+
89+
```
90+
91+
### License
92+
93+
[GPL-3.0](https://choosealicense.com/licenses/gpl-3.0/)

README.md

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
2+
<a href="https://travis-ci.org/wmui/vueblog"><img src="https://travis-ci.org/wmui/vueblog.svg?branch=master" alt="Build Status"></a>
3+
<a href="https://github.com/wmui/vueblog"><img src="https://img.shields.io/badge/license-AGPL-blue.svg" alt="License"></a>
4+
5+
## VueBlog
6+
7+
[English Doc](https://github.com/wmui/vueblog/blob/master/README.en.md)
8+
9+
<div style="text-align:center;">
10+
<p><a href="https://www.86886.wang" target="_blank">演示站</a></p>
11+
</div>
12+
13+
VueBlog是一个轻量级的博客应用
14+
15+
### 技术栈
16+
17+
- 前端:Nuxt.js + Vuex
18+
- 后端: Mongoose + Koa
19+
20+
### 功能特性
21+
22+
- 支持服务端渲染
23+
- PWA渐进式web应用
24+
- 轻量级Markdown编辑器
25+
- 支持标签、归档、搜索草稿箱等功能
26+
27+
### 本地运行
28+
29+
安装[MongoDB](https://www.mongodb.com/download-center?jmp=nav#community)数据库和[Node.js](https://nodejs.org/en/)环境。
30+
31+
``` bash
32+
# install dependencies
33+
npm install # or yarn
34+
35+
# serve in dev mode, with hot reload at http://127.0.0.1:3000
36+
npm run dev
37+
38+
# build for production
39+
npm run build
40+
41+
# serve in production mode
42+
npm start
43+
```
44+
45+
**注意:** 不要使用`http://localhost:3000`访问,而是用`http://127.0.0.1:3000`
46+
47+
### 全局配置
48+
49+
全局配置文件`/server/config/index.js`
50+
51+
默认用户名:q,默认密码:q
52+
53+
```javascript
54+
export default {
55+
// 初始化管理员信息,后台可以修改
56+
user: {
57+
role: 'superAdmin',
58+
username: 'q',
59+
password: 'q',
60+
61+
nickname: 'VueBlog',
62+
motto: 'Never too old to learn',
63+
avatar: 'avatar.png'
64+
},
65+
jwt: {
66+
secret: 'vueblog'
67+
},
68+
// 数据库配置,默认即可
69+
mongodb: {
70+
host: '127.0.0.1',
71+
database: 'vueblog',
72+
port: 27017,
73+
username: '',
74+
password: ''
75+
},
76+
// 可选,评论功能需要配置github登录的密钥
77+
githubConfig: {
78+
githubClient: '',
79+
githubSecret: '',
80+
scope: 'user'
81+
},
82+
// 可选,评论通知的SMTP邮箱配置,目前只支持qq邮箱
83+
emailConfig: {
84+
user: '',
85+
pass: ''
86+
},
87+
app: {
88+
domain: '', // 可选,线上域名,比如https://www.86886.wang
89+
host: '127.0.0.1',
90+
port: 3000,
91+
routerBaseApi: 'api'
92+
}
93+
}
94+
```
95+
96+
### 线上部署
97+
98+
如果需要部署到线上看下效果,可以参考这里[Nuxt项目自动化部署手册](https://github.com/wmui/web-deploy)
99+
100+
如果感觉自动化部署太麻烦,可以简单部署上线
101+
102+
```bash
103+
# install dependencies
104+
npm install # or yarn
105+
106+
# build for production
107+
npm run build
108+
109+
# serve in production mode
110+
pm2 start npm --name "vueblog" -- start
111+
```
112+
113+
### 开源协议
114+
115+
[GPL-3.0](https://choosealicense.com/licenses/gpl-3.0/)

0 commit comments

Comments
 (0)