Fork me on GitHub

Requirements :

OS compatibility :

  • LINUX ( Checked )

    • Debian, Ubuntu (Checked, Tested)
    • RASPBIAN Raspberry Pi (Checked)

  • FreeBSD (Checked)

    • pkg install bash rsync gmake gcc6
    • setenv CC "/usr/local/bin/gcc"
    • setenv CXX "/usr/local/bin/g++"
    • cd /usr/local/bin/ ;ln -s pythonx.x python

  • MACOS (Checked, Tested)
  • WINDOWS ( Not ported yet )
  • OpenBSD (Not Checked yet )
  • ELECTRON ( Experimental )
  • EMBEDDED SYSTEM ( Very difficult : large memory footprint )

Global Installation :

$ npm -g install nodefony

#  Or yarn

$ yarn global add nodefony
	

Build New Project :

This part consist to build new Nodefony starter kit

  • Create framework directories , configurations ...
  • Install Framework dependences
  • Install Bundles dependences

Usage:
nodefony
         create [-i] name [path]                                 Create New Nodefony Project

$ nodefony create myproject

Console when you Create nodefony Project :

$ nodefony create myproject
Thu Sep 13 2018 11:39:45 INFO BUILDER : Create Directory :myproject
Thu Sep 13 2018 11:39:45 INFO nodefony : Create Project myproject complete
  ...
Thu Sep 13 2018 11:39:45 INFO nodefony : Spawn : npm install
Thu Sep 13 2018 11:41:16 INFO nodefony : Command : npm install Finished cwd : /Users/cci/repository/myproject
Thu Sep 13 2018 11:41:16 INFO nodefony : Install Complete
Thu Sep 13 2018 11:41:16 INFO INSTALLER : Clean certificates in : /Users/cci/repository/myproject/config/certificates
Thu Sep 13 2018 11:41:16 INFO INSTALLER : Create directory /Users/cci/repository/myproject/config/certificates
Thu Sep 13 2018 11:41:16 INFO INSTALLER : Generate openssl certificates in : /Users/cci/repository/myproject/config/certificates
Thu Sep 13 2018 11:41:16 INFO nodefony : Spawn : /Users/cci/repository/myproject/bin/generateCertificates.sh
  ...
