When a user is viewing an individual media on the application, they will also see a list of related media on the same page. The related media list will consist of other media records that belong to the same genre as the given video and is sorted by the highest number of views. For this feature, we will need to integrate a full-stack slice that retrieves the relevant list from the Media collection in the backend and renders it in the frontend. In the following sections, we will add a related media list API in the backend, along with a way to fetch this API in the frontend, and a React component that renders the list of media retrieved by this API.
Listing related media
The related media list API
We will implement an API endpoint...