Getting Started with Nodefony


NODEFONY INSTALLATION : See more ( Nodefony installation documentation )

$ npm -g install nodefony

$ nodefony create myproject

$ 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.yml :

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$"
  domainCheck                   : true
  httpPort                      : 5151
  httpsPort                     : 5152
	

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

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$
  domainCheck                   : false
  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 : 26213


      KERNEL SERVER Cluster : master Environment : dev Debug :false

 Thu Sep 13 2018 15:05:50 WARNING BUNDLE unittests : Bundle unittests controller directory not found
 Thu Sep 13 2018 15:05:50 WARNING SERVICE ROUTER : ROUTE HAS SAME NAME : documentation path : /documentation controller : demo:demo:readme
 Thu Sep 13 2018 15:05:50 WARNING BUNDLE app :  OVERRIDING  CONFIG bundle  : mongo BUT BUNDLE mongo NOT YET REGISTERED
 Thu Sep 13 2018 15:05:50 INFO nodefony : INSTALL ASSETS LINK IN WEB PUBLIC DIRECTORY  : /Users/cci/repository/myproject/web
 Thu Sep 13 2018 15:05:51 INFO sequelize  :  REGISTER ENTITY : requests PROVIDE BUNDLE : sequelize
 Thu Sep 13 2018 15:05:51 INFO sequelize  :  REGISTER ENTITY : session PROVIDE BUNDLE : sequelize
 Thu Sep 13 2018 15:05:51 INFO sequelize  :  REGISTER ENTITY : user PROVIDE BUNDLE : sequelize
 Thu Sep 13 2018 15:05:51 INFO CONNECTION Sequelize nodefony : Connection been established successfully Type : sqlite Database : /app/Resources/databases/nodefony.db
 Thu Sep 13 2018 15:05:51 INFO SERVICE sockjs  :  Create sockjs server :   HTTPS
 Thu Sep 13 2018 15:05:51 INFO MEMORY rss : MEMORY POST READY  ( Resident Set Size ) PID ( 26213 ) : 154 MB
 Thu Sep 13 2018 15:05:51 INFO MEMORY heapTotal : MEMORY POST READY  ( Total Size of the Heap ) PID ( 26213 ) : 125 MB
 Thu Sep 13 2018 15:05:51 INFO MEMORY heapUsed : MEMORY POST READY  ( Heap actually Used ) PID ( 26213 ) : 96 MB
 Thu Sep 13 2018 15:05:51 INFO MEMORY external : MEMORY POST READY  PID ( 26213 ) : 400 KB
 Thu Sep 13 2018 15:05:51 INFO SERVICE SERVER STATICS  : Server Static RootDir  ==> /Users/cci/repository/myproject/web
 Thu Sep 13 2018 15:05:51 INFO BUNDLE monitoring : ADD DEBUG BAR MONITORING
 Thu Sep 13 2018 15:05:54 INFO SERVICE SERVER HTTP  : Listening on DOMAIN : http://mydomain.com:5151
 Thu Sep 13 2018 15:05:54 INFO SERVICE SERVER WEBSOCKET  : Listening on DOMAIN : ws://mydomain.com:5151
 Thu Sep 13 2018 15:05:54 INFO SERVICE SERVER HTTPS  : Listening on DOMAIN : https://mydomain.com:5152
 Thu Sep 13 2018 15:05:54 INFO SERVICE SERVER WEBSOCKET SECURE  : Listening on DOMAIN : wss://mydomain.com:5152
 Thu Sep 13 2018 15:05:54 INFO SERVICE SESSIONS  : CONTEXT default SEQUELIZE SESSIONS STORAGE  ==>  ORM COUNT SESSIONS : 0
 Thu Sep 13 2018 15:05:58 INFO SERVICE WEBPACK  : WEBAPCK Compile Bundle app
 Thu Sep 13 2018 15:06:00 INFO SERVICE WEBPACK  : COMPILE SUCCESS BUNDLE : app webpack.config.js
 Thu Sep 13 2018 15:06:00 INFO BUNDLE app : MEMORY clean webpack compile bundle : app
 Thu Sep 13 2018 15:06:00 INFO SERVICE WEBPACK  : WEBPACK COMPILE FINISH

ACCEES NODEFONY APPLICATION :

Access to App with URL : http://mydomain.com:5151
By default the nodefony clone come with a demonstration bundle named "demo-bundle"