nodefony-starter

Getting Started with Nodefony


Nodefony Installation : See more

( Nodefony installation documentation )
$ npm -g install nodefony

  $ nodefony

   _   _    ___    ____    _____   _____    ___    _   _  __   __
  | \ | |  / _ \  |  _ \  | ____| |  ___|  / _ \  | \ | | \ \ / /
  |  \| | | | | | | | | | |  _|   | |_    | | | | |  \| |  \ V /
  | |\  | | |_| | | |_| | | |___  |  _|   | |_| | | |\  |   | |
  |_| \_|  \___/  |____/  |_____| |_|      \___/  |_| \_|   |_|



   Version : 4.3.1 Platform : darwin Process : nodefony PID : 3520


   Tue Mar 26 2019 11:40:45 INFO nodefony : WELCOME NODEFONY CLI 4.3.1
   ?  Nodefony CLI :  (Use arrow keys)

   ❯ Create Nodefony Project

   PM2 Tools
   --------
   Help
   Quit

  ...

  $ cd myproject

  $ nodefony dev
        

Configuration system :

If you want change domain other than localhost or an other interface ip binding
Change and Add host name "mydomain.com" in your /etc/hosts :

$ sudo vim /etc/hosts

  ##
  # Host Database
  #
  ##

  #  LOOPBACK
  127.0.0.1       localhost mydomain.com

  #  OR LAN IP

  192.168.x.x	mydomain.com

  #  OR WAN IP

  209.x.x.x	mydomain.com
          

Configuration Framework : See more ( Nodefony Configurations documentation )

If you have change domain other than localhost or you want change http(s) port binding
Change in Location : ./config/config.js :

module.exports = {
  system: {
    domain: "mydomain.com",	 	// nodefony can listen only one domain ( no vhost )  /    [::1] for IPV6 only
    domainAlias: [	                // domainAlias string only regex  example .*\\.nodefony\\.com  ^nodefony\\.eu$ ^.*\\.nodefony\\.eu$
      "^www.mydomain.com$",
      "^192.168.x.x$"
    ],
    httpPort: 5151,
    httpsPort: 5152
  }
}
          

If you want listen all domains on all interfaces use 0.0.0.0
Change in Location : ./config/config.js :

