rajathavalam / express-mvc-generator

Express' Model View Controller Application Generator.
https://github.com/rajathavalam/express-mvc-generator
MIT License
42 stars 14 forks source link
database express-js express-mvc expressjs generator mongoose mvc-structure node node-js nodejs npm-module npm-package sass


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

Help/Assistance

Email Us : rajaram.tavalam@gmail.com

License

MIT