Ma63d / kov-blog

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

Migration to Vue 2.0 #6

Open fizerkhan opened 7 years ago

fizerkhan commented 7 years ago

Is there any plan to migrate a Vue 1.x app to 2.0?

Ma63d commented 7 years ago

Recently I'm working on another Vue 2.0 project: leetcode-viewer. If you just need an Vue 2.0 example, leetcode-viewer and the demo may be a candidate. In view of the current works, it seems that it's not difficult to use Vue 2.0. So surely I will migrate this project to 2.0. But sorry to tell you that the migration won't be done recently for time reason.
The deadline of my master paper makes me mad. :sob: :sob:

fizerkhan commented 7 years ago

@Ma63d Thanks for the quick update. I understood your priorities. I will take a loot at leetcode-viewer

One small suggestion: If you have simple login management, it could not very useful in the current project.

Ma63d commented 7 years ago

@fizerkhan could not very useful?

fizerkhan commented 7 years ago

@Ma63d We are thinking to use this project for our internal docs, it will great if we have signup options. So everyone can login and update docs. Also if there is any support for english, that will be awesome.

fizerkhan commented 7 years ago

@Ma63d If you take this project in the direction of knowledge base docs instead of just blogs, that will be awesome since there are not much better knowledge base open source projects. But we have too many static blog tools.

Ma63d commented 7 years ago

I understand your needs. But the blog is created just for personal presentation. If I upgrade it to an multi-user blog, the total blog need to be fully changed and recreated, including the table of database, the backend logic and UI.

I've designed some functions based on my previous experience in writing blog posts to make the blog more conveniently used. For example, this blog admin is like a note app, which means you can write a note and whenever you think the content has substantial content and depth, publish it. So as far as i am concerned, the blog is convenient. If I change it to knowledge base docs, some functions must be off and the blog will get more difficult to use than now.

There are a lot of open-source multi-user blog projects, such as b2evolution, LifeType.More generic, wordpress, duraple both meet your need. And this one: koa blog. By the way, I think confluence is the best one for your internal docs and team collaboration.

fizerkhan commented 7 years ago

@Ma63d Yes you are correct. I agree with you. I also really love the concept of writing my blog just like a note. I might be wrong because I was thinking that it will be useful for other support docs purpose too.

Okay. Now lets focus on migration alone.

jsm1003 commented 7 years ago

@fizerkhan I recently wrote a multi-user blog based on vue2.1, https://github.com/ZinCode/vue-ssr-blog-client Currently the project is still under development, you can focus on this project, a few days later this project will be on the line,forgive me poor English level

fizerkhan commented 7 years ago

@ZinCode Thanks. For me too, English is the second language. Unfortunately I don't know Mandarin. However I will take a look at it.

Hellowor1d commented 7 years ago

BTW , Is there any plan to migrate a Koa 1.x app to 2.0? Wish all the best for your master paper @Ma63d

Ma63d commented 7 years ago

Thx @Hellowor1d . Migration of Koa 2.x is important but not difficult. The next version will both upgrade Vue, koa and use SSR.

sfyr111 commented 7 years ago

^^厉害了老铁,先star了,等你升级完毕,期待能给出攻略

Ma63d commented 7 years ago

@sfyr111 已经在抽空升级了,可以查看 v2 分支。server 端改动了一下,升级了 koa v2, 重新设计了一下代码逻辑,加入了评论功能,封装了 schema 层和加入了切面编程。前端也还在改。admin 部分的 vue v2改造还没完成。最近入职新的实习公司,忙成猪头,最近怕是没时间再改了,只能后续再加油。

目前的升级计划如下:

jixianu commented 7 years ago

token登录这我看你的代码,有个问题: 就是token在后台路由中写了一个router.get('/tokens/check',mw.verify_token,check); 这段代码没有看懂,作用是?验证token不是在前台请求头中,发到后台了么,这个是不是调试时拉下的?要不就是有作用没有看明白

Ma63d commented 7 years ago

@jixianu check 是单纯用来测试 [带了 token 的话是否能通过外部 mw.verify_token 的检查正确抵达业务逻辑],确实是单纯 debug 用的,因为上线之后也依然用这个接口进行测试了一下。所以就在 master 分支里保留了。最近升级 v2 分支时已经干掉了。

建议不要看 master 分支的代码,最开始写的时候,写的很急,几乎所有的逻辑都在 controller 层,model 层实则只是个输出 ORM 的摆设。业务报错、校验等逻辑都没有切分。controller层又重又乱。 v2 分支改善了这些问题。

但是 v2 分支最近只是改完了 server 部分和 一些 admin 部分,暂时停滞着。