Tetra, a clean MVC javascript framework : http://viadeo.github.io/tetra/
JavaScript
Latest commit f1a56ee Dec 9, 2013 markomilicevic Add asyncModel support (asynchronous ajax calls) + regenerate release…
… with the new jQuery version (v1.10.2)
Permalink
Failed to load latest commit information.
examples Add missing blank lines at end of files Sep 26, 2013
lib JQuery library does not load in Opera 12.15 and IE 10 in IFrame which… Nov 6, 2013
release Add asyncModel support (asynchronous ajax calls) + regenerate release… Dec 9, 2013
spec/javascripts/support Upgrating jquery version for tests Dec 9, 2013
src Add asyncModel support (asynchronous ajax calls) + regenerate release… Dec 9, 2013
test Add missing blank lines at end of files Sep 26, 2013
.gitattributes Add missing blank lines at end of files Sep 26, 2013
.gitignore cleanup file system Jun 25, 2013
.gitmodules Refactorisation of Tetra.js file structure Jan 4, 2013
.travis.yml change rake command by removing sudo ;) Jun 25, 2013
AUTHORS Add missing blank lines at end of files Sep 26, 2013
Gemfile Add missing blank lines at end of files Sep 26, 2013
Gemfile.lock trying to fix travis CI tests Jun 25, 2013
Gruntfile.js Gruntfile.js modified with right jQuery path: lib/jquery/1.10.2/ Nov 6, 2013
LICENCE Add missing blank lines at end of files Sep 26, 2013
README.md Update README.md Aug 9, 2013
Rakefile Add missing blank lines at end of files Sep 26, 2013
Roadmap.md adding roadmap file Sep 26, 2013
bower.json Update bower.json, add description and license field Sep 26, 2013
index.js Refactorisation of Tetra.js file structure Jan 4, 2013
package.json Update repository URL in package.json Sep 5, 2013
testem.json Add missing blank lines at end of files Sep 26, 2013
testem.prototype.json Add missing blank lines at end of files Sep 26, 2013
tetra.png Update tetra logo for more awesomeness Apr 24, 2013

README.md

tetra logo Build Status

Tetra, a clean MVC javascript framework

Tetra aims to help developers build faster, more maintainable and better structured code.

Tetra is a complete MVC (Model, View, Controller) framework, normalizing all implementations through a simple structure that splits the code into 3 different layers :

  • View: DOM access and UX behaviors
  • Controller: Programmatic logic
  • Model: Structured data and Ajax requests

Each layer has access to a communication pipe linked to a potential listener, allowing asynchronous communication between each part of the application.

The Tetra.js framework is also Object-oriented, encouraging the developer to better separate and organise structured data and its associated logic. An ORM (Object-Relational Mapping) encapsulates Ajax transactions and ensures data consistency between front- and back-end.

Additionally, the "bootnode" feature allows JavaScript resources to be loaded dynamically, either through data attributes set on DOM nodes or via a dependency management system.

Slides about Tetra.js & Tetra UI for a quick overview: http://viadeo.github.com/tetra-slides/2012-11-20/

Tetra core tree

  • lib: External dependencies of the client-side framework.
  • src
    • conf: Tetra.js and RequireJS configuration files.
    • controller: Controller layer
    • model: Model layer
    • view: View layer
      • connectors: Abstracted library to use Tetra.js with librairies other than jQuery. Prototype and Node.js connectors are already implemented.
    • tetra.js: Core of Tetra.js framework, an interface that provides access to the MVC layers, framework extensions and debug features.

Configuration files are used to construct the core object needed to build mvc apps. It must have the following structure :

tetra.extend({
	conf: {
		env: 'jQuery',
		jsVersion: 347,
		enableBootnode: true
	}
}).start();

If the default settings are sufficient, you need only call the start function (as in /conf/default.js):

tetra.start();

Applications tree

By default, the Tetra.js framework expects a particular directory tree structure. Following this convention allows you to use the bootnode feature to dynamically load JavaScript resources.

  • tetramvc
    • apps
      • application name
        • controller: Controller classes of the application
          • ***.ctrl.js
        • model: Model classes of the application
          • ***.class.js
        • view: View classes of the application
          • ***.ui.js
    • model: Global model classes

Table of content

Licence

(The MIT License)

Copyright (c) Viadeo/APVO Corp., Olivier Hory and other Tetra contributors.

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.