Challenge Overview

Project Overview

The goal of this project is to design and build an iPad application that will allow the USA Diving team to track the performance of divers as they prepare for official diving events and Olympic trials. Closely monitoring the day-to-day well-being and performance of divers in training will allow coaches and physicians to adjust individual training programs, for improved results.

Competition Task Overview

For this challenge, we need to build the backend RESTful services to be consuded by the frontend / iOS app.

In general we need you to do the following:

  • Design the data model / database schema (you must provide sql scripts to create / drop / clear db tables and insert / clear test data)
  • Design and implement the backend services as RESTful web services using Node.js
  • We'll use Postgres for database
  • We'll store videos to Amazon S3 and store links in this app. Videos should not be public.
  • The backend services will run on Heroku
  • We do not have an architecture for this challenge so asking questions early in the forum is important for you to understand the tasks.

Data Model

You will need to go through the storyboard and find out what exact field / data columns need to included in the data model. I believe we'll at least need to have the following data models in the database:

  • coach: note coach is different from user, because a coach can login and manage diver but divers cannot login
  • diver: note "Coach of Record" field is not needed and will be removed from the UI, so it's not needed in the data model either
  • session: this is basically a group of dives with some additional fields like injury report / notes for the whole session
  • dive: this represents a single dive.

REST API Guidelines

Header: Content-Type=“application/json”

Standard HTTP response codes are used to indicate success and error conditions. Specifically the following HTTP response codes will be used:
- 200 OK - if the request was successful
- 400 BAD REQUEST - if there was problem with the request (e.g. malformed or some parameters are missing)
- 401 NOT AUTHORIZED - if the request didn't bear authentication information (in cookie) or the authentication information is invalid.
- 403 FORBIDDEN - if the requesting user didn't have permission to perform the requested operation
- 404 NOT FOUND - if the resource in request did not exist
- 405 METHOD NOT SUPPORTED - if the request was made via an unsupported HTTP method
- 500 INTERNAL SERVER ERROR - if the request was properly formatted, but the operation failed on the server side

REST API Details

  • Coach
    • Register
      • POST /api/v1/coaches
      • Creates a new coach
    • Login
      • POST /api/v1/login
      • Logs the coach into the app
    • Logout
      • POST /api/v1/logout
      • Logs out the coach
  • Diver
    • Get divers
      • GET /api/v1/divers
      • Gets the list of divers for the coach
    • Create diver
      • POST /api/v1/divers
      • Creates a new diver
    • Get diver details
      • GET /api/v1/divers/{diverid}
      • Gets details for the diver
    • Delete diver
      • DELETE /api/v1/divers/{diverid}
      • Deletes the diver
    • Update diver
      • PUT /api/v1/divers/{diverid}
      • Updates the diver
  • Session
    • Get sessions
      • GET /api/v1/divers/{diverid}/sessions
      • Gets the list of sessions for the diver
    • Create session
      • POST /api/v1/divers/{diverid}/sessions
      • Creates a new session
    • Get session details
      • GET /api/v1/divers/{diverid}/sessions/{sessionid}
      • Gets details for the session
    • Delete session
      • DELETE /api/v1/divers/{diverid}/sessions/{sessionid}
      • Deletes the session
    • Update session
      • PUT /api/v1/divers/{diverid}/sessions/{sessionid}
      • Updates the session
  • Dive
    • Get dive
      • GET /api/v1/divers/{diverid}/sessions/{sessionid}/dives/{diveid}
      • Gets the list of dives for the session
    • Create dive
      • POST /api/v1/divers/{diverid}/sessions/{sessionid}/dives
      • Creates a new dive
    • Get dive details
      • GET /api/v1/divers/{diverid}/sessions/{sessionid}/dives/{diveid}
      • Gets details for the diver
    • Delete dive
      • DELETE /api/v1/divers/{diverid}/sessions/{sessionid}/dives/{diveid}
      • Deletes the dive
    • Update dive
      • PUT /api/v1/divers/{diverid}/sessions/{sessionid}/dives/{diveid}
      • Updates the dive
    • Upload Video
      • POST /api/v1/divers/{diverid}/sessions/{sessionid}/dives/{diveid}/videos
      • Uploads a video for this specific dive, the video should be saved to Amazon s3 and link is stored inside the dive model
    • Delete Video
      • DELETE /api/v1/divers/{diverid}/sessions/{sessionid}/dives/{diveid}/videos
      • Deletes the video associated with the dive
  • Misc
    • Sync Data
      • POST /api/v1/misc/syncdata
      • This will sync data with the server. We just need some basic sync mechanism here, for example we can store latest modified date as revision for the whole dataset, and if the data on iPad is newer we simply push all data (including videos) from iPad to the server; otherwise we do nothing (i.e. this only pushes data and never pulls). If possible this api should provide progress back to the caller
    • Send Report
      • POST /api/v1/misc/sendreport
      • All the data is first synced with the server (i.e. same process as the Sync Data process.
      • The backend is triggered to create and email a report to a pre-configured list of email addresses. The report will contain dive statistics for all divers the coach is managing (including information from the health / injury reports). If possible this api should provide progress back to the caller.

Technology Overview

  • Heroku
  • Postgres
  • Nodejs
  • Amazon S3

Documentation Provided

Register to see documents in the forum.



Final Submission Guidelines

Submission Deliverables

Below is an overview of the deliverables:

  • Full code that covers all mentioned requirements
  • Code must be well documented
  • REST API document and postman file
  • SQL scripts for the database
  • A complete and detailed deployment document explaining how to deploy the application including configuration information.

Final Submission

For each member, the final submission should be uploaded via the challenge detail page on topcoder.com.

ELIGIBLE EVENTS:

2016 TopCoder(R) Open

REVIEW STYLE:

Final Review:

Community Review Board

Approval:

User Sign-Off

SHARE:

ID: 30052267