Fork me on GitHub

Requirements :

  • Node.js is a Platform built on Chrome's JavaScript runtime

    Install Node.js via Package

  • NPM is the Package Manager for javascript application
  • GIT is Distributed version control system
  • GNU Make is a Tool which controls the generation of executables

OS compatibility :

  • LINUX ( Checked )
  • MACOS ( Checked )
  • WINDOWS ( Unchecked )
  • EMBEDDED SYSTEM ( Unchecked )

Clone sources from github :

$ git clone https://github.com/nodefony/nodefony.git

$ cd nodefony
	

Build Nodefony Sources :

This part consist to call differents targets of Makefile (see Makefile documentation)
This tagets do multiple tasks as :

  • Create some framework directories
  • Install Framework dependences of NPM package manager ( see package.json )
  • Install Bundles dependences of NPM package manager ( see package.json in bundle directory )
  • Create Nodefony Database (manage sessions, monotoring ,users)


$ make build

Console when you build nodefony framework :

###########  CREATE FRAMEWORK REPOSITORY ###########

make certificates ;
NODEFONY   PLATFORM : Darwin   NODE VERSION : v8.2.1
#########################################
#         NODEFONY CERTIFICATES         #
#########################################

...
./config/certificates/ca_intermediate/certs/server.nodefony.cert.pem: OK
./config/certificates/ca_intermediate/certs/client.nodefony.cert.pem: OK
Modulus=BA1D80A4F4DE53A526891654218A57121E9EF6655B6EC0999247D909F3C532C96F10B68795D5005C05B1BA07CB057E8BA2A9B9F74A10A1235E4005062BA75EC78F8A2789585D4F45082717F29A0E8790BB317ADEE2F4C0CB167027ED76284A71C24A662CA4197FFAE576E19E8894A7E85C8D77EDEAFF2B74744F16E33C8B72CBCA4C40D3FBC90E1E5218678BD86DEE4ED75E518E845B84D2F5F853EC51829DE0BDCBCD45369716B84224B554F30078E23702FF9B982280A351FC210E72667FB9D3BFC3E25B16CF2635B61B063F2AE953FDEAFB5D229CFA27DE03EE136D87C29282FA8B712EF376A527CE7B2484FC8D702E60B5AEA73096B15BDAC25C923EDD2D
Modulus=BA1D80A4F4DE53A526891654218A57121E9EF6655B6EC0999247D909F3C532C96F10B68795D5005C05B1BA07CB057E8BA2A9B9F74A10A1235E4005062BA75EC78F8A2789585D4F45082717F29A0E8790BB317ADEE2F4C0CB167027ED76284A71C24A662CA4197FFAE576E19E8894A7E85C8D77EDEAFF2B74744F16E33C8B72CBCA4C40D3FBC90E1E5218678BD86DEE4ED75E518E845B84D2F5F853EC51829DE0BDCBCD45369716B84224B554F30078E23702FF9B982280A351FC210E72667FB9D3BFC3E25B16CF2635B61B063F2AE953FDEAFB5D229CFA27DE03EE136D87C29282FA8B712EF376A527CE7B2484FC8D702E60B5AEA73096B15BDAC25C923EDD2D
Modulus=BA1D80A4F4DE53A526891654218A57121E9EF6655B6EC0999247D909F3C532C96F10B68795D5005C05B1BA07CB057E8BA2A9B9F74A10A1235E4005062BA75EC78F8A2789585D4F45082717F29A0E8790BB317ADEE2F4C0CB167027ED76284A71C24A662CA4197FFAE576E19E8894A7E85C8D77EDEAFF2B74744F16E33C8B72CBCA4C40D3FBC90E1E5218678BD86DEE4ED75E518E845B84D2F5F853EC51829DE0BDCBCD45369716B84224B554F30078E23702FF9B982280A351FC210E72667FB9D3BFC3E25B16CF2635B61B063F2AE953FDEAFB5D229CFA27DE03EE136D87C29282FA8B712EF376A527CE7B2484FC8D702E60B5AEA73096B15BDAC25C923EDD2D

make npm ;
#####################################################
#         NODE.JS  INSTALLATION			    #
#####################################################

npm install

⸨░░░░░░░░░░░░░░░░░░⸩ ...



#########################################
#       NODEFONY INSTALL BUNDLES        #
#########################################

 ./nodefony npm:install

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


 		      Version : 3.0.0-beta Platform : darwin Process : nodefony PID : 85919


 			NODEFONY CONSOLE Cluster : master Environment : prod Debug :false

Wed Aug 02 2017 09:48:56 INFO SERVICE CLI KERNEL  : NPM :5.3.0 Installing Dependencies for bundle : demoBundle

⸨░░░░░░░░░░░░░░░░░░⸩ ...


./nodefony Sequelize:generate:entities
 ____                                  _   _
