Skip to content

User Stories

Lazytangent edited this page Jan 23, 2021 · 7 revisions

Register

As an unauthorized user, I want to be able to create an account, so that I can use the application's services.

Questions

  • Will the user enter a username and an email to signup?
    • Both a username and email will be required
  • Will we confirm their password during signup?
    • Yes
  • What routes should we use for signup?
    • None, the signup form will be a modal that pops up when called upon
  • Where should the user be redirected after signup?
    • The user will be redirected to the main Drinks page, where they can browse the selection of drinks available.
  • Will we allow OAuth authentication via a third party?
    • Not yet
  • What happens if the user with the username or email already exists?
    • The form will render the error upon submission.
  • What happens if the user enters the wrong password confirmation?
    • The form will render the error upon submission.

Acceptance Criteria

  1. Given that I'm a user who has not signed up yet and
    • When I click on the Register button in the NavBar
    • Then there will be a form that pops up with an email, username, and password field with a "Register" button to submit the form.
  2. Given that I'm a user trying to make an account,
    • 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 "Register" button
    • Then at the top of the form, I will see a message User with that username already exists or User with that email already exists.
  3. Given that I'm a user trying to make an account,
    • When I try to fill out the form with a password shorter than 6 characters and press Enter or press the "Register" button,
    • Then at the top of the form, I will see a message Password must be at least 6 characters long.
  4. Given that I'm a user trying to make an account,
    • When I try to fill out the form with a valid email, username, and password and press Enter or press the "Register" button,
    • Then I will be redirected to the main Drinks page at /drinks
  5. Given that I'm a user that just signed up
    • When I refresh the homepage at the /drinks route
    • Then I will still be logged in

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 use a username or email address to log in?
    • User can use either their username or email address to log in.
  • What routes should we use for log in?
    • User will log in via the log in modal that will pop up when called upon.
  • Where should the user be redirected after login?
    • User will be redirected to /drinks page
  • Will we allow OAuth authentication via a third party?
    • Not yet
  • What happens if the user doesn't exist yet or the user enters a field with the wrong credentials?
    • Display the message Invalid Login with the given credentials.
  • Will the user be able to reset their password?
    • Not yet
  • Should logging in use session-based or token-based authentication?
    • We will use token-based authentication.

Acceptance Criteria

  1. Given that I'm a logged-out user and
    • When I click on the Login button in the NavBar
    • Then there will be a login form with a "Username or Email" field, a password field, and a "Login" button to submit the form.
  2. Given that I'm a logged-out user and
    • When I try to fill out the form with an invalid email/username and password combination and press Enter or press the "Login" button
    • Then at the top of the form, I will see a message Invalid Login. Please try again.
  3. Given that I'm a logged-out user and
    • When I try to fill out the form with a valid username/email and password combination and press Enter or press the "Login" button
    • Then I will be redirected to the /drinks page
  4. Given that I'm a logged in user
    • When I refresh the homepage at the /drinks route
    • Then I will still be logged in
  5. Given that I am a logged-out user
    • When I try to navigate to the homepage at the /drinks route
    • Then I will be redirected to the / main page

Logout

As an authorized user, I want to be able to log out of my account, so that I can hide my account information from the rest of the users on this device.

Questions

  • What happens when the user logs out?
    • User will be redirected to the / page with a message at the top telling them the log out was successful.
  • How will the user log out?
    • User will click the Log out button in the User menu that is accessible from the NavBar on any page of the site.

Acceptance Criteria

  1. Given that I'm a logged-in user and
    • When I'm on any route
    • Then I should be able to access the user menu in the NavBar and log out of my account
  2. Given that I'm a logged-in user and
    • When I click the Log out button
    • Then I will be redirected back to the / page.

Demo User

As a prospective user who just wants to demo the functionality of The Juice Box, I want to be able to try out the site with a demo user login via a single click on the login and register forms, so that I can access The Juice Box without having to go through the trouble of creating a new account.

Questions

  • Will the user enter a username or an email address to login?
    • User will login via the "Demo User Login" button.
  • What routes should should we use for login?
    • User will log in via the log in modal that will pop up when called upon.
  • Where should the user be redirected after login?
    • User will be redirected to /drinks.

Acceptance Criteria

  1. Given that I am a logged-out user
    • When I'm on the Login or Register forms
    • Then there will be a button that will let me login as a demo user
  2. Given that I am logged in as the demo user
    • When I refresh any page
    • Then I should still be logged in as the demo user

See All Drinks

As a logged in user, I want to be able to see all of the possible drinks, so I can choose one to make or drink.

Questions

  • What route will show all the drinks?
    • /drinks
  • What route will show an individual drink?
    • /drinks/:drinkId

