/GameBook

CS4261 Project

Primary LanguageJavaScript

backend stuff

summary:

Scrape RAWG API for a couple dozen games and store those in DB.

functions: (API endpoints)

  • getGameList(listType : string) -> list[game]:

    • returns a list of json objects of list type
    • list type values can be ("trending", "popular", something else?)
    • these list values can be hardcoded
  • getGameReviews(gameId : int) -> list[Review]:

    • returns a list of "Review" object of a given game
  • getUserReviews(username : string) -> list[Review]:

    • returns a list of "Review" object of a given user
  • submitReview(review : json) -> bool:

    • insert review as entry in review database
    • update rating in game
    • return True if success
  • createUser(username, password) -> bool:

    • insert user as entry in user database
    • return True if success
    • return False if username is already in database
  • login(username: string, password: string) -> user:

    • make sure username/password combo is correct in database
    • return user object if correct
    • else return nothing

objects: (table in DynamoDB)

  • Review

    • text : string (max 255 characters, tweet-like)
    • username: string (user)
    • gameId: int
    • platform: string
      • valid: pc, xbox-one, xbox-series-x, playstation4, playstation5, nintendo-switch
    • rating: number
    • sample: { id: 1, text: "Portal is great on the xbox", username: "Justin", gameId: 1, platform: "xbox-series-x", rating: 4.5 }
  • User

    • username: string (unique)
    • password: string
  • Game (mostly parse from https://api.rawg.io/docs/#operation/games_read)

single table with PK: game, SK: review?

Icons from Icons8: https://icons8.com/icon/101322/xbox