Giter Club home page Giter Club logo

little_shop_base_small's Introduction

Turing Mod 2 Backend Engineering 1810

Final Project: Extensions to Little Shop

A Turing School solo project created with Ruby on Rails.

LittleShop This project was an extension to our group project, Little Shop:

https://github.com/cebarks/littleshop

However, we were given a fresh code base for this round, so that the focus could simply be on the back-end extensions we were assigned to engineer. The fresh code base can be found at:

https://github.com/iandouglas/little_shop_base_small

The waffle project management board for this project can be found here:

https://waffle.io/SyntheticAutomation/little_shop_base_small

This project was designed to give us a chance to experiment a bit with our own creativity. Some of the main things I got to practice:

  • Test Driven Development
  • building CRUD functionality using Rails and all of its magic
  • UX design
  • Database relationships
  • Rails development (including routing)
  • Authentication and Authorization
  • Statistics
  • MVC and Rails development
  • Database relationships and migrations
  • ActiveRecord
  • Software Testing
  • Agile and project management tools

Extensions

The extensions I worked on are:

Users can rate items (counts as 1 extension point)

Users will have the ability to leave ratings for items they have successfully purchased.

Users cannot rate items from orders which have been canceled by the user or an admin.

Users can write one rating per item per order. If the user orders an item (in any quantity) they can leave one rating. If they order the item again in a different order, the user can leave another rating.

Build all CRUD functionality for users to add a rating through their order show page.

Users can disable any rating they created. Admins can enable or disable any rating.

Disabled ratings should not factor into total counts of ratings, nor averages of ratings.

Ratings will include a title, a description, and a rating from 1 to 5.

--

Merchant To-Do List (counts as 1 extension point)

Merchants who visit their dashboard should see a list of "to-do" tasks such as:

  • fixing items which are using a placeholder image
    • each of these items will appear on the dashboard page with a link going directly to that item's edit page where they can set a new image URL
  • a count of how many orders are unfulfilled and the revenue impact ("You have 5 unfulfilled orders worth $752.86")

--

Setup

You will need Rails version 5.1.

gem install rails -v 5.1

Clone down this repo via SSH:

git clone [email protected]:SyntheticAutomation/little_shop_base_small.git

From a shell, navigate into the project directory:

cd little_shop_base_small

Make sure your gemfile is up to date:

bundle update

Build the database in postgresql:

rake db:{drop,create,migrate,seed}

Start up your server:

rails s

Open your browser and explore this url:

localhost:3000

Backend Features

  • Registered users can now leave a review on an item they've purchased, and they can do this from their order show page via a "Leave Review" button.
  • Registered users can edit, delete, hide, and re-enable their reviews.
  • Registered users cannot leave a review if the order is cancelled or if the items in the order weren't fulfilled by the merchant.
  • Reviews of an item can now be seen on the item's show page.
  • Registered users cannot edit, disable, or delete other people's reviews.
  • Registered users cannot leave more than one review on an item from the same order.
  • Administrators can now edit, delete, hide, and re-enable all reviews.
  • All review titles are links to their individual show page.
  • The item show page now displays the amount of reviews it has, as well as its average rating.
  • Registered users can no longer access other people's orders.
  • Merchants now see a to-do list, which tracks:
    • if they have a high cancellation rate
    • the revenue impact of their unfulfilled orders
    • items in their inventory that are low and need to be restocked, and provides a restocking button
    • items which are using a default placeholder image, and provides a button to edit the item

Running the tests

Your location should be the root directory of the project (little_shop_base_small).

From the command line run

rspec

Green is passing. Red is failing.

