Skip to content

Step 1: Create Your SproutCore Application

jcrosby edited this page Sep 12, 2010 · 18 revisions

In this first step we are going to create your basic SproutCore application. SproutCore comes with a full set of generators that makes this really easy to do. On your terminal just type (or copy and paste) the following:

sc-init todos

Now you’ve created a new todos application. If you open this directory you should see a structure that looks something like this:

apps       <- your application is here
Buildfile  <- config file for your project
README     <- fill in with some useful details
public     <- static files not managed by build system

In SproutCore, an application is an individual web page that users will load in the web browser. A SproutCore project can contain as many apps as you want. Large projects will often have several, but small ones like this one usually only have one.

The sc-init tool added a starter application for you. You can find it in the apps/todos directory. Open this directory and you will find the following files:

core.js         <- defines app namespace and global constants
english.lproj/  <- all localized resources go here
  loading.rhtml <- html to display while app is loading 
  main_page.js  <- apps main page UI design
  strings.js    <- localized strings
main.js         <- main function, run on page load

Testing Your App

You’ve created a basic app. Let’s get load it in the browser so that you can try it out. In your terminal type the following:

cd todos
sc-server

visit: http://localhost:4020/todos

Continue to Next Step: Step 2: Setup Your Model »

Related Links

none yet

Comments

edit page to add your comments here.