For this homework, do the following.
Integrate code from your solutions to homework 2 and labs 7–9 to build an app that pulls games from the Monopoly data services, gives details on those games, and allows the user to delete a game, both locally (in the app) and on the data service. See an example in the image to the right. Do this as follows.
npm install
and
npm start
to start the
service.
localhost:3000
in a browser.
sql/monopoly.sql
). Note that if you had
problems updating the schema in the lab, using the
default monopoly schema is sufficient for this
homework.
GET /games
- Returns a list of
all games (cf., getPlayers
).
GET /games/:id
- Returns
the name and score for every player who
played in the specified game (e.g., the
example on the right shows the list of
players from game 2).DELETE /games/:id
- Deletes a
specific game (cf.,
deletePlayer
).
README.md
, sql/monopoly.sql
, and
monopolyService.ts
into your class submission
repo under cs262/homework3/service/
.
cs262/homework3/games-app
sub-directory (replacing “items-app”
throughout the codebase).
GET /games
. This
requires that you update:
games
list (rather than
the items list from the homework 2).
GET /games/:id
. This
requires that you update:
fetchPlayers
function
that gets the players for a given
game. You’ll need to call this
function after the app has started,
so use useCallBack
(see
the discussion of this in unit 5).
DELETE /games/:id
, and then,
only when that succeeds, to delete the game
from the local client state (as you did in
homework 2).
cs262/homework3/games-app/
.
These upgrades are rather complicated, so try asking Copilot to add the each feature and then to explain what it did. As usual, don’t accept just anything.
Do all of this in a homework3/games-app/
sub-directory. When you have the app running on your device,
save a screen shot of your game details screen for one of the
games (homework3/screenshot.png
), and add a new
readme file (homework2/README.md
) that answers the
following questions.
monopolyDirect.ts
(simpler) rather
than using this Web service (more complex)? Why
or why not?
deleteGame
and
fetchPlayers
using
useCallBack
. What good does this do?
Review the sprint 3 and presentation deliverables from the other team you are reviewing (see project deliverables #3 & #4) and consider the following.
Post your review to their Slack #stakeholders
channel and be prepared to explain your review to them during
their team meeting in lab 11.
Review your teammates with respect to the same aspects of
their
work on your team as you as you have done before.
Include this
in a new tab named homework3
added to the
spreadsheet you submitted for homeworks 1 & 2.
Remember to
download “All sheets”.
We will grade your work according to the following criteria:
To give you time to attend and assess your stakeholder team’s presentation, we will extend the deadline for this homework assignment until Monday.