Coder Social home page Coder Social logo

ma63d / kov-blog Goto Github PK

View Code? Open in Web Editor NEW
636.0 31.0 103.0 857 KB

A blog platform built with koa,vue and mongoose. 使用 koa ,vue 和 mongo 搭建的博客页面和支持markdown语法的博客编写平台,自动保存草稿。博客地址:https://chuckliu.me

License: MIT License

JavaScript 51.92% HTML 0.42% Vue 30.61% CSS 17.05%
vue koa mongo mongoose vuex vue-router webpack simplemde highlight

kov-blog's Introduction

kov-blog

v2版本正在开发当中...

a blog platform built with vue, koa and mongo. 使用vue,koa和mongo搭建的博客页面和markdown语法的博客编写平台,自动保存草稿。

博客预览地址:https://chuckliu.me 博客 后台

kov-blog 使用了vuevuexkoamongo等框架和技术。前后端分离,restful架构。项目主要包含三个文件夹和项目:

  • server 后台 包含了所有的后台服务,为博客和博客管理提供后台接口
  • client 前端 博客的前端呈现,被vue洗脑严重,界面模仿了vue官方博客,评论系统用的是多说(但是多说很不稳定...而且已经很久无人维护..)
  • admin 前端 博客管理平台的前端,功能上类似于带发布博客功能的印象笔记,markdown语法,预览和编写同步进行,带有自动保存功能,书写的文章只有在发布之后才会同步当前内容到博客client页面上,也完全可以当做一个笔记类应用去用,这样做的目的是出于有的时候在写文章a的时候,觉得某一部分的内容过于复杂,可以另外开一篇文章b来仔细讲解下,但是等我写完a就忘了,因为以往的博客cms比如hexo,wordpress之类都是直接发布的.而且这样做了之后博客也好用多了,我经常在码代码的时候遇到一些问题,这样可以直接打开博客后台,开一篇文章记录一下遇到的问题,但是不发布出去,提醒自己需要整理一篇相关内容的文章.以后一登这个管理系统就可以看到了这篇没有没有发布过的文章,就可以整理这篇文章,等到写完之后发布出去就可以了.

使用了许多es6新特性,请使用6.0以上版本的node!

使用之前请先确保已经安装mongo!

如果要使用评论系统,请先注册多说,修改/client/src/Blog.vue中的多说二级域名为您自己的多说二级域名

server

基于restful,nodejs的话采用koa框架(koa 1),数据库用了mongo。登录这块的话用了jwt.

生产环境下可在可在server/configs目录下增加private.js文件,增加私有配置.

因为使用了许多es6/7 新语法,所以请使用6.x版本node

npm command

# install dependencies
npm install

# 开发
# 带热重载,跑在本地3000端口
npm run dev-server

# 部署
npm run build-server


client

博客呈现页面,基于vue(1.0),前后端通信用的fetch,评论系统用的是多说,界面模仿了vue博客,大量使用了其样式效果,还有很多要完善的地方。

技术栈

  1. Vue && vue-router
  2. fetch
  3. stylus
  4. marked && highlight

npm command

# install dependencies
npm install

# 开发,跑在本地8080端口
npm run dev-client

# 打包
npm run build-client


admin

初始用户名:admin,初始密码:password

博客管理系统,也是前后端完全分离的。功能上类似于印象笔记,实时保存你的文章,当你觉得写好了之后可以发布文章,每次发布都会把文章同步更新到博客上,这样在client端就能看到。采用markdown语法,编辑器采用的是SimpleMDE,支持大量快捷键。

快捷键 Action
Cmd-' "toggleBlockquote"
Cmd-B "toggleBold"
Cmd-E "cleanBlock"
Cmd-H "toggleHeadingSmaller"
Cmd-I "toggleItalic"
Cmd-K "drawLink"
Cmd-L "toggleUnorderedList"
Cmd-P "togglePreview"
Cmd-Alt-C "toggleCodeBlock"
Cmd-Alt-I "drawImage"
Cmd-Alt-L "toggleOrderedList"
Shift-Cmd-H "toggleHeadingBigger"
F9 "toggleSideBySide"
F11 "toggleFullScreen"

技术栈

  1. Vue && vuex && vue-router
  2. fetch
  3. stylus
  4. SimpleMDE && marked && highlight

npm command

# install dependencies
npm install

# 开发,跑在本地8081端口
npm run dev-admin

# 打包
npm run build-admin

kov-blog's People

Contributors

ma63d avatar studentwan 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  avatar  avatar  avatar

kov-blog's Issues

关于kov-blog的UI设计

学长好。
我看了您的个人blog项目觉得很喜欢,也很适合作为练手项目,于是准备自己实现一个blog,做到UI设计这一块有点懵,不知道该怎么去设计这个应用...不知道学长在完成kov-blog的UI设计时有什么心得可以分享吗?
如果有的话就太感谢啦!

