Skip to content

User Stories

Mark Valdez edited this page Mar 2, 2021 · 5 revisions

User Stories

User Story Stretch Goals

Authorization

As an unauthorized user, I want to be able to create an account, so that I can access my own Jokes on Laughs.

Questions

  • How will a user login?
    • User will login via email or username and password
  • Will we confirm their password during signup?
    • Yes
  • What routes should we use for login?
    • POST: log in user
    • DELETE: log out user
    • GET: restore session user
  • Where should the user be redirected after signup?
    • Take them to the post a joke page
  • Where should the user be redirected after login?
    • Personal Joke Newsfeed Page
  • Will we allow OAuth authentication via a third party?
    • No
  • What will be different on the home view for the logged in user vs not logged in?
    • The navbar will give the option to sign up or log in if there is no user in session
  • What happens if the user doesn't exist/enters bad credentials?
    • Display the message "Invalid credentials. Please try again."
  • Should this story include allowing a user to reset their password?
    • Not yet -- maybe in a future story

Acceptance Criteria

Given that I'm a logged-out user and

  1. When I'm on the / route and click "Log In"
    • Then there will be a login form with an email or username and password field and a "Log In" button to submit the form.
  2. When I try to fill out the form with an invalid email and password combination and the "Login" button
    • Then at the bottom of the form, I will see a message "Invalid credentials. Please try again."
  3. When I try to fill out the form with a valid email and password and press the "Log In" button
    • Then I will stay on the home page, the modal login form will disappear, and the nav bar will update.
  4. When I try to click browse jokes
    • Then I will be rerouted to a search page with a list view of jokes without the ability to like/comment/or follow users

Given that I am a logged-in user

  1. When I refresh a page
    • Then I will still be logged in and stay on that page
  2. When I try to click browse jokes
    • Then I will be rerouted to a search page with a list view of jokes and all their details, plus profile access

Sign Up

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

Questions

  • Will the user enter a username and an email address to signup?
    • User will enter a username and email address to signup.
  • Will we confirm their password during signup?
    • User will confirm the password through a confirm password field.
  • What route should we use for signup?
    • The form will use a method of POST with an action of /api/user
  • Where should the user be redirected after signup?
    • Profile Page
  • What happens if the user with the username or email already exists?
    • Display error
  • What happens if the user enters the wrong password confirmation?
    • Display error
  • How will we protect from cross-site request forgery?
    • We will use the csurf package
  • Will any extra information be requested?
    • We will give an option to upload a profile picture

Acceptance Criteria

Given that I'm a logged-out user and

  1. When I'm on the / route and click "Sign Up"
    • Then there will be a sign-up form with an email or username and password field and a "Sign-Up" button
  2. When I try to fill out the form with any invalid or non-unique information
    • Then at the bottom of the form, I will see corresponding errors.
  3. When I try to fill out the form with a valid username, email and password and press the "Sign-Up" button
    • Then I will be redirected to my profile page, the modal login form will disappear, and the nav bar will update.

Nav Bar

As a logged-in or logged-out user, I want to see a Nav Bar at the top of the page, so I can navigate between pages and logout.

Questions

  • What will the nav bar allow the user to do?
    • Navigate between pages and logout
  • What links will there be in the nav bar?
    • Logged in:
      • Browse Jokes, My Jokes, profile dropdown
    • Logged out:
      • Browse Jokes, Log In, Sign Up
  • What will be displayed on the user profile dropdown?
    • Username, email, messages, logout
  • How will the nav bar allow a user to logout?
    • There will be an option to logout on the profile dropdown
  • When a user clicks the logout button, what page will they be redirected to?
    • Splash Page

Acceptance Criteria

