Skip to content

jefferscn/node-pluginframework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-pluginframework

An extension project of nodejs express framework.

Purpose

In developing a web application,there will be a mass of views,routes.With default usage of Express, everything is mixed together.This is not conducive to reuse and maintenance of code. This project will build a framework to build a Express with seperated modules(pluings). A module is made up with logic(routes),views and an init.js file.

Dependencies

  1. ServerSide
  • JugglingDB
  • Express
  • Underscore
  1. ClientSide
  • JQuery
  • Underscore

Usage

  • Do everything Express need.
  • Download this project as a nodejs module.And copy all the files to the root dir of Express.
  • Make database config,a config of jugglingdb,put everywhere of the project. just like below
 var Schema = require('jugglingdb').Schema;
 var schema = new Schema('mysql',{
   host:'1.1.2.191',
   	port:3306,
       username:'mysql',
     password:'mysql',
     database:'TEST'
 });

 module.exports = exports=schema;
  • Do some change in app.js
   var proto=require('underscore');
   var extApp = require('application');
   var app =new express();

   app.set('db', path.join(__dirname, 'model/db'));
   ...
   app.use(express.cookieParser());
   app.use(express.session({ secret: "pluginframework" ,cookie:{maxAge:5*60*60*1000}}));
   ...
   app.initPluginSystem(function(){
   
   });
   ...

Test

There are several plugins in this project.After server started,u can visit host/site/pluginlistpage to list all the serverside plugins.

Plugin Description

account

A plugin provide simple security service.

  • data
    • user
  • view
    • site/loginpage
    • site/usermanager
    • widget/loginform
    • widget/logininfo
    • widget/loginout

defaultwebframe

A plugin provide the web frame,include the main page of website. This plugin just set the defaultLayout of application.

pluginMgr

A plugin provide maintance of the server plugins.

  • view
  • /site/pluginlistpage
  • /site/plugindetailpage
  • /widget/pluginlist
  • /widget/plugindetail

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published