2024 03 07 - TheEvergreenStateCollege/upper-division-cs-23-24 GitHub Wiki

Week 09 - Thursday

7 March 2024

Web Front-End - Morning Session

  • Why Allow Logins

    • User-specific Data.
    • Examples:
      • Youtube Recommendations, Amazon wishlist, Redfin rental listings
    • Brainstorming activity: visit a site that lets you save favorites and gives you recommendations in one of two ways
      • incognito / private browser tab.
      • logged in with your account
    • What are the different experiences like to you, as a user / customer?
  • Construct a hard-coded JSON with two items to represent what a user contributes or saves to your final project.

    • For example, in the CityGuessr example we've been working on in class, we'll allow users to contribute new cities.
[
 {
      "id": 12357,
      "name": "Barstow",
      "createdAt": "2024-03-05T17:56:43.302Z",
      "latitude": 34.8661,
      "longitude": -117.0471,
      "population": 25235,
      "authorId": 1
    },
    {
      "id": 12358,
      "name": "Avon Lake",
      "createdAt": "2024-03-05T17:56:43.322Z",
      "latitude": 41.4944,
      "longitude": -82.0159,
      "population": 25220,
      "authorId": 1
    }
  ]

Use the fields in your schema.prisma file.

  • Create an HTML page (for Lap 1 students) or a React parent+children component (Lap 2 students) for your final project, that renders this hard-coded JSON.
  • Continue building on this for your final project.

  • If your API server already serves this data, switch your front-end to fetch a call to your endpoint

    • We recommend /api/profile , passing in a Bearer token from previously logging in.
    • For more details about storing and using a Bearer token in localStorage, see last week's notes.

Web Infra - Afternoon Session

  • Export Thunderclient to Postman
  • Run Newman
  • Jest Unit Tests