简体   繁体   中英

Building An Extendable Website With Nodejs

I am looking to build a website framework that has the ability to be highly extendable by plugins. The core website will include some global functions that can be made use of by various pages and such, but the idea is to allow plugins to really drive the overall website.

While the base core will be used to display some generic pages, I want to have plugins able to extend the site further with handling various things between full routes to overriding parts of the current cores pages.

The idea would be something like how Wordpress has plugins that allow complete control of how the site renders and looks as well as functionality and features.

A plugin, in this setup, would have the control of doing a lot of things such as:

  • Handling routes that are not defined in the core. (Or even overriding an existing route.)
    • Including being able to render pages that do not exist in the core already.
  • Added custom .css and .js files to pages.
  • Overriding existing data / templates.
  • Adding configurations that can be used and shared between other plugins.
  • And so on.

However, I'm not sure where to begin with doing something like this while using Node.js. Let alone where to look for examples of something similar.

With my core website, I would like to use a few specific modules such as:

  • express
  • vash (for the html engine)
  • passport (for authentication)
  • less-middleware (for handling .LESS based css files)

And from there allow plugins to do whatever they want.

I am looking for some suggestions on this idea, examples of existing implementations, etc. if there are any available.

I think that there are already similar websites/CMS's.

You will find pencilblue which allows to build own plugins and share them with others: https://pencilblue.org/ . This one looks pretty interesting and it has got plugins already build and they allow other to contribute to their project.

Here you've got a comparision of CMS's build on nodejs http://y-designs.com/blog/node-cms-comparison-2015/

I think it is a good place to start to see how other sorted out the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM