-
Notifications
You must be signed in to change notification settings - Fork 0
User Stories
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.
- 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
- User will login via
- Where should the user be redirected after login?
- User will be redirected to the
/
homepage
- User will be redirected to the
- 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.
- Display the message
- What happens if the user enters the wrong password?
- Display the message
Invalid Login :( please try again.
- Display the message
- 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
-
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.
-
When I'm on the
-
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.
-
Then at the top of the form, I will see a red message
-
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.
-
Then at the top of the form, I will see a red message
-
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.
-
Then I will be redirected to the homepage at the
-
Given that I am a logged-in user
-
When I refresh the homepage at the
/
route - Then I will still be logged in
-
When I refresh the homepage at the
-
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
-
When I try to navigate to the homepage at the
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.
- 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?
-
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.
-
When I'm on the
-
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.
-
Then at the top of the form, I will see a red message
-
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.
-
Then at the top of the form, I will see a red message
-
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.
-
Then I will be redirected to the homepage at the
-
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
-
When I refresh the homepage at the
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.
- 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
- Given that I am a logged out user
- When I click the demo user button
- Then I will be logged into a demo account.
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.
- 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
- 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.
- When I log out
- Then I will be redirected to the home page as a logged out user.
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.
- 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
- User will view all decks at the
- What will happen when the user clicks on a deck?
- User will be directed to the
/adventures/preview/:deckId
route for the deck
- User will be directed to the
- What happens when the user saves the deck?
- The deck is added the
SavedDecks
table for that userId and deckId
- The deck is added the
- What route will this call when the user saves the deck?
- This will call the
POST /api/decks/savedDecks/:id
route
- This will call the
- 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
-
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
-
When I'm on the
-
When I click on a deck link
-
Then I will be redicted to that deck's page of route
/adventures/preview/:deckId
.
-
Then I will be redicted to that deck's page of route
-
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
.
- 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.
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.
- 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
- The user will have access to a
- How can a user unsave a deck?
- If the deck is already saved then the
save
button will instead render as aunsave
button to delete the deck from their saved decks
- If the deck is already saved then the
-
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
-
When I'm on the route
-
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
-
When I'm on the route
- 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
)
- The users will be directed to
- 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
- There will be a
- 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 oneincorrect
button to keep track of the users score
- The user will have two buttons, each which will show the next question. One
- 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
- The thunk will use the
- 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
- 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
- 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
- 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
- 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
- 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