{"id":16968505,"url":"https://github.com/squallstar/backbone-skeleton","last_synced_at":"2026-04-12T14:32:35.747Z","repository":{"id":9119695,"uuid":"10904959","full_name":"squallstar/backbone-skeleton","owner":"squallstar","description":"A nice Backbone skeleton boilerplate to let you start with your new webapp in a few seconds","archived":false,"fork":false,"pushed_at":"2013-09-13T13:57:04.000Z","size":324,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-26T13:13:02.499Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"codrops/ImageGridEffects","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/squallstar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"License.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-06-24T10:16:38.000Z","updated_at":"2013-10-04T02:25:04.000Z","dependencies_parsed_at":"2022-07-09T23:00:32.205Z","dependency_job_id":null,"html_url":"https://github.com/squallstar/backbone-skeleton","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squallstar%2Fbackbone-skeleton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squallstar%2Fbackbone-skeleton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squallstar%2Fbackbone-skeleton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squallstar%2Fbackbone-skeleton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/squallstar","download_url":"https://codeload.github.com/squallstar/backbone-skeleton/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244844531,"owners_count":20519790,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T00:12:18.258Z","updated_at":"2025-12-30T23:56:45.479Z","avatar_url":"https://github.com/squallstar.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Backbone Skeleton App v0.3\n\nA skeleton for your new Backbone app that provides everything you need just out-of-the-box.\n\n## 1. How it's made\n\n### 1.1 Grunt\n\nGrunt is a Javascript task-runner and the main compiler tool of this skeleton app. You'll need to install it in order to build the product.\n\n### 1.2 Backbone\n\nAll your scripts must be written using **Coffeescript**. The MVC can be found here:\n\n    src/coffee/\n    \nFeel free to use **jQuery** and **Underscore.js** as you like as they're both included.\n\n### 1.3 Handlebars\n\nTemplate engine, the templates can be found here:\n\n    src/templates/\n    \nThe templates will be compiled by trimming the **.hbs** extension from their paths as follows:\n\n    src/templates/foo/bar.hbs\n    \nWill be available as:\n\n    window.Tpl['foo/bar']\n    \n### 1.4 Sass\n\nSource files are located here:\n\n    src/sass\n    \nPlease note that only the **main.scss** file will be compiled, which means that every other sass file will need to be imported somewhere (like the main.scss file).\n\n### 1.5 Images sprite\n\nEvery PNG file contained into the **src/sprites** will be used to build a single sprite image file, plus the CSS to use that image will be automatically prepended to the application main css file. You can use the images simply like this:\n\n    src/sprites/foobar.png\n    \n    .sprite-foobar\n\nNormal images will be copied from the **src/img/** folder to **build/img/**.\n\n---\n\n## 2. App Config file\n\nThe config file can be found here:\n\n    src/config/\u003cenvironment\u003e/config.js\n    \nThe environment (**development** or **release**) will be chosen automatically by **Grunt** once you compile the source code.\n\n---\n\n## 3. Getting started\n\nTo compile the source code, you'll need npm (which comes with node.js), grunt, imagemagick and some other packages installed on the system.\nYou will also need **Ruby**, just because **Sass** is a Ruby Gem.\n    \n    # Sass gem (requires ruby)\n    gem install sass\n    \n    # Install Homebrew (brew)\n    ruby -e \"$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)\"\n    \n    # Install Imagemagick\n    brew install imagemagick\n    brew install graphicsmagick\n\n    # Install Grunt (system-wise)\n    npm install -g grunt-cli\n    \n    # Install Grunt plugins required by the app\n    npm install .\n    \n\n#### Build the product\n    \nYou can compile the sources by running\n    \n    $ grunt build\n    \nAnd everything will be compiled into the **build** folder.\n\n#### Start a watch job for continuous deployment:\n    \n    $ grunt watch\n    \nBy using the watch job, the build will be trigger automatically once you add/modify/delete a file from the **src** folder.\n\n\n#### Build for release\n\nTo build the product for release, just use\n\n    $ grunt build:release\n\n#### Run the product\n\nTo run the product, open the application index file in your browser:\n\n    $ open build/index.html\n\n--\n\n#### Deploy the product\n\nTo build the project for release and deploy it to a folder, use this syntax:\n    \n    $ grunt deploy:/path/to/dir\n    \n---\n\n## 4. Development\n\n#### 4.1 Boot and router\n\nThe application boot file is **src/coffee/boot.coffee** and as you can see it just creates a new instance of the router and it starts it.\nThe router file is **src/coffee/routes/router.coffee** and adding a new route is easy as follows:\n\nFirst of all, add a new line specifying the route and the method to call:\n\n    routes:\n        '': 'home'\n\n        # new route\n        foo: 'bar'\n\nThen, in the same file create the **bar** method as follows:\n\n    bar: -\u003e\n        # Do your stuff here\n\nWithin a method, you will usually create a new instance of a view, render it, and then you will add the rendered element inside the DOM **#container**:\n\n    bar: -\u003e\n        $('#container').html new MyView().render().el\n\n---\n\n#### 4.2 Creating your controller: the view\n    \nIn Backbone, a view is what usually the Controller is in a **MVC** architecture.\n\nStart by creating a **myview.coffee** file in the **src/views/** folder:\n\n    class window.MyView extends Backbone.View\n\n        initialize: -\u003e \n        \n        render: -\u003e  \n            @$el.html window.Tpl['foo'] {\n                hello: 'world'\n            }\n        \n            @\n\nAs you can see, the **render** method will fill up the **@$el** with the compiled template.\n\nIn backbone, the **@el** element is your view container, while the **@$el** is its **jQuery** object.\n\nRemember to return the class instance at the end of the render method writing a **@** or **this** (which is the same).\n\nThe **foo** handlebar template used in the above example should be placed there:\n    \n    src/templates/foo.hbs\n    \nSome helpers for handlebars have been written; you can find all of them here: **src/coffee/helpers/handlebars.hbs**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquallstar%2Fbackbone-skeleton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsquallstar%2Fbackbone-skeleton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquallstar%2Fbackbone-skeleton/lists"}