Skip to content

User Stories

Daniel Upchurch edited this page Jan 31, 2021 · 2 revisions

Login

As an unauthorized user, I want to be able to login to the website via a form, so that I can access my private information.

Questions

  • Will the user enter a username or an email address to login?
    • User will login via email and password
  • What routes should we use for login?
    • User will login via /login route
  • Where should the user be redirected after login?
    • User will be redirected to the / homepage
  • Will we allow OAuth authentication via a third party?
    • Not yet -- maybe in a future story
  • What happens if the user doesn't exist yet?
    • Display the message Invalid Login :( please try again.
  • What happens if the user enters the wrong password?
    • Display the message Invalid Login :( please try again.
  • Should this story include allowing a user to reset their password?
    • Not yet -- maybe in a future story
  • Should logging in use session-based or use token-based authentication?
    • We will use token-based auth for now

Acceptance Criteria

  1. Given that I'm a logged-out user and
    • When I'm on the /login route
    • Then there will be a login form with an email and password field and a "Login" button to submit the form.
  2. When I try to fill out the form with an invalid email and password combination and press Enter or press the "Login" button
    • Then at the top of the form, I will see a red message Invalid Login :( please try again.
  3. When I try to fill out the form with an email that doesn't exist in the system and press Enter or press the "Login" button
    • Then at the top of the form, I will see a red message Invalid Login :( please try again.
  4. When I try to fill out the form with a valid email and password and press press Enter or press the "Login" button
    • Then I will be redirected to the homepage at the / route.
  5. Given that I am a logged-in user
    • When I refresh the homepage at the / route
    • Then I will still be logged in
  6. Given that I am a logged-out user
    • When I try to navigate to the homepage at the / route
    • Then I will be redirected to the /login route

Signup

As an unauthorized user, I want to be able to sign up for the website via a signup form, so that I can access GameScape.

Questions

  • Will the user enter a username and an email address to signup?
  • Will we confirm their password during signup?
  • What routes should we use for signup?
  • Where should the user be redirected after signup?
  • Will we allow OAuth authentication via a third party?
  • What happens if the user with the username or email already exists?
  • What happens if the user enters the wrong password confirmation?

Acceptance Criteria

  1. Given that I'm a user who has not signed up yet and
    • When I'm on the /signup route
    • Then there will be a signup form with an email, username, and password field and a "Sign Up" button to submit the form.
  2. When I try to fill out the form with an email or username that already exists with a valid password and press Enter or press the "Sign Up" button
    • Then at the top of the form, I will see a red message User with that email or username already exists.
  3. When I try to fill out the form with a password shorter than 6 characters and press Enter or press the "Sign Up" button
    • Then at the top of the form, I will see a red message Password must be at least 6 characters long.
  4. When I try to fill out the form with a valid email, username, and password and press Enter or press the "Sign Up" button
    • Then I will be redirected to the homepage at the / route.
  5. Given that I am a user that just signed up
    • When I refresh the homepage at the / route
    • Then I will still be logged in

Demo User

As a first-time user who just wants to demo GameScape, I want to be able to try out the site with a demo user login via a single button click on the login and signup form, so that I can access GameScape without having to go through the trouble of creating a new account.

Questions

  • What routes are used?
    • The login route will be utilized with demo/test user information
  • Will the demo user have all functionality of a normal user?
    • Yes, the demo user can save and delete decks, study decks, and search decks
  1. Given that I am a logged out user
  • When I click the demo user button
  • Then I will be logged into a demo account.

Logout

As a logged-in user, I want to logout via a button on the navigation bar, so that I can hide my account information to the rest of the users on this device.

Questions

  • What routes will be utlizied?
    • The user logout route will be used to delete the user token Where will the user be redirected to when logged out?
    • The user will be redirected to the logged out, home page
  1. Given that I am a logged in user
  • When I click the logout button
  • Then I will be logged out of the website, with my user token being removed from state.
  1. When I log out
  • Then I will be redirected to the home page as a logged out user.

See all the Decks

As a logged-in user, I want to see all the decks in GameScape, so that I can preview decks and save them for study.

Questions

  • Will the user need to be logged in to see the decks?
    • Users can see decks whether logged in or logged out
  • What routes should we use for viewing all the decks?
    • User will view all decks at the /adventures/explore route
  • What will happen when the user clicks on a deck?
    • User will be directed to the /adventures/preview/:deckId route for the deck
  • What happens when the user saves the deck?
    • The deck is added the SavedDecks table for that userId and deckId
  • What route will this call when the user saves the deck?
    • This will call the POST /api/decks/savedDecks/:id route
  • What happens if the deck is already saved in the SavedDeck for the user?
    • The deck will not be displayed in the explore decks page

Acceptance Criteria

  1. Given that I'm a user who has not signed up yet and
    • When I'm on the /adventures/explore route
    • Then I will be able to see all decks and go to their preview pages
  2. When I click on a deck link
    • Then I will be redicted to that deck's page of route /adventures/preview/:deckId.
  3. Given that I am a user that is logged in
    • When I click on a deck link
    • Then I will be redicted to that deck's page of route /adventures/preview/:deckId.
    1. Given that I'm a user that is logged in
    • When I'm on the /adventures/explore route
    • Then I will be able to see all decks that I do not already have saved.

Saved and Unsave Decks

As a user, I want to be able to save or delete decks that I want to study or don't want to keep studying anymore.

Questions

  • Will the the user need to be logged in to see their saved decks?
    • Yes
  • How can a user save a deck?
    • The user will have access to a save button on the /adventures/preview/deckId route for all decks that are not saved
  • How can a user unsave a deck?
    • If the deck is already saved then the save button will instead render as a unsave button to delete the deck from their saved decks

Acceptance Criteria

  1. Given that I'm a logged-in user, and
    • When I'm on the route /adventures/preview/deckId for an unsaved deck
    • Then there will be a button to save the deck
  2. Given that I'm a logged-in user, and
    • When I'm on the route /adventures/preview/deckId for a saved deck
    • Then there will be a button to unsave the deck

Study Decks

Questions

  • Will the user need to be logged in to study decks?
    • Yes, the user will need to be logged in to study a deck as the application keeps track of score
  • What path will the user use to study the deck?
    • The users will be directed to /adventures/deckId when choosing to study a deck (either from their saved decks list or from the deck preview page from route /adventures/previews/deckId)
  • What will a user who is not logged in see when trying to go the study route, /adventures/deckId?
    • The user will be prompted to sign in in order to actually study the deck
  • How will the user get the answer for the displayed question?
    • There will be a show answer button at the bottom of the flash card
  • How will the user show the next question after the answer?
    • The user will have two buttons, each which will show the next question. One correct and one incorrect button to keep track of the users score
  • What will the user see when all questions have been answered?
    • The user will see a victory screen which displays the number of correct answers over the study deck
  • What route will the update thunk use in order to update the users score in the database?
    • The thunk will use the PATCH /api/decks/savedDecks/:id with the id params to send the updated scores

Acceptance Criteria

  1. Given I am a user who is not logged in and
  • When I try to view the study page
  • Then I am redicted to login to the website
  1. Given I am a user who is logged in and
  • When I try to view the study page
  • Then I am greeted with a start card that shows a begin studying button
  1. Given I am a user who is logged in and
  • When I click the begin studying button
  • Then I am shown a random question from the deck's question list
  1. Given I am a user who is logged in and
  • When I click the show answer button
  • Then I am shown the answer to the current question
  1. Given I am a user who is logged in and
  • When I click the correct button after seeing the answer
  • Then I am shown another random question and my score is incremented by 1
  1. Given I am a user who is logged in and
  • When I click the incorrect answer button
  • Then I am shown another random question without my score changing