2. Get Started  page     

This guide introduces the most important aspects of JavaScriptMVC (JMVC) by creating a simple cookbook application. There's also a Rapid Start if you want a few quick how-tos. Or for an in depth example, read Organizing a jQuery Application.

The Video

Watch 2.0 Video Check out the JavaScriptMVC 2.0 video that walks you through much of the getting started guide.
It's an older treatment, but still touches on JMVC's strong points.

Basics

Before jumping in, there are some things you should know:

Purpose

JavaScriptMVC is for client side JavaScript development. JavaScriptMVC is our way of making quality, maintainable applications in the shortest amount of time.

Folder Structure

JMVC logically separates a basic app into following folder structure:

appname            - your app files
    \controllers   - organized event handlers
    \models        - manage data
    \resources     - helper scripts
    \test          - test files
        \funcunit  - funcunit tests
        \qunit     - qunit tests
    \views         - html templates
documentjs         - documentation engine
funcunit           - testing tool
jquery             - jquery and jQuery plugins (like $.Controller)
steal              - compression and build
P.S. Don't worry about creating an 'appname' folder yet. We'll do that in a second.

Sub Projects

JavaScriptMVC is comprised of 4 sub projects:

  • DocumentJS - A documentation engine
  • FuncUnit - A web testing framework
  • jQueryMX - jQuery MVC eXtensions.
  • StealJS - A code manager : dependency management, code cleaning, building, etc.

Plugins

Everything is a plugin. Just steal the ones you need. Plugins load their own dependencies and won't load duplicate files. It looks like:

steal.plugins('jquery/model',
  'jquery/view',
  'jquery/controller');
P.S. steal.plugins('a/b') adds a/b/b.js to your project.

License

JavaScriptMVC is MIT with the following exceptions:

These exceptions, although permissive licenses themselves, are not linked in your final production build.

Making a Cookbook

Lets get started by installing JavaScriptMVC.

© Jupiter IT - JavaScriptMVC Training and Support