Skip to content

rrdfr/nodefony

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NODEFONY FRAMEWORK

Build Status CII Best Practices ![Gitter](https://badges.gitter.im/Join Chat.svg)

Nodefony is Node.js full-stack web framework.

Nodefony can be used to develop a complete solution to create a web application.

The Nodefony project is inspired by the PHP Symfony framework, a developer can find most of the concepts, configurations and patterns of Symfony framework.

Nodefony is not an exhaustive port of symfony, nodefony add services like:

  • Web servers (websocket(s), http(s)).
  • Notion of real-time context in the controller.
  • Notion of synchronous or asynchronous execution.

Now in this version Beta, Nodefony is evolved to a stable version without major fundamental changes.

Evolution priorities up to the stable version will focus on robustness, unit testing, documentation and security.

Now nodefony is ported with ECMAScript 6 ( Class, Inheritance ).

You can follow Nodefony build on travis at https://travis-ci.org/nodefony/nodefony

Framework Node.js Symfony Like

####- Nodefony Demo
####- Nodefony Documentation
####- Nodefony Monitoring

Documentation in progress !!

Table of content

Requirements

On your system you must have Installed :

  • GIT is Distributed version control system
  • GNU Make is a Tool which controls the generation of executables

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

  • npm is the Package Manager for javascript application

    npm will be automatically installed by Node.js

System :

  • LINUX ( Checked )

  • MACOS ( Checked )

  • WINDOWS ( Unchecked )

  • EMBEDDED SYSTEM ( Very difficult : large memory footprint )

Install Framework More Info : Getting Started with Nodefony

Node.js :

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

$ cd nodefony

$ make build

Start

Start the server to check:

# TO START NODEFONY IN DEVELOPMENT NODE

$ ./nodefony_dev


# OR 

# TO START NODEFONY IN PRODUCTION CLUSTER NODE

$ make start

# TO STOP 
$ make stop

# TO KILL ALL
$ make kill

Access to App with URL : http://localhost:5151

nodefony

Configurations Kernel

Open ./config/config.yml if you want change httpPort, domain server, locale ...

	#
	#  NODEFONY FRAMEWORK
	#
	#       KERNEL CONFIG
	#
	#
	name:                         "NODEFONY"
	system:                         
  		version:                      "2.0.1-beta"
		domain:                       127.0.0.1                    # nodefony can listen only one domain ( no vhost )
		domainAlias:                  "^localhost$"                # domainAlias string only <<regexp>> the separator is space
  		httpPort:                     5151
  		httpsPort:                    5152
  		statics:                      true
  		security:                     true
  		realtime:                     true
  		monitoring:                   true

  		locale:                       "fr_fr"   

  		log:
    		active:                     true
    		messages:                   "/tmp/nodefony.log"
    		error:                      "/tmp/errorNodefony.log"
    		services:                   "/tmp/servicesNodefony.log"
    		rotate:                     false

Command Line Interface

$./console -h            
              _   _    ___    ____    _____   _____    ___    _   _  __   __
             | \ | |  / _ \  |  _ \  | ____| |  ___|  / _ \  | \ | | \ \ / /
             |  \| | | | | | | | | | |  _|   | |_    | | | | |  \| |  \ V / 
             | |\  | | |_| | | |_| | | |___  |  _|   | |_| | | |\  |   | |  
             |_| \_|  \___/  |____/  |_____| |_|      \___/  |_| \_|   |_|  
                                                                            

		      NODEFONY CONSOLE CLUSTER MASTER Version : 1.0.3-beta PLATFORM : darwin  PROCESS PID : 85821

Usage: node console

  -h, --help     
  -v, --version  show version

Commands : [arguments]
nodefony
	npm:list							 List all installed packages 
	npm:install							 Install all framework packages
framework
	generate:bundle nameBundle path                                  Generate a Bundle directory in path directory
	generate:controller  nameController path                         Generate a controller js file in bundle path
	generate:command nameCommand path                                Generate a command js file in bundle path
	generate:service nameService path                                Generate a service js file in bundle path
	router:generate:routes                                           Generate all routes
	router:generate:route routeName                                  Generate one route Example : ./console router:generate:route home 
	router:match:url url                                             Get route who match url Example : ./console router:match:url /nodefony
assetic
	assets:install                                                   Installs bundles web assets link under a public web directory 
	assets:dump                                                      Dump  all bundles web assets under a public web directory 
security
	encoders:Digest firewall login password [realm]                  Generate encoding keys digest MD5 Example : ./console encoders:Digest secured_area login password
monitoring
	Monitoring:test:load URL [nbRequests] [concurence]               load test example ./console Monitoring:test:load http://nodefony.com:5151/demo 10000 100 
sequelize
	Sequelize:fixtures:load                                          Load data fixtures to your database
	Sequelize:generate:entities [force]                              Generate All Entities force to delete table if exist  example : ./console Sequelize:generate:entities force 
	Sequelize:query:sql connectionName SQL                           query sql in database connection  example : ./console  Sequelize:query:sql nodefony  'select * from users'
	Sequelize:entity:findAll entity                                  query findAll ENTITY
unitTest
	unitTest:list:all                                                List all unit tests
	unitTest:list:bundle bundleName                                  List all bundle unit tests
	unitTest:launch:all                                              Launch all tests
	unitTest:launch:bundle bundleName { testfile }                   Launch bundle tests

Get Started

Generate hello Bundle :

CLI Generate new bundle : generate:bundle nameBundle path

$ ./console generate:bundle helloBundle src/bundles
              _   _    ___    ____    _____   _____    ___    _   _  __   __
             | \ | |  / _ \  |  _ \  | ____| |  ___|  / _ \  | \ | | \ \ / /
             |  \| | | | | | | | | | |  _|   | |_    | | | | |  \| |  \ V /
             | |\  | | |_| | | |_| | | |___  |  _|   | |_| | | |\  |   | |  
             |_| \_|  \___/  |____/  |_____| |_|      \___/  |_| \_|   |_|  


		      CONSOLE Version : 1.0 PLATFORM : darwin  PROCESS PID : 1069

GENERATE bundle : helloBundle LOCATION : src/bundles
Create Directory :helloBundle
Create Directory :Command
Create Directory :controller
Create File      :defaultController.js
Create Directory :manager
Create Directory :tests
Create Directory :Resources
Create Directory :config
Create File      :config.yml
Create File      :routing.yml
Create Directory :public
Create Directory :js
Create Directory :css
Create Directory :images
Create Directory :translations
Create Directory :views
Create File      :index.html.twig
Create Directory :core
Create Directory :Entity
Create File      :helloBundle.js

Add hello bundle in Framework :

Open Bundle App "appKernel.js" to add new hello Bundle in registerBundles array : ./app/appKernel.js

/*
 *	ENTRY POINT FRAMEWORK APP KERNEL
 *
 */
nodefony.register("appKernel",function(){

	var appKernel = class appKernel extends nodefony.kernel {

		constructor (type, environment, debug, loader, settings){
			
			// kernel constructor
			super(environment, debug, loader, type, settings)

			/*
	 		*	Bundles to register in Application
	 		*/
			this.registerBundles([
				...
				"./src/bundles/helloBundle"
			]);

			...	
		};
	};

	return appKernel;
})

Start Framework to check new Bundle hello:

$ make 
$ ./nodefony_dev

Access to bundle route with URL : http://localhost:5151/hello

Start Framework in PRODUCTION CLUSTER MODE:

# TO START NODEFONY IN CLUSTER NODE

$ make start

# TO STOP 
$ make kill 

Monitoring FRAMEWORK in PRODUCTION CLUSTER MODE:

Access to monitoring route with URL : http://localhost:5151/nodefony

MONITORING

Monitoring in progress !!!

References / Thanks

NPM : Will be automatically installed by Makefile

.-------------------------------------------------------------------------------------------------------------------------------------------------------.
|                                               NPM NODEFONY PACKAGES                                                                                   |
|-------------------------------------------------------------------------------------------------------------------------------------------------------|
|         NAME          | VERSION |					DESCRIPTION                                                                     |
|-----------------------|---------|---------------------------------------------------------------------------------------------------------------------|
| chai                  | 3.5.0   | BDD/TDD assertion library for node.js and the browser. Test framework agnostic.                                     |
| cheerio               | 0.22.0  | Tiny, fast, and elegant implementation of core jQuery designed specifically for the server                          |
| elasticsearch         | 12.1.0  | The official low-level Elasticsearch client for Node.js and the browser.                                            |
| less                  | 2.7.1   | Leaner CSS                                                                                                          |
| memcached             | 2.2.2   | A fully featured Memcached API client, supporting both single and clustered ...					|
| mocha                 | 3.1.2   | simple, flexible, fun test framework                                                                                |
| passport              | 0.3.2   | Simple, unobtrusive authentication for Node.js.                                                                     |
| passport-github2      | 0.1.10  | GitHub authentication strategy for Passport.                                                                        |
| passport-google-oauth | 1.0.0   | Google (OAuth) authentication strategies for Passport.                                                              |
| passport-http         | 0.3.0   | HTTP Basic and Digest authentication strategies for Passport.                                                       |
| passport-ldapauth     | 0.6.0   | LDAP authentication strategy for Passport                                                                           |
| passport-local        | 1.0.0   | Local username and password authentication strategy for Passport.                                                   |
| passport-nodefony     | 1.0.6   | Passport strategy wrapper for nodefony framework                                                                    |
| redis                 | 2.6.3   | Redis client library                                                                                                |
| sequelize             | 3.27.0  | Multi dialect ORM for Node.JS/io.js                                                                                 |
| uglify-js             | 2.7.4   | JavaScript parser, mangler/compressor and beautifier toolkit                                                        |
| uglifycss             | 0.0.25  | Port of YUI CSS Compressor to NodeJS                                                                                |
| useragent             | 2.1.9   | Fastest, most accurate & effecient user agent string parser, uses Browserscope's research for parsing               |
| webrtc-adapter        | 2.0.8   | A shim to insulate apps from WebRTC spec changes and browser prefix differences                                     |
| ascii-table           | 0.0.9   | Easy tables for your console data                                                                                   |
| asciify               | 1.3.5   | Plain text awesomizer. A hybrid npm module and CLI for turning plain text into ascii art.                           |
| connect               | 2.30.2  | High performance middleware framework                                                                               |
| cookie                | 0.3.1   | HTTP server cookie parsing and serialization                                                                        |
| js-yaml               | 3.7.0   | YAML 1.2 parser and serializer                                                                                      |
| markdown-it           | 8.1.0   | Markdown-it - modern pluggable markdown parser.                                                                     |
| mime                  | 1.3.4   | A comprehensive library for mime-type mapping                                                                       |
| mkdirp                | 0.5.1   | Recursively mkdir, like `mkdir -p`                                                                                  |
| mysql                 | 2.12.0  | A node.js driver for mysql. It is written in JavaScript, does not require compiling, and is 100% MIT licensed.      |
| node-getopt           | 0.2.3   | featured command line args parser                                                                                   |
| node-pre-gyp          | 0.6.31  | Node.js native addon binary install tool                                                                            |
| nodegit               | 0.16.0  | Node.js libgit2 asynchronous native bindings                                                                        |
| npm                   | 3.10.9  | a package manager for JavaScript                                                                                    |
| npmi                  | 2.0.1   | Gives a simplier API to npm install (programatically installs stuffs)                                               |
| pm2                   | 2.1.5   | Production process manager for Node.JS applications with a built-in load balancer.                                  |
| promise               | 7.1.1   | Bare bones Promises/A+ implementation                                                                               |
| shortid               | 2.2.6   | Amazingly short non-sequential url-friendly unique id generator.                                                    |
| sqlite3               | 3.1.8   | Asynchronous, non-blocking SQLite3 bindings                                                                         |
| twig                  | 0.10.0  | JS port of the Twig templating language.                                                                            |
| websocket             | 1.0.23  | Websocket Client & Server Library implementing the WebSocket protocol as specified in RFC 6455.                     |
| xml2js                | 0.4.17  | Simple XML to JavaScript object converter.                                                                          |
'-------------------------------------------------------------------------------------------------------------------------------------------------------'

Big thanks:

Related Links:

More informations Documentation

Authors

License

CeCILL-B

Demo

Demo

About

Node.js full-stack web framework Symfony Like : https://nodefony.net

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 48.6%
  • HTML 29.9%
  • CSS 21.3%
  • Other 0.2%