Smart Platform Management - FAQ

Table of Contents

  1. Configuring your Application
    1. DNS
    2. Where do I get Git?
    3. Why Git?
    4. Pushing your Code for the First Time
  2. Developing your Application
    1. Local Development
    2. Disk Layout and Directory Structure
    3. Hello World
    4. Where can I get help?
  3. Open Source Software
    1. Can I get the source code to the platform?
  1. Configuring your Application

    1. DNS

      If your application's hostname exists under the smart.joyent.com domain (for example, photos.smart.joyent.com) the DNS will automatically work.

      If you'd like to use a hostname that you manage, for example, foo.com you must configure your DNS with a CNAME record pointing to smart.joyent.com.

    2. Where do I get Git?

      Git is a free software version control system. If you're running on a Unix you may already have a copy, otherwise you can download it from the Git website online.

    3. Why Git?

      Many people have asked the question Why Git?. Implicit in that question is another: "Why not something else?"

      In truth, because the options are somewhat limited. The deployment and version control system must be distributed. We use the distributed nature of git to keep your applications in sync throughout the full cluster. It also allows you, the developer, to develop locally with no limitations.

    4. Pushing your Code for the First Time

      When you create your application's host, there won't be any code there. You'll need to git push before your application gets started. First of all you'll need some code of course, so follow the disk layout convention, and maybe write yourself a simple Hello World example.

      Once you have code, you'll need to initialize git and get it set up to use the cloud. This isn't as hard as it may sound. First of all issue a git init command in your application's top-level directory. Then git add all the appropriate files. Finally, you need to push the application to the cloud.

      To do this, configure the repositories remote settings to the repository stated on the Application's page, and the issue a git push origin master:refs/heads/master command. Your application should make it's way to the cloud and be live on the internet, in full color, very shortly.

  2. Developing your Application

    1. Local Development

      Developing things on your local machine makes things much easier. For those of you who use Mac OS X we've made things much easier by developing a pre-built GUI version of the Smart Platform, which you can download here.

      For those of you using other operating systems, the Smart Platform is Open Source, so you can build your own installation very easily, while we put together a pre-built version for you.

    2. Disk Layout & Directory Structure

      Your application, and therefore your git repository should have the following structure:

      • js/
        • bootstrap.js
      • web/

      Your main code goes into bootstrap.js, and any code loaded at runtime will come either from the JSP library, or your js directory.

      Any calls to the system.filesystem extension API use the web directory as their root path.

    3. Hello World

      To write a simple, hello world application is trivial. Following the Disk Layout question above, simply edit your bootstrap.js file, and insert the following code:

      function main( aRequest ) {
        return "Hello World";
      }
      

      That, trivial Hello World example will answer any request with the canonical, time-tested greeting.

    4. Where can I get help?

      We keep a regular eye on the Smart Platform topic on the Joyent Community Forums.

  3. Open Source

    1. Can I get the source code to the platform?

      Yes! The source code to the platform and it's supporting infrastructure is available on GitHub from the Joyent account.