Create & generate MVC project structure, with Express, Mongoose & Jade
npm install nutshellTo use Nutshell clean type, open a terminal, navigate to a directory where you have rights to create files, and type:
nutshell myapp -clean
This will create a Express application called myapp with MVC structure.
To use Nutshell generate type, open a terminal, navigate to a directory where you have rights to create files, and type:
nutshell myapp -generate
This will create a Express application called myapp with MVC structure and simple logic.
Any of the preceding commands created a folder in your working directory.
This directory has a number of auto-generated files and folders that make up the structure of a Express MVC application.
myapp
/controllers/index.js – for express routes;
/models/index.js – for ORM models (called Schemas in mongoose);
/public/css/style.css – style sheet document;
/public/js/script.js – client side JavaScript;
/public/img/ – for static image files;
/views/layout.jade – for view-templates;
server.js – node server;
Nutshell generate type adds simple logic to the previous structure, and create index.jade file in /views/.