Week 7 Homework

Finish the Kellogg course reviews API we started in the lab this week.

Getting Started

Begin by heading over to the starter project – select "Use this template", then create a repository in your own GitHub account called hw7. Clone this project and open it in VSCode.

Open a VSCode Terminal and (making sure you're in the right project directory) type npm install – don't skip this step! – this will install all the necessary software needed to run the back-end application. Then, type netlify dev to start the back-end server.

In /netlify/functions/firebase.js, replace the Firebase configuration from your own project, which can be found in your Firebase project settings.

You'll find a possible solution for the lab as a starting point. See the domain model in the code comments, and make sure that your own Firestore database mirrors this structure. Then, open the code for the lambda function, located in /netlify/functions/courses.js and get coding!

The Goal

An API endpoint that lives at /.netlify/functions/courses that provides data on a course and its lecturers and reviews. Finish what we started during the lab, by adding reviews for each section, as well as a number of reviews and an aggregate rating for each course and each of their sections.


  1. (1 points) Write the recipe (algorithm) for your approach in the comments. Do this first!
  2. (3 points) Add the reviews for each section to the result.
  3. (3 points) Add the aggregated number of reviews and average rating for the course
  4. (3 points) Add the aggregated number of reviews and average rating for each section of the course

Guidelines for Submission

All your work should take place in /netlify/functions/courses.js; i.e. that should be the only file that's modified from the original project template. Your finished product should live in your GitHub account at https://github.com/<your GitHub username>/hw7, and this URL should be submitted as the "website URL" for this assignment in Canvas.