Challenge Overview
Overview
The PxScene Showcase app will be an app that runs in pxscene (pxscene.org) that displays a functioning UI for browsing videos. It will be used by the client to show off the capabilities of pxscene on embedded devices.
This challenge will implement some REST / JSON services that will feed data into the UI. We will implement the services in Node and deploy them to Heroku
Data
The data will come from a couple different services on the client side. Samples will be provided in the forum. The data from the client-side will include much more data than is used in the UI. You should ensure that the data sent from the server to the client is only what the client needs, nothing more. Performance is important here.
The data from the customer server's is split between menus and elements. Samples will be provided in the forum.
We will need to make a few requests during the refresh
1. Get the root menu structure
2. Get the "Movies" menu
3. Get the list of submenus under "Movies". We'll use these as the categories (see below)
4. For each movie, ensure we get the full list of data needed for the UI (see below)
The data should be modified and stripped down to only what's essential *before* it's stored in Redis. This will speed up requests from the client UI and will cut down our memory usage in Redis.
Note for each category, we'll only grab the first 10 movies for each menu, not all of them. Some of the categories can contain way too many values to store all of them.
Images
Images in the UI will be retrieved using the Merlin ID from the customer data. Note that this API does not have to do anything with the images as the UI will handle creating the image URLs necessary at the right sizes.
Caching / refresh script
The data will be updated and cached in a Redis data store, making the UI as fast as possible.
A script must be available that we can schedule on Heroku or run manually to:
* Clear all data out of the Redis store
* Refresh the data in the Redis store
Storyboard
The data returned needs to support the UI outlined here:
https://marvelapp.com/376fchd/screen/34192959
If you have any questions about specific values or how things will map, please ask in the forum.
Movies
The main data in the datastore will be movies. Movies will contain:
* Title
* Synopsis
* Duration (in seconds)
* MPAA Rating (G, PG, PG13, R, NC17)
* Audience (Kids, all)
* Language (English, Spanish, etc...)
* Year
* Star rating (out of 5)
* Category
Categories
The API will need to be able to return a list of categories for movies. These categories will be loaded as part of the refresh, so they should not be hard-coded.
There needs to be a call to retrieve all movies for a particular category, or for a list of categories. Note that this does *not* correspond to the "category" value returned from the entity page for a movie. This is the menu of the movie.
Search
The API needs a search function to search the movies in the Redis datastore. The response should return movies in this order:
1. Movies where the title contains the search term
2. Movies where the description contains the search term
3. Movies where the category contains the search term
Swagger
Your solution must include a swagger file that can be used to test the various API calls.
Heroku
Your solution must be deployable on Heroku. Please ensure your deployment guide covers:
* Deployment to Heroku
* Running the refresh script
* Scheduling the refresh script using Heroku's scheduled tasks
Submission
Your submission must include:
* The source code
* Deployment guide for Heroku
* Swagger file and documentation
No video is required for this challenge