Given that I am a logged-in user

  1. When I click logout
    • Then the navbar will be updated, and I will be redirected to the Splash Page
  2. When I click on "Browse Jokes"
    • Then I will be redirected via the href on the anchor tag to /jokes.
  3. When I click on "My Jokes"
    • Then I will be redirected via the href on the anchor tag to /users/:UserId(\\d+)
  4. When I click on "Messages" in the profile dropdown
    • Then I will be redirected via the href on the anchor tag to /messages where the id is the current user
    • I will see a list of the people I have messaged
  5. When I click on a users name in the list of people messaged
    • Then I will be directed to /messages/:UserId(\\d+) where userId is the other user I am messaging.

Browse All Jokes

As a logged in user I want to see a list of all the jokes on site

Questions

  • How many jokes will the user be able to see on the screen at a time?
    • All jokes will be listed by order of creation with the newest at the top
  • How will users narrow down the search criteria?
    • Filter jokes by type
  • What information will users be able to see on jokes in the list?
    • Basic information including username and type
    • The name of the joke will have an anchor with an href to the detailed view of that joke (/jokes/:id(\\d+)).
  • What route is used to view jokes?
    • A GET request to /api/jokes

Acceptance Criteria

Given that I am a logged-in user

  1. When I use the option to view jokes
    • Then a list of all jokes shows up ordered by creation date until you add a filter for best match.
  2. When I click on a specific joke
    • Then I will be redirect to /jokes/:id(\\d+)

Given that I am a non logged-in user

  1. When I use the option to view jokes
    • Then a list of all jokes shows up ordered by creation date
  2. When I click on a specific joke
    • Then I will be prompted to create an account to view that jokes profile.

Create a Joke

As a registered user, I want to add a new pet, so that I and others can view and match with them.

Questions

  • What route will be used to get to the "Create a Joke Profile" form?
    • User will be directed to a "Create a Joke Profile" form via the /jokes/new route
    • The form will use a method of POST with an action of /api/jokes
  • What fields will be shown on the form?
    • Everything from Joke Table
    • userId will be set on the backend to id of user who is logged in and creating the pet profile
  • What happens when a user enters invalid credentials?
    • Display errors
  • Where will we redirect a user after creating a joke profile?
    • To that detailed view page of the newly created joke profile (/jokes/:jokeId(\\d+))
  • What happens if a joke already exists with the same name?
    • jokes can have the same name
  • How will we protect from cross-site request forgery?
    • We will use the csurf package

Acceptance Criteria

Given that I am a logged-in user

  1. When I fill in the joke profile form with valid information
    • Then the new joke appears listed
    • When I add invalid or missing information to the form and attempt to submit
    • Then the form validations fail and return me to the form with an error message.

Messaging

As a logged-in-user I want to be able to message another user, so that I can interact with other users.

Questions

  • Who can a user message?
    • Any other user by clicking on the "send message" button on the users profile
  • How would the user see messages they have already sent/received
    • Via the profile dropdown menu

Acceptance Criteria

Given I am a user that’s signed in.

  1. When I message another user.
    • Then that message will appear in the other users messages.

Logout

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

Questions

  • What happens when the user logs out?
    • User will be redirected to the /login 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 to log out

Acceptance Criteria

  1. Given that I'm a logged-in user and
    • When I'm on any route
    • Then I should be able to log out of my account
  2. Given that I'm a logged-in user and
    • When I click the Log out button
    • Then the server will redirect to the /login route

Demo User

As a prospective user who just wants to demo Laughs, I want to be able to try out the site with a demo user login via a single click on the login and signup form, so that I can access Laughs 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 username 'demo' and password '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 /users/:id

Acceptance Criteria

  1. Given that I am a logged-out user
    • When I'm on the /login or /register routes
    • 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

User Stories Stretch Goals

Followers

As a logged-in-user I want to be able to Follow a user, so that I can keep a record of my Followers

Questions

  • How would the page let the user know a usr has a “Follower”?
    • Detail view can contain a list of followers
  • How would the app update the database with the new follower?
    • We will use flask to create a new entry in our Followers table

Acceptance Criteria

Given I am a user that’s signed in.

  1. When I click Follow
    • Then a drop down option will appear for which I can view my following.