加入"文章目录"和“回到顶部”的功能

最近写博客时发现写总结性的博客时容易写的很长,一篇文章可以写到10多个滚屏的长度,所以这个时候,文章目录就很重要了,所以需要引入文章目录的功能和回到顶部,类似segmentfault文章里面这样:

博客访问不了

遇到一个 Vue.nextTick() 的问题,之前看过博主的博客,再进去发现进不去了...

npm run build-server/build-client都报错

node v6.7.0

//build-admin
ERROR in static/js/app.af71319f3e1e7f76edc9.js from UglifyJs
SyntaxError: Unexpected token: string (./stylus/index.styl) [./admin/src/main.js:4,7]

//build-client
ERROR in static/js/app.7e4e7537efdd6fc28a97.js from UglifyJs
SyntaxError: Unexpected token: name (Vue) [./client/src/main.js:1,7]

打开新的文章,焦点会跳转到文章中间部分

每次从博文链接中打开一篇新文章,焦点就会自动跳转到文章中间部分,如果刷新一遍,就会跳转到头部。我看了一下,貌似链接里面也没有id的定位,不知道这是一个BUG还是你故意的设计?

login error on linux (mongodb has started )

system: linuxmint
db: sudo service mongod start //(has started)
when I click the button to login:

TypeError: Failed to fetch
Uncaught (in promise) TypeError: Cannot read property 'error' of undefined
at eval (eval at (app.js:1341), :39:46)

I'm new to vuex ,dont know what caused the err
_039

请教各位vue大神们,如何在router-view上监听transition的结束(vue1.x版本)

我在router-view上加了transition,因此当路由切换时,组件在enter和leave时会有一个过渡动画存在,我现在某一个路由对应的组件里面我需要知道当前的transition是否结束了,所以问题来了,我如何让我的这个组件知道我的transition结束了,因为我有一些组件需要在组件的元素加载到dom里面之后才能正确执行(比如目录组件,我需要知道页面有哪些h1,h2,h3,然后生成目录,再比如多说)。

假如说我这个需要知道transition结束的组件对应的路由是/foo/:id

当路由切换的时候,比如是从/bar进入/foo/:id时,倒是比较好监听,利用transition的afterEnter钩子,我可以监听到router-view上的动画结束,于是我可以在包裹router-view的父组件上绑定这个afterEnter钩子,在这个钩子里$dispatch一个事件,去告诉/foo/:id对应的组件“transition结束啦,该干嘛干嘛去”。

可是现在有个问题是,当浏览器打开的就是这个组件的路由地址/foo时,也就是浏览器打开进入的就是这个路由时,没有路由切换过程,这个时候并不会有transition,自然不会有transition的钩子执行,所以我想着要不就先在包裹router-view的父组件上的ready事件里$dispatch一次,可是发现父组件$dispatch时,/foo对应的组件还没有加载好,因此他没能成功监听到父组件的$dispatch。

而且如果是/foo/:id这种路由里面只是id变化时,因为是同一个组件,也是没有transition的,所以问题变得很复杂。

目前我增加了许多逻辑用来判断是否是直接进入的/foo/:id的和以及从其他不同id的/foo/:id转过来的
,这种写法感觉很hack,也很复杂,感觉增加许多不必要的代码,请问大家有比较好的解决办法吗?

目录按钮不起作用

我的环境是node v7.4.0,fedora 24 x86_64 workstation,chrome浏览,未做任何改动,直接运行。
目录按钮点击没反应,查看源码为空的div,尝试切换到刚刚提交回到顶部和目录的commit仍一样的表现。
内容写作使用#作为标题标记,是我哪里用错了吗?谢谢。

老哥,方便分享一下你的nginx的配置文件吗?

我现在正在想把自己的项目部署到nginx服务器上,但是有一个问题,在单页应用的某个页面重新刷新一下页面,nginx会返回404,肯定是配置没配好,刚开始用nginx,想瞅瞅你的nginx配置是怎么弄的

本地后台无法访问

输入用户名和密码后,点击登录无反应!

已完成# install dependencies
npm install

开发,跑在本地8081端口

npm run dev-admin

访问localhost:8081

dev-server这个分支起不来,

报错,主要是const,let 的使用

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:404:25)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (/study/kov-blog/server/controllers/token.js:8:8)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (/study/kov-blog/server/controllers/index.js:4:15)
    at Module._compile (module.js:425:26)
Program node --harmony server/index.js exited with code 1

Starting child process with 'node --harmony server/index.js'

我的node环境是 : v5.1.1,
你在本地跑,这个可以不,除了这个项目,剩下的两个我可以跑起来

没有开源协议

你好:
首先感谢你开源的项目,我目前基于这个项目在做自己的在线学习网站,你的项目现在没有选择任何开源协议,请问我该怎样处理版权问题?近期是否有添加开源协议的计划?谢谢。

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.