Skip to content

webpolis/daturajs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

| This is outdated. It has more than 7 years. But it still works as it is.

| I'm obviously not doing anything else here since technology has changed a lot.

| It may be useful for someone who's willing to try something else.

nodejs application framework (aka daturajs)

Author: Nicolas Iglesias <nfiglesias@gmail.com>

Introduction

This framework is somehow inspired in the MVC pattern, followed by some PHP frameworks - CakePHP, Yii -. The base concept is to provide an easy to mantain and extensible application framework purely based on the Javascript language - and its father ECMAScript (http://www.ecmascript.org/) -. Due to the different natures of PHP and JS, some developers might find the js OOP patterns hard to follow, so some good knowledge of this subject is required in order to use daturajs.

By default, daturajs includes REST support so it's good for applications offering a REST API endpoint, providing you the opportunity to separate business logic from the presentation layer, and also serving your API to other clients such a mobile app or PHP application.

And if you're still wondering why this framework is so different from the others, daturajs provides a command line application which generates a fully functional app skeleton based on your database schema configuration. Not original, right? Well, daturajs is delivered with AngularJs - http://angularjs.org - support, so you'll get a full featured UI, with grids and modular forms so you can be up and running in a matter of minutes.

You won't believe how easy is to build a fast, modern and powerful application.

Directory structure

Not being that far from its PHP counterparts, daturajs provides an understandable tree, containing most common folders for a web framework - althought this framework it is not only intended to be used in websites -. The current status of the project reflects the following structure:

lib Core libraries and modules for custom framework implementation. No modifications may be needed to be done by the developer.

doc Framework's documentation.

adapters ORM adapters, etc. Many will be added in the future.

components Core components widely used, including authentication.

console Scripts that will generate models, controllers and views. More features will be added in the future - generate full app skeleton -.

helpers Useful libraries (html, menu, etc).

controllers Basic setup of application's controllers

rest

models Basic setup of application's models.

node_modules All nodejs libraries and dependencies are stored here.

public This folder is publicly accessed via GET /

css

img

js

src Most of your custom development tasks occur here.

assets Assets that require some processing before being made public.

less Lesscss file that will be compiled into /public/css.

config main.js is the setup file for your application. routes.js contains specification for URL paths and actions taken when receiving specific requests.

controllers Your controllers will reside here.

rest If you need a REST API, this is the place to go.

models ORM specific models.

views This framework use the 'ejs' template system. Support for new engines is planned for the future.

elements Atomic elements to be included in your views.

layouts The templates for your views.

static Static pages should reside here.

Installation / Setup

After you checkout or decompress the daturajs package, you must resolve all dependencies by issuing the following command:

npm install -d

Application Skeleton generator

The application generator will let you setup your application in a few minutes. You'll end up by providing a rich-featured UI, built on top of AngularJS, serving a fast & powerful AJAX-based CRUD interface... without writting a piece of code! Run this command without arguments to see how you can customize your new app.

node ./lib/console/generator.js

Run / Execution

Since daturajs is a pure nodejs framework, there is no need to have an instance of a www server running - nginx, apache, etc -. The only method to make it work is by issuing the following command:

./start.sh

This file is generated by the application generator, so please check your valid port numbers when running it.

Documentation

Please check our Wiki or start here: https://github.com/webpolis/daturajs/wiki/Guide

LICENSE

(MIT License)

Copyright (c) 2013 Nicolas Iglesias nfiglesias@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.