Giter Site home page Giter Site logo

tetra's Introduction

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.

tetra's People

Contributors

blustemy avatar ecamper avatar ohory avatar redking avatar slyg avatar thaume avatar tregagnon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tetra's Issues

Data is not anonymised in the fixtures

Hello,

this is more an FYI than an issue.

I was googling someone to try and find his address... and I've found it in one of your fixtures files (https://github.com/viadeo/tetra/blob/master/test/fixtures/apps/contactslist/response.json).

I guess this is the kind of things (names, emails, positions...) that should be anonymised.
Not sure these people would like to know that some of the information they marked as private (email) in Viadeo is publicly available through GitHub...

P.

tetra_popin : lose static popin context

Follow this :

  1. Display a static popin with content from the data-target-id
  2. Display an external popin with content from the data-target-url
  3. Close the visible popin
  4. Display the previous static popin

There we are. The context of the static popin is lost.
Indeed, there is no more html content in the element.
Consequently the static popin content is empty.

Please, keep me updated.

Cheers.

generic_autocomplete

2 fixes need to be made in generic_autocomplete.js
1/ replace .html() by .text() when clicking on suggestion and updating the value in the input field : prevent & from becoming & in the field.
2/ remove the encodeURIComponent , coz it seems to "double encode" the string when doing the query.

These changes has been commited on svn, but not through github.

I need processData and contentType property on ajax query

I'm trying to upload files via a FormData object but the model is throwing an error when I do :
Uncaught TypeError: Illegal invocation
It seem that I need to set the processData en contentType property of the ajax jQuery object to false to avoid the issue but they're not taken in account when I set this in the model.

Remove NodeJS code

They are many conditions in the code to allow execution of Tetra in a NodeJS environment. But Tetra doesn't seem to be used in NodeJS. There are libraries more suited for this environment.

We might simplify the code by removing NodeJS specific code, and only allow use of Tetra in the client.

Dom access method has weird behavior

use case :
_(window).scrollTop is a function at page load but becomes undefined when some native events like click are fired.

This use case occurs on Viadeo and may be affected by some tetra modules (just in case).

Bower package

It could be great to have a bower package for tetra.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.