module.exports = {
  system: {
    domain: "0.0.0.0",	 	// nodefony can listen only one domain ( no vhost )  /    [::1] for IPV6 only
    domainAlias: [              // domainAlias string only regex  example .*\\.nodefony\\.com  ^nodefony\\.eu$ ^.*\\.nodefony\\.eu$
      "^127.0.0.1$",
      "^localhost$"
    ],
    httpPort: 5151,
    httpsPort: 5152
  }
          

Running NODEFONY: See more ( RUN Nodefony documentation )

There are 3 methods to run NODEFONY framework

  • Run Appliation in DEVELOPEMENT mode nodefony dev
  • Run Appliation in PRE PRODUCTION mode with clusters nodefony preprod
  • Run Appliation in PRODUCTION PM2 MANAGEMENT mode nodefony prod see PM2
To check the good binding http(s) you can run nodefony in dev mode

# Run Appliation in DEVELOPEMENT mode

  $ nodefony dev

  # Run Appliation in DEVELOPEMENT mode  with debug

  $ nodefony -d dev
        

Console when you start nodefony in developement mode :

$ nodefony dev
                                                           _                 _
              _ __ ___    _   _   _ __    _ __    ___     (_)   ___    ___  | |_
             | '_ ` _ \  | | | | | '_ \  | '__|  / _ \    | |  / _ \  / __| | __|
             | | | | | | | |_| | | |_) | | |    | (_) |   | | |  __/ | (__  | |_
             |_| |_| |_|  \__, | | .__/  |_|     \___/   _/ |  \___|  \___|  \__|
                          |___/  |_|                    |__/

          Version : 1.0.0 Platform : darwin Process : myproject PID : 4794


      KERNEL SERVER Cluster : master Environment : dev Debug :false

 Tue Mar 26 2019 12:19:33 INFO KERNEL SERVER  : Find NPM Bundle Package : http-bundle in : /Users/cci/repository/myproject/node_modules/@nodefony/http-bundle/httpBundle.js
 Tue Mar 26 2019 12:19:33 INFO KERNEL SERVER  : Find NPM Bundle Package : framework-bundle in : /Users/cci/repository/myproject/node_modules/@nodefony/framework-bundle/frameworkBundle.js
 Tue Mar 26 2019 12:19:33 INFO KERNEL SERVER  : Find NPM Bundle Package : security-bundle in : /Users/cci/repository/myproject/node_modules/@nodefony/security-bundle/securityBundle.js
 Tue Mar 26 2019 12:19:33 INFO KERNEL SERVER  : Find NPM Bundle Package : sequelize-bundle in : /Users/cci/repository/myproject/node_modules/@nodefony/sequelize-bundle/sequelizeBundle.js
 Tue Mar 26 2019 12:19:33 INFO KERNEL SERVER  : Find NPM Bundle Package : realtime-bundle in : /Users/cci/repository/myproject/node_modules/@nodefony/realtime-bundle/realtimeBundle.js
 Tue Mar 26 2019 12:19:33 INFO KERNEL SERVER  : Find NPM Bundle Package : monitoring-bundle in : /Users/cci/repository/myproject/node_modules/@nodefony/monitoring-bundle/monitoringBundle.js
 Tue Mar 26 2019 12:19:33 INFO KERNEL SERVER  : Find NPM Bundle Package : unittests-bundle in : /Users/cci/repository/myproject/node_modules/@nodefony/unittests-bundle/unittestsBundle.js
 Tue Mar 26 2019 12:19:33 INFO KERNEL SERVER  : Find NPM Bundle Package : mail-bundle in : /Users/cci/repository/myproject/node_modules/@nodefony/mail-bundle/mailBundle.js
 Tue Mar 26 2019 12:19:34 INFO sequelize  :  REGISTER ENTITY : requests PROVIDE BUNDLE : sequelize
 Tue Mar 26 2019 12:19:34 INFO sequelize  :  REGISTER ENTITY : session PROVIDE BUNDLE : sequelize
 Tue Mar 26 2019 12:19:34 INFO sequelize  :  REGISTER ENTITY : user PROVIDE BUNDLE : sequelize
 Tue Mar 26 2019 12:19:34 INFO CONNECTION Sequelize nodefony : Connection been established successfully Type : sqlite Database : /app/Resources/databases/nodefony.db
 Tue Mar 26 2019 12:19:34 INFO sequelize  : ORM CONNECTORS LIST  :
┌────────────────────┬────────┬──────────────────────────────────────┬──────┐
│ ORM CONNECTOR NAME │ DRIVER │ NAME DATABASE                        │ HOST │
├────────────────────┼────────┼──────────────────────────────────────┼──────┤
│ nodefony           │ sqlite │ /app/Resources/databases/nodefony.db │      │
└────────────────────┴────────┴──────────────────────────────────────┴──────┘
 Tue Mar 26 2019 12:19:34 INFO SERVICE sockjs  :  Create sockjs server :   HTTPS
 Tue Mar 26 2019 12:19:34 INFO SERVICE MONITORING  : Create server MONITORING listen on Domain : 0.0.0.0 Port : 1318
 Tue Mar 26 2019 12:19:34 INFO SERVICE SERVER STATICS  : Server Static RootDir  ==> /Users/cci/repository/myproject/web
 Tue Mar 26 2019 12:19:34 INFO BUNDLE monitoring : ADD DEBUG BAR MONITORING
 Tue Mar 26 2019 12:19:35 INFO SERVICE WEBPACK  : WEBAPCK Compile Bundle app
 Tue Mar 26 2019 12:19:35 INFO SERVICE SERVER HTTP  : Listening on DOMAIN : http://0.0.0.0:5151
 Tue Mar 26 2019 12:19:35 INFO SERVICE SERVER WEBSOCKET  : Listening on DOMAIN : ws://0.0.0.0:5151
 Tue Mar 26 2019 12:19:35 INFO SERVICE SERVER HTTPS  : Listening on DOMAIN : https://0.0.0.0:5152
 Tue Mar 26 2019 12:19:35 INFO SERVICE SERVER WEBSOCKET SECURE  : Listening on DOMAIN : wss://0.0.0.0:5152
 Tue Mar 26 2019 12:19:35 INFO SERVICE SESSIONS  : CONTEXT default SEQUELIZE SESSIONS STORAGE  ==>  ORM COUNT SESSIONS : 0
 Tue Mar 26 2019 12:19:38 INFO SERVICE WEBPACK  : COMPILE SUCCESS BUNDLE : app webpack.config.js

        

ACCEES NODEFONY APPLICATION :

Access to App with URL : http://mydomain.com:5151