You are previewing Backbone.js Blueprints.
O'Reilly logo
Backbone.js Blueprints

Book Description

Everything you need to know about building front end apps in Backbone.js is contained in this book. Packed with projects, code, and sound explanations, it’s the essential guide to this indispensable JavaScript library.

In Detail

Backbone.js is an open source, JavaScript library that helps you to build sophisticated and structured web apps. It's important to have well-organized frontend code for easy maintenance and extendability. With the Backbone framework, you'll be able to build applications that are a breeze to manage.

In this book, you will discover how to build seven complete web applications from scratch. You'll learn how to use all the components of the Backbone framework individually, and how to use them together to create fully featured applications. In addition, you'll also learn how Backbone thinks so you can leverage it to write the most effi cient frontend JavaScript code.

Through this book, you will learn to write good server-side JavaScript to support your frontend applications. This easy-to-follow guide is packed with projects, code, and solid explanations that will give you the confi dence to write your own web applications from scratch.

What You Will Learn

  • Discover seven different ways to create your own frontend Backbone.js applications
  • Create complex interfaces while keeping the code adaptable through Backbone Views
  • Control your applications' screens with simplicity through a Backbone router
  • Utilize Marionette and Chaplin, the Backbone extension frameworks
  • Build a Node.js server to manage the models your frontend application sends to it and requests from it
  • Work with templates that manage the heavy lifting of your view
  • Precompile your view for extra efficiency
  • Use Backbone extension libraries to create effective applications with less coding
  • Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at If you purchased this book elsewhere, you can visit and register to have the files e-mailed directly to you.

    Table of Contents

    1. Backbone.js Blueprints
      1. Table of Contents
      2. Backbone.js Blueprints
      3. Credits
      4. About the Author
      5. About the Reviewers
        1. Support files, eBooks, discount offers, and more
          1. Why Subscribe?
          2. Free Access for Packt account holders
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Conventions
        5. Reader feedback
        6. Customer support
          1. Downloading the example code
          2. Errata
          3. Piracy
          4. Questions
      8. 1. Building a Simple Blog
        1. Setting up the application
        2. Starting with the server
        3. Creating the template
        4. Adding the public folder
        5. Beginning the Backbone code
          1. Creating a model and collection
        6. Performing a quick and dirty test
        7. Writing some views
          1. The PostListView class
          2. The PostsListView class
        8. Using our views
        9. Creating a router
        10. Viewing a post
        11. Creating new posts
        12. Adding comments
          1. Serving comments
          2. Comment views
        13. Summary
      9. 2. Building a Photo-sharing Application
        1. Creating user accounts
        2. Creating our application navigation
        3. Uploading photos
        4. Sending photos from the server to the client
        5. Creating profile pages
        6. Creating the individual photo page
        7. Following users
        8. Displaying a followed user's photos
        9. Summary
      10. 3. Building a Live Data Dashboard
        1. Planning our application
        2. Setting up precompiled templates
        3. Creating the models
        4. Creating controls
          1. Including Bootstrap
        5. Starting the router
        6. Building the CreateEventView class
        7. Creating the events table
        8. Deleting a record
        9. Editing event records
        10. Making it live
        11. Sorting events
        12. Summary
      11. 4. Building a Calendar
        1. Planning our application
        2. Creating the model and collection
        3. Creating the month view
          1. Building the week row
          2. Building the day cells
        4. Creating the individual day screen
        5. Writing the server code
        6. Summary
      12. 5. Building a Chat Application
        1. Outlining the application
        2. Setting up the application
        3. Preparing our template
        4. A word about Socket.IO
        5. Creating modules
        6. Creating users
        7. Building the layout
        8. Starting the router
        9. Letting users join the fun
        10. Joining a room
        11. Building the chat module
        12. Back to the controller
        13. Adding some other routes
        14. Writing CSS
        15. Summary
      13. 6. Building a Podcast Application
        1. What are we building?
        2. Building user accounts
        3. Subscribing to and storing podcasts
        4. Preparing index.ejs
        5. Creating our models and collections
        6. Building the navigation
        7. Displaying podcasts
        8. Creating a layout
        9. Beginning the router
        10. Subscribing to new podcasts
        11. Displaying the list of episodes
        12. Displaying episodes
        13. Summary
      14. 7. Building a Game
        1. What are we building?
        2. User accounts
        3. Templates
        4. Creating the game data
        5. Writing the models
          1. Splitting up words
        6. Writing the tokens view
        7. Views of the clues
        8. Creating the guess view
        9. Building the info view
        10. Wrapping our views in a GameView class
        11. Starting the router
        12. Creating the home view
        13. Building a scoreboard
        14. Writing the navigation
        15. Adding new words
        16. Summary
      15. Index