UNPKG

7.56 kBMarkdownView Raw
1![Danf](resource/public/img/small-logo.jpg)
2===========================================
3
4[![NPM Version][npm-image]][npm-url]
5[![NPM Downloads][downloads-image]][downloads-url]
6[![Build Status][travis-image]][travis-url]
7[![Dependency Status][versioneye-image]][versioneye-url]
8
9Introduction
10------------
11
12Danf is a Node.js full-stack isomorphic OOP framework allowing to code the same way on both client and server sides. It helps you to make deep architectures and handle asynchronous flows in order to help in producing scalable, maintainable, testable and performant applications.
13
14### Why use node Node.js instead of another technology?
15
16You certainly can find lots of reasons but there are 2 which make the success of Node.js before all others:
17- use the same language on both client and server sides
18- handle I/O in an asynchronous way to maximize your CPU load thanks to the main event loop
19
20### Why use Danf?
21
22Danf reinforces the promises of Node.js:
23- use the same code on both client and server sides *(in a classic node.js style)*
24- maximize the power of asynchronicity thanks to a nice and innovative abstraction layer *(built upon [Async.js](https://github.com/caolan/async))*
25
26### Why use Danf instead of another framework?
27
28Danf is not better as any other existing framework or library but it has its own proposal. Danf is an agnostic framework: it will not force you to use sockets or this or that database or a big client library phagocyting all the others (with heavy impact on architecture, bookmarquing, security, ...). In fact, it just provides a layer to help in making strong architectures and use the power of Node.js in an easy way. You can still use all your prefered client or server libraries/packages with Danf!
29
30Here is a fast description of its 3 layers architecture:
31- Model: implement your code in "classes" and use a dynamic dependency injection (SOA) to make a low coupling between your components
32- Sequencing: abstract parallel and series synchronous and asynchronous executions of methods of your model instances
33- Event: plug events on your sequences (HTTP requests, socket messages, commands, DOM events, ...)
34
35You can make a lot of different applications with Danf:
36- Single page website (AJAX, sockets)
37- REST API
38- Task executor
39- Utility module (on client or/and server side) for modular achitecture
40- ...
41
42> You can code big (and small!) performant and modular applications with a deep and strong architecture in an easy way and share your code thanks to a transparent module mechanism only requiring to use [npm](https://www.npmjs.com/) in the most standard way.**
43
44Installation
45------------
46
47### Create a proto application
48
49The better way to create a new application/danf module (in Danf an application is a **danf module** and conversely) is to let [Yeoman](http://yeoman.io/) do it for you!
50
51First, install Yeoman:
52```sh
53$ npm install -g yo
54```
55
56Then, install the specific generator for Danf applications:
57```sh
58$ npm install -g generator-danf
59```
60
61Finally, create an application using:
62```sh
63$ yo danf
64```
65
66### Start the server
67
68After creating your application, you should be able to start the server in this way:
69```sh
70$ node danf serve
71```
72
73This will create a server and process client side files automatically rebuilding each time a file is changed.
74At the end of this processing, a welcome message will be available at `http://localhost:3080`!
75
76> Use `node danf serve --env prod` to start the server in prod environment (less debugging, more performances!).
77
78### Run the tests
79
80You can run the tests of your application thanks to:
81```sh
82$ make test
83```
84
85Architecture
86------------
87
88Here is a diagram of the macro architecture of Danf:
89
90![architecture](resource/private/img/architecture.png)
91
92Features
93--------
94
95Here is a list of the major features proposed by Danf:
96- An object-oriented programming layer (with ensured interfaces).
97- An inversion of control design (dependency injection via configuration files).
98- A perfect isomorphism allowing to use the same code on both client and server sides (in a standard node.js coding style).
99- A homogeneous way to handle all kind of events (HTTP requests, socket messages, commands, DOM events, ...).
100- An original abstraction layer over [Async.js](https://github.com/caolan/async) to manage asynchronicity.
101- A helper to develop ultra performant AJAX and "real time" applications supporting deep linking.
102- A natural approach to share your modules and use others just using [npm](https://www.npmjs.com/).
103- Some other helpful sub features to easily manage cookies, session, ...
104
105> Danf is stable and is already used by some applications in production.
106
107Community
108---------
109
110Danf is a young framework and the community is still small but active. You can post your issues on [github](https://github.com/gnodi/danf/issues) or on [stack overflow](http://stackoverflow.com/) with the tag `danf` and you will get an answer as quickly as possible.
111
112If you want to contribute, here is a not limited list of how to do:
113
114- Fork the project on [github](https://github.com/gnodi/danf) and improve features, documentation, ...
115- Code your own module. In Danf, an application is a **danf module** and conversely. This way you can easily share your modules with other people simply using [npm](https://www.npmjs.com/) (here is a [list of available danf modules](resource/private/doc/modules.md)).
116- Participate to the community in asking questions in the issues or on stack overflow.
117
118> Danf is always improving. Keep an eye on its new versions and features!
119
120Documentation
121-------------
122
123Get a quick [overview](resource/private/doc/overview/index.md) of the framework architecture and possibilities.
124
125Learn more about the framework in the [documentation](resource/private/doc/index.md).
126
127Tests
128-----
129
130You can run the tests of the framework using:
131```sh
132$ make test
133```
134
135License
136-------
137
138Open Source Initiative OSI - The MIT License
139
140http://www.opensource.org/licenses/mit-license.php
141
142Copyright (c) 2014-2016 Thomas Prelot
143
144Permission is hereby granted, free of charge, to any person obtaining
145a copy of this software and associated documentation files (the
146"Software"), to deal in the Software without restriction, including
147without limitation the rights to use, copy, modify, merge, publish,
148distribute, sublicense, and/or sell copies of the Software, and to
149permit persons to whom the Software is furnished to do so, subject to
150the following conditions:
151
152The above copyright notice and this permission notice shall be
153included in all copies or substantial portions of the Software.
154
155THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
156EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
157MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
158NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
159LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
160OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
161WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
162
163[npm-image]: https://img.shields.io/npm/v/danf.svg?style=flat
164[npm-url]: https://npmjs.org/package/danf
165[downloads-image]: https://img.shields.io/npm/dm/danf.svg?style=flat
166[downloads-url]: https://npmjs.org/package/danf
167[travis-image]: https://img.shields.io/travis/gnodi/danf.svg?style=flat
168[travis-url]: https://travis-ci.org/gnodi/danf
169[versioneye-image]:https://www.versioneye.com/user/projects/54da27f8c1bbbd5f8200020a/badge.svg?style=flat
170[versioneye-url]:https://www.versioneye.com/user/projects/54da27f8c1bbbd5f8200020a
\No newline at end of file