node.js - 请教关于Web多人协作编辑平台的后台设计?
PHPz
PHPz 2017-04-17 11:43:47
0
5
685

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

  • 要求支持Markdown语法。
  • 可以进行项目文档的管理
  • 分配人员进行文档某段的编辑。
  • 多人同时编辑同一文档的不同段落
  • 对性能要求不是非常高。
  • 有一定安全性要求。
  • 有一定可扩展性(未来可考虑支持LaTeX公式编辑,嵌入媒体等)。

我们想法是前端主要使用双页式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入门,对这类业务的后台设计不是十分清楚,希望有专业人士指点一下,任何上述疑问或相关的回答都可以,十分感谢。

PHPz
PHPz

学习是最好的投资!

reply all(5)
巴扎黑

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

巴扎黑

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

小葫芦

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

巴扎黑

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

阿神

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template