Skip to content

rajathavalam/express-mvc-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation



This project's version is no longer actively supported and not recommended for use. It is made available as read-only.

Please check the official website for express application generator https://expressjs.com/en/starter/generator.html



Express Logo

Express' Model View Controller Application Generator.

NPM Version NPM Downloads

Installation

$ npm install express-mvc-generator -g 

##Display the command options with the -h option:

 express -h

  Usage: express [options] [dir]

  Options:

    -h, --help          output usage information
    -V, --version       output the version number
    -e, --ejs           add ejs engine support (defaults to EJS)
        --hbs           add handlebars engine support
    -H, --hogan         add hogan.js engine support
    -c, --css <engine>  add stylesheet <engine> support (less|stylus|compass|sass) (defaults to plain css)
        --git           add .gitignore
    -f, --force         force on non-empty directory

For example, the following creates an Express app named myapp in the current working directory:

express myapp:

$ express myapp


   create : myapp
   create : myapp/public/js/script.js
   create : myapp/package.json
   create : myapp/app.js
   create : myapp/public
   create : myapp/public/js
   create : myapp/public/img
   create : myapp/public/css
   create : myapp/public/css/style.css
   create : myapp/config
   create : myapp/config/routes.js
   create : myapp/config/constants.js
   create : myapp/config/database.js
   create : myapp/config/passport.js
   create : myapp/app/views
   create : myapp/app/views/login.ejs
   create : myapp/app/views/signup.ejs
   create : myapp/app/views/index.ejs
   create : myapp/app/views/index.ejs
   create : myapp/app/views/error.ejs
   create : myapp/app/views/404.html
   create : myapp/app/controllers
   create : myapp/app/controllers/home.js

   install dependencies:
     $ cd myapp && npm install

   run the app:
     $ DEBUG=myapp:* node app or nodemon app 

   create : myapp/app/models
   create : myapp/app/models/home.js
   create : myapp/lib
   create : myapp/lib/email.js

Install dependencies:

$ npm install

###File Structure

$ express myapp


myapp
|
|
|____app
|      |____controllers
|      |    |____home.js
|      |
|      |____models
|      |     |___home.js
|      |
|      |____views
|           |___404.ejs
| 	    |___error.ejs
|           |___index.ejs
|           |___login.ejs
|           |___signup.ejs
|	
|
|_____config
|     |___auth.js
|     |___constants.js
|     |___database.js
|     |___passport.js
|     |___routes.js
|
|
|____lib
|    |___email.js
|
|____node_modules
|
|
|____public.js
|    |____css
|    |    |__style.css
|    |    
|    |____js
|    |    |__script.js
|    |
|    |____img
|    |    |__img.jpg
|    |
|    |
|    |____uploads
|         |__img.jpg
|      
|   
|
|_____app.js
|
|
|
|_____package.json

###Important Settings

  1. Open your config/database.js , Please configure your mongo db.
  2. Open your config/constants.js , Please configure your constants(SMTP ....).
  3. Do you want use SMTP ,Please uncomment passport.js line 95 to 98

Run The express-mvc-generator Application

$ node app or nodemon app 
Demo URL's

Signup : http://localhost:8042/signup
Login :  http://localhost:8042/login

Command Line Options

This generator can also be further configured with the following command line flags.

-h, --help          output usage information
-V, --version       output the version number
-e, --ejs           add ejs engine support (defaults to jade)
    --hbs           add handlebars engine support
    --jade          add jade engine support
-H, --hogan         add hogan.js engine support
-c, --css <engine>  add stylesheet <engine> support (less|stylus|compass|sass) (defaults to plain css)
    --git           add .gitignore
-f, --force         force on non-empty directory

Features

  • Very Good file structure MVC style Express.
  • Already We Given Examples of Controller and Model(Mongoose) , Passport and Config Settings
  • Pre Installed Important and Most Used NPM Packages , and used Example
  • We Given Simple And Well understanding Express MVC Example
  • We already included most used and important npm modules like as pm2 ,async, body-parse, sessions, flash, cookie, dateformat, mongoose, nodemailer , nodemon, passport
  • Support View engines:
    • Jade
    • Handlebars
    • Swig
    • EJS
    • Marko
    • Nunjucks
  • Supported CSS pre-processors
    • SASS (both node-sass and ruby sass)
    • LESS
    • Stylus
  • Supported Databases (with MVC structure):
  • MongoDB
  • MySQL
  • PostgreSQL
  • RethinkDB
  • SQLite

Help/Assistance

Email Us : rajaram.tavalam@gmail.com

License

MIT