Thu Sep 13 2018 11:41:19 INFO nodefony : Build Complete
                                                             _                 _
                _ __ ___    _   _   _ __    _ __    ___     (_)   ___    ___  | |_
               | '_ ` _ \  | | | | | '_ \  | '__|  / _ \    | |  / _ \  / __| | __|
               | | | | | | | |_| | | |_) | | |    | (_) |   | | |  __/ | (__  | |_
               |_| |_| |_|  \__, | | .__/  |_|     \___/   _/ |  \___|  \___|  \__|
                            |___/  |_|                    |__/

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

        KERNEL CONSOLE Cluster : master Environment : prod Debug :false

Thu Sep 13 2018 11:42:11 INFO COMMAND : nodefony:build /Users/cci/repository/myproject
Thu Sep 13 2018 11:42:11 INFO COMMAND nodefony : BUILD NODEFONY FRAMEWORK
Thu Sep 13 2018 11:42:11 INFO COMMAND nodefony : INITIALIZE ORM
Thu Sep 13 2018 11:42:11 INFO COMMAND nodefony : INITIALIZE SEQUELIZE
Thu Sep 13 2018 11:42:11 INFO COMMAND sequelize TASK sync : DATABASE  : sqlite CONNECTION : nodefony
Thu Sep 13 2018 11:42:11 INFO COMMAND sequelize TASK sync : DATABASE SYNC : nodefony
 ...
Thu Sep 13 2018 11:42:14 INFO nodefony : NODEFONY PACKAGES :/Users/cci/repository/myproject/package.json
Thu Sep 13 2018 11:42:14 INFO nodefony : NODEFONY PACKAGES :/Users/cci/repository/myproject/node_modules/@nodefony/demo-bundle/package.json
Thu Sep 13 2018 11:42:14 INFO nodefony : NODEFONY PACKAGES :/Users/cci/repository/myproject/app/package.json
Thu Sep 13 2018 11:42:25 INFO KERNEL CONSOLE  : NODEFONY Kernel Life Cycle Terminate CODE : 0

Example files system after Build The Project :

$ cd myproject
$ ls -la 
total 760
  8 -rw-r--r--    1 cci  staff     331 13 sep 11:39 .editorconfig
  0 drwxr-xr-x   13 cci  staff     442 13 sep 11:39 .git
  8 -rw-r--r--    1 cci  staff     326 13 sep 11:39 .gitignore
  8 -rw-r--r--    1 cci  staff      13 13 sep 11:39 .jshintignore
  8 -rw-r--r--    1 cci  staff    1010 13 sep 11:39 .jshintrc
  0 -rw-r--r--    1 cci  staff       0 13 sep 11:39 README.md
  0 drwxr-xr-x   10 cci  staff     340 13 sep 11:42 app
  0 drwxr-xr-x    3 cci  staff     102 13 sep 11:39 bin
  0 drwxr-xr-x    6 cci  staff     204 13 sep 11:41 config
  0 drwxr-xr-x    2 cci  staff      68 13 sep 11:39 doc
  0 drwxr-xr-x  849 cci  staff   28866 13 sep 11:41 node_modules
720 -rw-r--r--    1 cci  staff  366895 13 sep 11:41 package-lock.json
  8 -rw-r--r--    1 cci  staff    1692 13 sep 11:41 package.json
  0 drwxr-xr-x    3 cci  staff     102 13 sep 11:39 src
  0 drwxr-xr-x    4 cci  staff     136 13 sep 11:42 tmp
  0 drwxr-xr-x    7 cci  staff     238 13 sep 11:39 web

References :

Try nodefony Command Line Interface

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

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

KERNEL CONSOLE Cluster : master Environment : prod Debug :false
Options:
-d, --debug         Nodefony debug
-h, --help          Nodefony help
-v, --version       Nodefony version
-f, --force         Force disable interactive mode
-i, --interactive   Nodefony cli Interactive Mode
-j, --json          Nodefony json response

Servers
         dev                                                     Run Nodefony Development Server
         preprod                                                 Run Nodefony Preprod Server ( Usefull to check Clusters Node )
         prod                                                    Run Nodefony Production Server ( PM2 mode )
PM2 Process Manager 2
         stop [name]                                             Stop Production Project
         reload [name]                                           Reload Production Project
         delete [name]                                           Delete Production Project from PM2 management
         restart [name]                                          Restart Production Project
         list                                                    List all Production Projects
         kill                                                    Kill PM2 daemon
         logs [name] [nblines]                                   Stream pm2 logs  [name] is project name  and [nblines] to show
         clean-log                                               Remove logs
nodefony
         create [-i] name [path]                                 Create New Nodefony Project
         build                                                   Build Nodefony Framewok
         install                                                 Install Nodefony Project
         certificates                                            Generate HTTPS Certificates  'Change default openssl configuration in config/openssl'
         listDependencies                                        List Project dependencies
         outdated                                                List Project dependencies outdated
         version                                                 Get Project Version
Bundles
  framework
         generate:bundle name [path]                             Generate a nodefony Bundle  Example : nodefony generate:bundle name ./src/bundles
         generate:controller [-i] name [bundle]                  Generate a Bundle Controller  Example : nodefony generate:controller defaultController demo
         generate:service [-i]                                   Generate Service
         generate:entity [-i] orm                                Generate ORM Entity
         generate:nginx [-i]                                     Generate Nginx Minimal Configuration File as a reverse proxy in front of Nodefony
         generate:haproxy [-i]                                   Generate Haproxy Minimal Configuration File as a reverse proxy in front of Nodefony
         generate:letsencrypt [-i]                               Generate Let's Encrypt Webroot Configuration
         router:display:routes [routeName]                       Display all routes or route  Example : nodefony router:display:route home
         router:display:match uri                                Get route who match uri Example : nodefony router:display:match /nodefony
         webpack:dump                                            Compile webpack for all bundles
  sequelize
         sequelize:sync [force]                                  Synchronize All Entities. [force] to delete table if exist  example : nodefony sequelize:sync force
         sequelize:fixtures:load                                 Load fixtures in database
         sequelize:query:sql connectionName 'SQL'                Query sql in database connection  example : nodefony  sequelize:query:sql nodefony 'select * from users'
         sequelize:entity:findAll entity                         Query findAll ENTITY
         sequelize:generate:entity name bundle connector         Generate Sequelize Entity
  unittests
         unitest:list:all                                        List all unit tests
         unitest:list:bundle bundleName                          List all bundle unit tests
         unitest:launch:all                                      Launch all tests Example : nodefony unitest:launch:all
         unitest:launch:bundle bundleName [testfile]             Launch bundle tests Example: nodefony unitest:launch:bundle demoBundle responseTest.js