search

Home  >  Q&A  >  body text

node.js - 请教关于Web多人协作编辑平台的后台设计?

现在我们学生小团队需要开发一个基于Web的在线协作平台,主要是进行文档的协作编辑。大概的需求是这样的:

我们想法是前端主要使用双页式Markdown编辑页面(理想目标Cmd Markdown 编辑阅读器https://www.zybuluo.com/mdeditor),静态页面为主,主要以通过Ajax进行前后端交互。

服务端最初考虑是使用Node.jsExpress框架进行后端开发(说明一下,应该部署会在UNIX/Linux系服务器,所以ASP可能不太行,之所以选择Node.js是因为了解Node.js对非阻塞IO效率较高,也想为了多深入掌握一门后台语言),采取服务端对前端传来Markdown解析然后发送HTML到前端,存储文档最初打算写入数据库。

现在主要的困惑是:

  1. 采用Node.js开发是否合适?实际这类应用(尤其是Google Doc,Office Online这种大型实际项目)主要是通过什么样的前后台设计?
  2. 如果只存储文档的话,采取文件存储+缓存服务器和采取数据库+缓存服务器那种比较合适?是否可以采取NoSQL?
  3. 文档存放在数据库的话,应该如何设计比较优?因为编辑时是分段分配任务,能否直接对文档分段存储再进行合并?
  4. 安全性方面,这种协作平台如何有效防止CSRF攻击?
  5. 是否有现成的开源类似项目参考(绝不是抄袭哦)?

本人也只刚学了一点Web入门,对这类业务的后台设计不是十分清楚,希望有专业人士指点一下,任何上述疑问或相关的回答都可以,十分感谢。

PHPzPHPz2796 days ago694

reply all(5)I'll reply

  • 巴扎黑

    巴扎黑2017-04-17 11:45:47

    I recommend learning to use Meteor

    The learning cost is much faster than learning Node.js + Express

    Development is not very fast.
    There are more than 20,000 stars on github. There are not many open source projects with more than this number

    For your needs:
    1. Simultaneous editing: Meteor is a real-time framework. That is to say, if one person edits a place, other people’s terminals will change at the same time, and there is no need to refresh the browser at all
    2. Support markdown: markdown package in meteor - Markdown-to-HTML processor
    3. Meteor is built based on node.js + mongodb
    4. Meteor can be easily deployed to Linux systems with one click
    5. There are no open source projects directly related to multi-person collaborative document editing. But you can experience Telescope, an open source project of Meteor
    6. There is another very special thing. With a few simple commands, you can generate a hybrid application app that supports both ios and android

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 11:45:47

    It is recommended to take a look at this open source library, which should be able to perfectly solve your problem https://github.com/ether/etherpad-lite

    reply
    0
  • 高洛峰

    高洛峰2017-04-17 11:45:47

    Meteor is good, but the database currently only supports mongodb.
    You can also take a look at firebase https://www.firebase.com/

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 11:45:47

    Use git. I recommend gogs, a project written in Go. It is easy to deploy. A binary file is fine

    reply
    0
  • 阿神

    阿神2017-04-17 11:45:47

    It is recommended to take a look at the implementation mechanism of TeaKKi https://teakki.com etherpad

    reply
    0
  • Cancelreply