/ ___|    ___    __ _   _   _    ___  | | (_)  ____   ___
\___ \   / _ \  / _` | | | | |  / _ \ | | | | |_  /  / _ \
 ___) | |  __/ | (_| | | |_| | |  __/ | | | |  / /  |  __/
|____/   \___|  \__, |  \__,_|  \___| |_| |_| /___|  \___|
                   |_|


Wed Aug 02 2017 09:44:48 INFO SERVICE CLI KERNEL  : DATABASE  : sqlite CONNECTION : nodefony
Wed Aug 02 2017 09:44:48 INFO SERVICE CLI KERNEL  : DATABASE SYNC : nodefony
Executing (default): CREATE TABLE IF NOT EXISTS `clients` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `name` VARCHAR(255) NOT NULL UNIQUE, `clientId` VARCHAR(255) NOT NULL, `clientSecret` VARCHAR(255) NOT NULL, `isTrusted` VARCHAR(255) NOT NULL, `createdAt` DATETIME NOT NULL, `updatedAt` DATETIME NOT NULL, UNIQUE (`name`));
Executing (default): PRAGMA INDEX_LIST(`clients`)
Executing (default): PRAGMA INDEX_INFO(`sqlite_autoindex_clients_1`)
Executing (default): CREATE TABLE IF NOT EXISTS `users` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `username` VARCHAR(255) NOT NULL UNIQUE, `password` VARCHAR(255), `provider` VARCHAR(255) DEFAULT 'nodefony', `enabled` TINYINT(1) DEFAULT 1, `credentialsNonExpired` TINYINT(1) DEFAULT 1, `accountNonLocked` TINYINT(1) DEFAULT 1, `email` VARCHAR(255), `name` VARCHAR(255), `surname` VARCHAR(255), `lang` VARCHAR(255) DEFAULT 'en_en', `roles` VARCHAR(255) DEFAULT 'ADMIN', `gender` VARCHAR(255), `displayName` VARCHAR(255), `url` VARCHAR(255), `image` VARCHAR(255), `createdAt` DATETIME NOT NULL, `updatedAt` DATETIME NOT NULL, UNIQUE (`username`));
Executing (default): PRAGMA INDEX_LIST(`users`)
Executing (default): PRAGMA INDEX_INFO(`sqlite_autoindex_users_1`)
Executing (default): CREATE TABLE IF NOT EXISTS `sessions` (`session_id` VARCHAR(255) NOT NULL, `context` VARCHAR(255) DEFAULT 'default' NOT NULL, `Attributes` TEXT, `flashBag` TEXT, `metaBag` TEXT, `createdAt` DATETIME, `updatedAt` DATETIME NOT NULL, `user_id` INTEGER REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, PRIMARY KEY (`session_id`, `context`));
Executing (default): PRAGMA INDEX_LIST(`sessions`)
Executing (default): PRAGMA INDEX_INFO(`sqlite_autoindex_sessions_1`)
Executing (default): CREATE TABLE IF NOT EXISTS `requests` (`id` INTEGER PRIMARY KEY AUTOINCREMENT, `remoteAddress` VARCHAR(255), `userAgent` VARCHAR(255), `url` TEXT, `route` VARCHAR(255), `method` VARCHAR(255), `state` VARCHAR(255), `protocole` VARCHAR(255), `username` VARCHAR(255), `data` TEXT, `createdAt` DATETIME NOT NULL, `updatedAt` DATETIME NOT NULL);
Executing (default): PRAGMA INDEX_LIST(`requests`)
Wed Aug 02 2017 09:44:48 INFO SERVICE CLI KERNEL  : DATABASE :/app/Resources/databases/nodefony.db CONNECTION : nodefony CREATE ALL TABLES
Wed Aug 02 2017 09:44:48 INFO CONSOLE   : NODEFONY Kernel Life Cycle Terminate CODE : 0
./nodefony Sequelize:fixtures:load
Wed Aug 02 2017 09:44:49 INFO SERVICE CLI   : DELETE TMP :/Users/cci/repository/nodefony-core/tmp/webpack


./console Sequelize:fixtures:load


              ____                                  _   _
             / ___|    ___    __ _   _   _    ___  | | (_)  ____   ___
             \___ \   / _ \  / _` | | | | |  / _ \ | | | | |_  /  / _ \
              ___) | |  __/ | (_| | | |_| | |  __/ | | | |  / /  |  __/
             |____/   \___|  \__, |  \__,_|  \___| |_| |_| /___|  \___|
                                |_|


 Wed Aug 02 2017 09:50:14 INFO SERVICE CLI KERNEL  : LOAD FIXTURES BUNDLE : sequelize
 Wed Aug 02 2017 09:50:14 INFO SERVICE CLI KERNEL  : LOAD FIXTURE ENTITY : user CONNECTIONS : nodefony
 Wed Aug 02 2017 09:50:14 INFO sequelize   : Database synchronised
 Wed Aug 02 2017 09:50:14 INFO sequelize   : ALREADY EXIST USER : anonymous
 Wed Aug 02 2017 09:50:14 INFO sequelize   : ALREADY EXIST USER : admin
 Wed Aug 02 2017 09:50:14 INFO sequelize   : ALREADY EXIST USER : 1000
 Wed Aug 02 2017 09:50:14 INFO sequelize   : ALREADY EXIST USER : 2000
 Wed Aug 02 2017 09:50:14 INFO sequelize   : ALREADY EXIST USER : 3000
 Wed Aug 02 2017 09:50:14 INFO SERVICE CLI KERNEL  : LOAD FIXTURE ENTITY :  SUCCESS
 Wed Aug 02 2017 09:50:14 INFO CONSOLE   : NODEFONY Kernel Life Cycle Terminate CODE : 0
success nodefony sequelize !
	

Example files system after Build The repository :


$ ls -l
total 1880
-rw-r--r--     1 cci  staff       0 27 jul 18:37 CHANGELOG.md
-rw-r--r--     1 cci  staff   22696 27 jul 18:37 LICENSE.txt
-rw-r--r--     1 cci  staff    7126 31 jul 10:01 Makefile
-rw-r--r--     1 cci  staff   72938 19 jul 16:04 README.md
drwxr-xr-x     9 cci  staff     306 18 jul 12:57 app
drwxr-xr-x     7 cci  staff     238 31 jul 14:30 bin
drwxr-xr-x     7 cci  staff     238  2 aoû 09:46 config
drwxr-xr-x     6 cci  staff     204 27 jul 18:40 docker
drwxr-xr-x  1069 cci  staff   36346  2 aoû 09:48 node_modules
-rwxr-xr-x     1 cci  staff    7737 31 jul 17:19 nodefony
-rw-r--r--     1 cci  staff  536495  2 aoû 09:48 package-lock.json
-rw-r--r--     1 cci  staff    1370 31 jul 10:14 package.json
drwxr-xr-x     4 cci  staff     136 31 jul 17:32 src
drwxr-xr-x     5 cci  staff     170  2 aoû 09:50 tmp
drwxr-xr-x     7 cci  staff     238 27 jul 18:40 tools
drwxr-xr-x     9 cci  staff     306  2 aoû 09:46 web
-rw-r--r--     1 cci  staff  306697 31 jul 10:26 yarn.lock

References :

Try nodefony Command Line Interface

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


         Version : 3.0.0-beta Platform : darwin Process : nodefony PID : 86371


       NODEFONY CONSOLE Cluster : master Environment : prod Debug :false

Usage: nodefony [options]  [args...]

Options:

-d, --debug         Nodefony debug
-h, --help          Nodefony help
-v, --version       Nodefony version
-i, --interactive   Nodefony cli Interactive Mode

Command :

nodefony
    dev							 	 Run Nodefony Development Server
    prod							 	 Run Nodefony Preprod Server
    pm2							 	 Run Nodefony Production Server ( PM2 mode )
    app							 	 Get Nodefony App name
    npm:install							 Install all NPM framework packages
    npm:list							 List all NPM installed packages
framework
    generate:bundle nameBundle path                                  Generate a nodefony Bundle  Example : nodefony generate:bundle myBundle ./src/bundles
    generate:bundle:angular nameBundle path                          Generate a Angular Bundle  Example : nodefony generate:bundle:angular myBundle ./src/bundles
    generate:controller  nameController bundlePath                   Generate a controller Example : nodefony generate:controller myController ./src/bundles/myBundle
    generate:command nameCommand path                                Generate a command js file in bundle path
    router:generate:routes                                           Generate all routes
    router:generate:route routeName                                  Generate one route Example : nodefony router:generate:route home
    router:match:url url                                             Get route who match url Example : nodefony router:match:url /nodefony
    webpack:dump                                                     Compile webpack for all bundles
security
    encoders:Digest firewall login password [realm]                  Generate encoding keys digest MD5 Example : nodefony encoders:Digest secured_area login password
sequelize
    Sequelize:fixtures:load                                          Load data fixtures to your database
    Sequelize:generate:entities [force]                              Generate All Entities force to delete table if exist  example : nodefony Sequelize:generate:entities force
    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
monitoring
    Monitoring:test:load URL [nbRequests] [concurence]               load test example : nodefony Monitoring:test:load http://localhost:5151/demo 10000 100
unitTest
    unitTest:list:all                                                List all unit tests
    unitTest:list:bundle bundleName                                  List all bundle unit tests
    unitTest:launch:all                                              Launch all tests Example : nodefony unitTest:launch:all
    unitTest:launch:bundle bundleName { testfile }                   Launch bundle tests Example: nodefony unitTest:launch:bundle demoBundle responseTest.js
    

Dependencies will be automatically installed by Makefile

./nodefony npm:list
 _   _    ___    ____    _____   _____    ___    _   _  __   __
| \ | |  / _ \  |  _ \  | ____| |  ___|  / _ \  | \ | | \ \ / /
|  \| | | | | | | | | | |  _|   | |_    | | | | |  \| |  \ V /
| |\  | | |_| | | |_| | | |___  |  _|   | |_| | | |\  |   | |
|_| \_|  \___/  |____/  |_____| |_|      \___/  |_| \_|   |_|


 Version : 3.0.0-beta Platform : darwin Process : nodefony PID : 86275

NODEFONY CONSOLE Cluster : master Environment : prod Debug :false

Wed Aug 02 2017 10:00:38 INFO SERVICE CLI KERNEL  : NPM NODEFONY PACKAGES :/Users/cci/repository/nodefony/package.json
Wed Aug 02 2017 10:00:38 INFO SERVICE CLI KERNEL  : NPM NODEFONY PACKAGES :/Users/cci/repository/nodefony/src/bundles/demoBundle/package.json
Wed Aug 02 2017 10:00:38 INFO SERVICE CLI KERNEL  : NPM NODEFONY PACKAGES :/Users/cci/repository/nodefony/app/package.json
┌──────────────────────────────┬──────────┬────────────────────────────────────────────────────────────────────────────────────────────────────┬────────────────────┐
│ NAME                         │ VERSION  │ DESCRIPTION                                                                                        │ BUNDLES            │
├──────────────────────────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┼────────────────────┤
│ babel-core                   │ 6.25.0   │ Babel compiler core.                                                                               │ nodefony           │
├──────────────────────────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┼────────────────────┤
│ babel-loader                 │ 7.1.1    │ babel module loader for webpack                                                                    │ nodefony           │
├──────────────────────────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┼────────────────────┤
│ babel-preset-es2015          │ 6.24.1   │ Babel preset for all es2015 plugins.                                                               │ nodefony           │
├──────────────────────────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┼────────────────────┤
│ bootstrap                    │ 3.3.7    │ The most popular front-end framework for developing responsive, mobile first projects on the web.  │ nodefony           │
├──────────────────────────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┼────────────────────┤
│ css-loader                   │ 0.28.4   │ css loader module for webpack                                                                      │ nodefony           │
├──────────────────────────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┼────────────────────┤
│ extract-text-webpack-plugin  │ 3.0.0    │ Extract text from bundle into a file.                                                              │ nodefony           │
├──────────────────────────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┼────────────────────┤
│ file-loader                  │ 0.11.2   │ file loader module for webpack                                                                     │ nodefony           │
├──────────────────────────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┼────────────────────┤
│ font-awesome                 │ 4.7.0    │ The iconic font and CSS framework                                                                  │ nodefony           │
├──────────────────────────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┼────────────────────┤
│ js-yaml                      │ 3.9.1    │ YAML 1.2 parser and serializer                                                                     │ nodefony           │
├──────────────────────────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┼────────────────────┤
│ nodefony                     │ 3.0.0-b… │ Nodefony Node.js full-stack web framework                                                          │ nodefony           │
├──────────────────────────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┼────────────────────┤
│ nodefony-stage               │ 0.1.1    │ Client Side Nodefony web developpement                                                             │ nodefony           │
├──────────────────────────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┼────────────────────┤
│ pm2                          │ 2.6.1    │ Production process manager for Node.JS applications with a built-in load balancer.                 │ nodefony           │
├──────────────────────────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┼────────────────────┤
│ uglify-es                    │ 3.0.27   │ JavaScript parser, mangler/compressor and beautifier toolkit for ES6+                              │ nodefony           │
├──────────────────────────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┼────────────────────┤
│ webpack                      │ 3.4.1    │ Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, … │ nodefony           │
├──────────────────────────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┼────────────────────┤
│ webpack-dev-server           │ 2.6.1    │ Serves a webpack app. Updates the browser on changes.                                              │ nodefony           │
├──────────────────────────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┼────────────────────┤
│ webpack-merge                │ 4.1.0    │ Variant of merge that's useful for webpack configuration                                           │ nodefony           │
├──────────────────────────────┼──────────┼────────────────────────────────────────────────────────────────────────────────────────────────────┼────────────────────┤
│ xml2js                       │ 0.4.17   │ Simple XML to JavaScript object converter.                                                         │ nodefony           │
└──────────────────────────────┴──────────┴────────────────────────────────────────────────────────────────────────────────────────────────────┴────────────────────┘
Wed Aug 02 2017 10:00:46 INFO CONSOLE   : NODEFONY Kernel Life Cycle Terminate CODE : 0