Skip to content

API ~ User Stories

Gio Maya edited this page Nov 27, 2023 · 14 revisions

POST User Endpoint:

-Unregistered user Alex will create a unique username and password combination in the initial Chigame "Sign Up" page along with a verified email. This will POST a new user object in the User table of the Chigame database.

PATCH User Endpoint:

-Existing user Von wants to edit his information such as profile picture or email, and can do so in the "Update Profile" settings of the home page for a signed-in Chigame page.

POST Friends:

-Existing user Devi accepts a "Friend" invite from another user Allen. Allen's and Devi's "Friends" are updated accordingly, where they are now linked with their respective User IDs in the Friend's database.

GET Friends:

  • Existing user Java selects a user profile that sends GET requests for all of that user's friends, which are all retrieved with the filter to all users linked by ID.

POST Tournament Endpoint:

-Admin user Charlie wants to create a public tournament with a max cap of 32 players for a Checkers game. He specifies the number of players, the game ID for Checkers from the game library, tournament style, and visibility (public vs. private) in the POST request to the tournaments database.

-Users that opt to will automatically get a notification of this open public tournament through an automated GET API request of the newly added tournament where they will be able to see what game is being played, how many users have joined the tournament, and if there is still availability.

GET Tournament Endpoint:

-Admin user Bobby wants to see the results of a public tournament with a max cap of 64 players for Blitz Chess. He is able to view the number of players, game ID for Blitz Chess from the game library, tournament style, and visibility (public vs. private) in the GET request to the tournaments database.

-Users will be able to view the information of this tournament if they are invited and it is private, or if it is public. If they are able to view the tournament, they will then be able to see the names of the players in the tournament. All users will be able to see the game ID of Blitz Chess, and the number of players participating in the tournament.

POST Games Endpoint:

-Admin user Michael wants to create a game with a minimum of 1 player and maximum of 4. The game is titled Upturn and has a very generic description. He uploads an image that will be displayed whenever users view the game, and states the rules of the game. The suggested age is 10+ and will be inputted as 10. The expected playtime will be set to 45 minutes with no minimum or maximum specified. The complexity of the game will be set to 2, and the category is listed as "Other", with the uplift and upturn mechanics being highlighted. Upon posting, the game will receive its Board Game Geek ID which is autoincremented by django.

-Users that opt to will automatically be notified of this incredible new game through an automated GET API. They will be able to see the cover image of this game, its rules, description, complexity, genre, mechanics, minimum and maximum players, the age restriction, and estimated playtime.

GET Games Endpoint:

As a game enthusiast, Shannon want to retrieve detailed information about the recently posted game "Upturn" through a GET API endpoint at /api/games, so she can stay informed about new and exciting additions to the chigame platform.

  • The GET API endpoint at /api/games successfully retrieves information about the game "Upturn."
  • She can view the cover image, rules, description, complexity, genre, mechanics, minimum and maximum players, age restriction, and estimated playtime for the game.
  • The retrieved data includes the auto-incremented Board Game Geek ID assigned to the game by Django.

GET Match Endpoint:

As a ChiGame user, Ronald wants to access detailed information about a specific match. When navigating to the "Get Match" endpoint at /api/matches/{match_id}, he expects to receive comprehensive data such as the date and time the match was played, the game being played, the participants, their roles or factions, the turn order, and any specific details related to the game's mechanics.

  • The GET endpoint at /api/matches/{match_id} successfully retrieves match information.
  • The response includes relevant details such as date and time, game name, participants, roles or factions, turn order, and any other pertinent data related to the specific match.

POST Match Endpoint:

As a ChiGame user, Ronald wants to record the outcome of a completed match and contribute to the platform's match statistics. When posting match results to the endpoint at /api/matches, he is expected to provide essential details such as the game played, participants, their roles or factions, and the specific outcomes, whether it's a victory, defeat, or any other relevant result. Additionally, he wants the platform to update relevant statistics, such as win/loss records and achievements.

  • The POST endpoint at /api/matches successfully records match outcomes.
  • The request includes necessary information like game name, participants, roles or factions, and the specific results of the match.
  • The platform updates relevant statistics, such as win/loss records and achievements, based on the posted match outcome.
  • Users can view the updated match information in their profiles or other relevant sections of the platform.

Anonymous Internet Devices Experience:

  1. Taylor's internet-enabled device sends a request to the Chigame API to retrieve data on games and user interactions.
  2. The device receives and stores this information in its local database, categorizing data by game titles and user demographics.
  3. The device deploys bots to play hundreds of games on Chigame, generating performance and gameplay data.
  4. Taylor uses the collected data for comprehensive analysis to understand user behavior and game popularity, and to identify areas for enhancement.
Clone this wiki locally