Test suite included use of:

  • rspec
  • capybara`
  • shoulda-matchers
  • FactoryBot
  • Faker

Acknowledgments

Project Leads/Instructors:

  • Ian Douglas
  • Dione Wilson

little_shop_base_small's People

Contributors

syntheticautomation avatar iandouglas avatar

Watchers

James Cloos avatar

little_shop_base_small's Issues

User can enable their reviews from user/reviews

As a user
If i want to enable reviews that I have hidden,
I can navigate to /profile/reviews,
where I see all of my reviews and their information.
if i click a review's title, it is a link to the item_review_path(item, review), also known as '/item/1/review/1'.

There, next to each review, I see an enable/disable button, and edit button, and a delete button.

If I click enable, I am redirected to the item's show page, where I now see the review shown, and a flash saying the review was enabled. The enable button is no longer next to that review on my profile/reviews index page.

If I click disable, the page refreshes, and next to that review I see that it is disabled because the disable button is no longer there. I also see a flash message at the top of the screen indicating that the review was disabled.

User sees list of reviews on item show

As a user
When I am looking at a random item's show page
I see a list of reviews.
When I click a specific review,
I am taken to that review's show page.

User can disable their reviews

As a user
When I navigate to the show page for my review
I see a button to disable the review.

When I click this button,
I am taken back to the item's show page,
where I see a flash message saying the review was disabled/hidden.

I no longer see the review unless I navigate to my user_reviews index page.

User sees review button on order show page

As a registered user
when I place an order
and the order is completed
I can navigate to that order's show page
where I see a button next to each item
to leave a review for the item if the item is fulfilled

merchant sees low stock items in their to-do list

As a merchant
when I log into my dashboard
I see items which are getting below 100 quantity
with a recommendation to restock.
The restock/update quantity button is next to the item, which allows a merchant to update the quantity in their inventory.

User can delete their own reviews

As a registered user
If I navigate to a show page for one of my reviews
I see an option to delete the review.
When I click the button to delete it,
I am taken back to the review item's show page,
where I see a flash message indicating the review was deleted.
I also do not see the review anymore on that item show page.

All reviews are links

As a user
If I see a review posted on the website
I can click the review's title
and be taken to that specific review's show page

Epic: Extension 2

Merchant To-Do List (counts as 1 extension point)

Merchants who visit their dashboard should see a list of "to-do" tasks such as:

  • fixing items which are using a placeholder image
    • each of these items will appear on the dashboard page with a link going directly to that item's edit page where they can set a new image URL
  • a count of how many orders are unfulfilled and the revenue impact ("You have 5 unfulfilled orders worth $752.86")

parent of #18
parent of #19
parent of #20

User can leave review after checkout

As a visitor to this app
when I place an order
and that order is fulfilled and completed
I can navigate to that order's show page
and click the "Leave Review" button.

When I click this button,
I am taken to a form where I can leave the review.
This form includes:
-review title/summary
-review description
-my rating from 1-5

Once I submit the form,
I am redirected to that item's show page,
Where I now see my review live on the page.

Within the review I see:
title
description
rating
author of review

Admin can enable/disable reviews

As an admin
When I navigate to an item's show page
I can click on a review
taking me to that review's show page
where I see a button to disable it.
When I click this button,
I am redirected back to the item show page,
where I see a flash message indicating the review was disabled.
If I navigate back to that review's show page,
I can see the review status is disabled,
and the disable button is not there.
Next to the review I can see an enable button.
When I click this,
I am taken to the item's show page and am given a flash success message,
where I see the review now. When I click it, I am taken to its show page,
and I can see the status has changed to enabled. The enabled button is no longer there.

Users can see other users reviews

As a user
I can navigate to someone else's reviews page,
such as /user_2/reviews,
where I can see all of them,
but cannot edit, enable, disable, or delete them.

User can edit their review (review show/edit)

As a user
When I visit an item's show page
and click one of my reviews
I am taken to that review's show page,
where I see a button that says "Edit Review"
If I click that button
I am taken to the edit page for the review
and can fill out the form to change my review.
Once I click submit
I am redirected back to the review's show page, where I see the following information:

-Review title
-review author
-review date
-rating 1-5
-description
a flash message indicating the review was successfully updated.

Initial Setup

-fork repo
-clone to local
-open in atom
-test for errors
-familiarize with codebase

Site-wide styling

check the difference between this repo and ian's, specifically in the routes.rb file. go through each route that is different and style it (the changed ones are yours)

Item show has review statistics

As a user
If I click on an item and go to its show page
I see how many reviews it has
and its average rating

These statistics do not include reviews that are disabled.

Epic: Extension 1

Users can rate items (counts as 1 extension point)

Users will have the ability to leave ratings for items they have successfully purchased.

Users cannot rate items from orders which have been canceled by the user or an admin.

Users can write one rating per item per order. If the user orders an item (in any quantity) they can leave one rating. If they order the item again in a different order, the user can leave another rating.

Build all CRUD functionality for users to add a rating through their order show page.

Users can disable any rating they created. Admins can enable or disable any rating.

Disabled ratings should not factor into total counts of ratings, nor averages of ratings.

Ratings will include a title, a description, and a rating from 1 to 5.

parent of #1
parent of #2
parent of #3
parent of #4
parent of #5
parent of #6
parent of #7
parent of #8
parent of #9
parent of #10
parent of #11
parent of #12
parent of #13
parent of #14
parent of #15
parent of #16
parent of #22

Epic: Extension 2

Merchant To-Do List (counts as 1 extension point)
Merchants who visit their dashboard should see a list of "to-do" tasks such as:

fixing items which are using a placeholder image
each of these items will appear on the dashboard page with a link going directly to that item's edit page where they can set a new image URL
a count of how many orders are unfulfilled and the revenue impact ("You have 5 unfulfilled orders worth $752.86")

parent of #18
parent of #19
parent of #20

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.