Skip to content

Instantly share code, notes, and snippets.

@cooncesean
Created November 5, 2014 22:26
Show Gist options
  • Save cooncesean/f670ce16fe0b1370ccf4 to your computer and use it in GitHub Desktop.
Save cooncesean/f670ce16fe0b1370ccf4 to your computer and use it in GitHub Desktop.
Guidebook backbone challenge.

Backbone Code Challenge

Can you build a small project that allows the current user to create/update/delete a number of Guides? Each Guide can contain a single Schedule object and schedules can have multiple Events.

Implement view layer logic that accepts inputs from the DOM, fetches data from the API and updates the ul#guide-list unordered list.

DOM Assumptions

For this project, assume you have a DOM like so:

<input type="text" id="guide-name" placeholder="Create New Guide" />
<input type="button" id="submit-btn" value="Save Changes" />

<ul id="guide-list"></ul>

The API

Guides

List Endpoint: /api/guide/

  • GET returns a list of guides for the current user
  • POST w/ valid data returns a new Guide object

Detail Endpoint: /api/guide/<id>/

  • GET returns the details for a specific guide
  • PUT w/ valid data updates an existing Guide object

Schedules

List Endpoint: /api/schedule/

  • GET requires guide querystring param; returns a list of schedules for the specified guide
  • POST w/ valid data returns a new Schedule object

Detail Endpoint: /api/schedule/<id>/

  • GET requires guide querystring param; returns the details for a specific schedule
  • PUT w/ valid data updates an existing Schedule object

Events

List Endpoint: /api/event/

  • GET requires schedule querystring param; returns a list of events for the specified schedule
  • POST w/ valid data returns a new Event object

Detail Endpoint: /api/schedule/<id>/

  • GET requires guide querystring param; returns the details for a specific schedule
  • PUT w/ valid data updates an existing Schedule object
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment