Full stack development: how to decide whether some code should go in the front end or back end? : <p>For example, say you're building a Plex/Kodi-like web app. Your backend consists of a database with a CRUD API on /movies, so GET /movies returns all movies in the db, GET /movies/:id returns a specific movie by ID, etc. Now you want to implement the ability to sort the movies by genre, title, release date, etc. Should the front end just GET /movies and then do the sorting, or should the backend provide a new API method like GET /movies/{byTitle, byGenre, byReleaseDate} that returns a sorted list?</p>

<p>This is a specific example but I would also be interested in knowing how to decide where to put code in general when working with a full stack. Should things only be client side if they absolutely must be?</p>
