2.1. Installing JavaScriptMVC  page     

Requirements

JavaScriptMVC requires Java JRE 1.6 or greater for:

  • Compression (Google Closure)
  • Selenium run FuncUnit tests
  • Easy updating
  • Code Generators

But your backend server can be written in any language.
Download Java here.

Getting JavaScriptMVC

There are 2 ways to get JavaScriptMVC:

We (and the community) would much prefer you to develop with git. JavaScriptMVC is built around modular development so it fits in perfectly with git development. Plus we can trade improvements really easy.

Downloading

Download the latest JavaScriptMVC. Unzip the folder on your file system or web server.
If you are using this on a webserver, unzip in a public folder where the server hosts static content.

PRO TIP: Unzip these files as high in your apps folder structure as possible (i.e. don't put them under a javascriptmvc folder in your public directory).

Installing JavaScriptMVC with GIT.

JavaScriptMVC is comprised of four sub projects:

You want to fork each project and add it as a submodule to your project in a public folder (where your server keeps static content). If these words mean nothing to you, or you'd like more explanation, you might want to read Developing With Git.

Forking the repos looks like:

git submodule add git@github.com:_YOU_/steal.git public/steal
git submodule add git@github.com:_YOU_/jquerymx.git public/jquery
git submodule add git@github.com:_YOU_/documentjs.git public/documentjs
git submodule add git@github.com:_YOU_/funcunit.git public/funcunit

Notice that the javascriptmvc repository is put in a jquery folder.

After installing the repository, run:

[WINDOWS] > steal\js steal\make.js

[Lin/Mac] > ./steal/js steal/make.js

Verifing the install

In your public (or static) folder, you should have something that looks like:

static
  \documentjs - DocumentJS library
  \funcunit   - FuncUnit testing library
  \jquery     - jQuery and MVC plugins
  \steal      - compression and build system
  \js.bat     - Windows Rhino shortcut
  \js         - Mac/Linux Rhino shortcut

Updating JavaScriptMVC

We are constantly improving JMVC. If you're using git, you can just pull changes. Otherwise, to get the latest, most error free code, in a console, type:

C:\workspace\Cookbook>js documentjs\update
C:\workspace\Cookbook>js funcunit\update
C:\workspace\Cookbook>js jquery\update
C:\workspace\Cookbook>js steal\update
P.S. If you are using linux/mac you want to use ./js and change \ to /.

Continue to Creating Cookbook.

© Jupiter IT - JavaScriptMVC Training and Support