Acceptance Criteria

  1. Given that I am a logged in user
    • When I'm on the /drinks page
    • Then I will see all the drinks on the site
  2. Given that I am a logged in user
    • When I'm on a /drinks/:drinkId page
    • Then I will see the details for the drink with the corresponding id

Create a Drink

As a logged in user, I want to be able to create a new drink, so that I can share my drinks with everyone else.

Questions

  • What route will show the form to create a new drink?
    • /drinks/new

Acceptance Criteria

  1. Given that I am a logged in user
    • When I navigate to /drinks/new
    • Then I will see a form with name and description fields.
  2. Given that I am a logged in user
    • When I submit the form on /drinks/new
    • Then I will be redirected to the new drinks page

Delete a Drink

As a logged in user, I want to be able to delete one of my drinks, so that I can clean up my creations.

Questions

  • How will a user delete one of their drinks?
    • There will be a "Delete" button on the drink detail page if the user is the same user that created the drink.
  • Where will the app redirect to when a drink is delete successfully?
    • The app will redirect to the /drinks page with a message at the top notifying the user that their drink was deleted successfully.

Acceptance Criteria

  1. Given that I am a logged in user and the creator of a drink
    • When I navigate to the drink's details page
    • Then I will see the option to delete it
  2. Given that I am a logged in user and the creator of a drink
    • When I click on the delete button on the drink's detail page
    • Then I will get redirected to the /drinks page and shown a message notifying me that my drink was successfully deleted
  3. Given that I am a logged in user and not the creator of a drink
    • When I navigate to the drink's detail page
    • Then I will not get the option to delete the drink

Update a Drink

As a logged in user, I want to be able to edit one of my drinks, so that I can make it better.

Questions

  • How will a user edit one of their drinks?
    • There will be an "Edit" button on the drink detail page if the user is the same user that created the drink.
  • Where will the app redirect when the "Edit" button is clicked?
    • The user will stay on the detail page, and the name and description fields will change into input fields. Essentially rendering the form in-place
  • Where will the app redirect when the "Edit" form is submitted?
    • The user will be redirected back to an updated detail page

Acceptance Criteria

  1. Given that I am a logged in user and the creator of a drink
    • When I navigate to the drink's details page
    • Then I will see the option to edit it
  2. Given that I am a logged in user and the creator of a drink
    • When I click on the edit button on the drink's detail page
    • Then I will see a form with the name and description fields filled in with the old data
  3. Given that I am a logged in user and the creator of a drink
    • When I submit the edit form for one of my drinks
    • Then I will see the updated drink's detail page
  4. Given that I am a logged in user and not the creator of a drink
    • When I navigate to the drink's detail page
    • Then I will not see the option to edit it

Create a Review for a Drink

As a logged in user, I want to be able to create a review for a drink, so that I can share my opinions about the drink.

Questions

  • How will a logged in user create a review for a drink?
    • On the /drink/:drinkId page that corresponds to that drink, there will be a review section with a button that will render a form for users to leave reviews.

Acceptance Criteria

  1. Given that I am a logged in user
    • When I navigate to a drink's detail page
    • Then I will see a button "Add a Review"
  2. Given that I am a logged in user
    • When I click the "Add a Review" button on a drink's detail page
    • Then I will see an input field that lets me type out my review and a button to submit my review
  3. **Given

See all Reviews for a Drink

As a logged in user, I want to be able to see all the reviews for a drink, so that I can know what others think about it.

Questions

Acceptance Criteria

Update one of your Reviews for a Drink

As a logged in user, I want to be able to update one of my reviews for a drink, so that I can make it a better review.

Questions

Acceptance Criteria

Delete one of your Reviews for a Drink

As a logged in user, I want to be able to delete one of my reviews, so that I can remove an old review that I've changed my opinion on.

Questions

Acceptance Criteria


Bonus

See All Venues

As a logged in user, I want to be able to see all the possible venues, so that I can choose one to go visit.

Questions

Acceptance Criteria

Check In at a Venue

As a logged in user, I want to be able to check in at a venue, so that I can share my experience.

Questions

Acceptance Criteria

Create a Review for a Venue

As a logged in user who has checked in at a venue, I want to be able to create a review for said venue, so that I can share my opinion of it.

Questions

Acceptance Criteria

See All Reviews for a Venue

As a logged in user, I want to be able to see all the reviews for a venue, so that I can better decide whether or not I should go there.

Questions

Acceptance Criteria

Update one of your Reviews for a Venue

As a logged in user, I want to be able to edit one of my reviews for a venue, so that I can share my updated opinion.

Questions

Acceptance Criteria

Delete one of your Reviews for a Venue

As a logged in user, I want to be able to delete one of my reviews for a venue, so that I can remove an old opinion.

Questions

Acceptance Criteria

Clone this wiki locally