The NodeZA platform is an express application that uses handlebars for templating, MySQL as the main application database, Bookshelf.js ORM, and MongoDB for session storage. It has a custom plugin system responsible for displaying content snippets, the plugins are called
Some of the major dependencies are
mongoose. Please checkout the dependencies page for a complete list.
Clone this repo to your local machine and install dependencies.
git clone https://github.com/nodeza/nodeza.git &&
cd nodeza && npm install
Once all the dependencies are installed we need to setup our database and create tables.
npm run setup You will be prompted for your database information.
NodeZA is built on a MVC-like architecture. The main building blocks are
/ collections/ models/ controllers/ views/ widgets/ routes.js
The descriptions below are guidelines that have been used in the NodeZA project and should be followed as closely as possible.
Routes are the entry point to the application, they are responsible for routing and determine which
controller and method to call for each http request.
All routes are located in the
Controllers contain the logical parts that work as a glue between
models. They accept a request and response object, load data from a
collection, pass the data to a
view template and then render the
Each path base should have its own
controller, e.g, the route
/events should have a
All controllers are located in the
model is associated with a database table and its properties represent the table columns. The whole table is represented by the associated
collection - which is basically a group of the same
model name should be a singular and a
collection name should be the plural version.
models are located in the
models folder and
collections in the
widget is a special kind of module. It is self contained and is completely decoupled from other parts of the application.
A widget comprises of 3 files,
config.json contains the configuration.
template.hbs contains the handlebars template.
index.js is the main program file.
Create a new branch, make changes, commit and push branch.