Giter Site home page Giter Site logo

little_shop_2's Introduction

Mini Shop

Mini Shop is an e-commerce site that allows for organizations/companies (Merchants) to create a profile and add the products (Items) that they offer so they are available for sale. Mini Shop

How to install it

  1. Make sure you have Ruby v. 2.5.5 and Rails v. 5.1.7 installed.

  2. Clone this repo.

  3. Once you have your local clone; navigate into the project, bundle your gems and create, migrate, and seed your database:

cd mini_shop
bundle install
rails db:create
rails db:migrate
rails db:seed
  1. Run rspec in your terminal to ensure all tests are passing.

  2. Run your server in your local environment (your computer). Enter in your terminal rails s and then visit localhost:3000.

  3. To see the production site on Heroku, visit: https://immense-oasis-67806.herokuapp.com/

Features

Merchant

  • Merchant Index page - List of all merchants in the system.
  • Merchant Show page - Details of a specific merchant.
  • Merchant Creation - Fill out a form to create a new merchant.
  • Merchant Update - Fill out a form to update any attribute of a merchant.
  • Merchant Delete - Delete a specific merchant.
  • Merchant Items page - Shows all items that belong to a merchant. With the ability to filter by item status (active/ inactive).

Relationship: A Merchant has many Items.

Attributes Description Requirement
Name Company name (string) Required
Address Address where they operate (string) Required
City City where they operate (string) Required
State State where they operate (string) Required
Zip Zipcode where they are located (string) Required

Items

  • Items Index page - List of all items in the system (shows 16 per page).
  • Items Show page - Details of a specific item.
  • Items Creation - Fill out a form to create a new item.
  • Items Update - Fill out a form to update any attribute of an item.
  • Items Delete - Delete a specific item.

Relationship: An Item belongs to a Merchant.

Attributes Description Requirement
Name Product name (string) Required
Description Product description (text) Optional
Image Image Path (string) Required
Price Price (decimal) Required
Inventory Inventory available (integer) Required
Status Active/ Inactive (enum - integer) Optional (Active by default)

Built With

  • Rails 5.1.7
  • Ruby 2.5.5
  • PostgreSQL
  • HTML/CSS

Testing

All test are done with RSpec with a 100% code coverage (calculated with SimpleCov)

To run all tests, enter in your terminal:

$ cd mini_shop
$ rspec

To run a single test:

$ cd mini_shop
$ rspec spec/models/item_spec.rb #(e.g.)

To see the test coverage, enter in your terminal:

$ rspec
$ open coverage/index.html

little_shop_2's People

Contributors

nmcolome avatar dependabot[bot] avatar

Watchers

James Cloos avatar  avatar

little_shop_2's Issues

Edit a Review

As a visitor,
When I visit an item's show page
I see a link to edit the review next to each review.
When I click on this link, I am taken to an edit review path
On this new page, I see a form that includes:

  • title
  • numeric rating
  • text of the review itself
    I can update any of these fields and submit the form.
    When the form is submitted, I should return to that item's
    show page and I should see my updated review

Order Update and Delete

As a visitor
When I check out
I see a flash message with a randomly generated, 10 digit verification code associated with that order

I can use that verification code to search for an order through the nav bar.
If an order is found, I am redirected to a verified order page ('/verified_order')
On that verified order page, I can:

  • click a link to delete the order
  • update the shipping address for an order
  • remove items from the order

Order Creation, cont.

As a visitor
From the order creation page
When I click 'Create Order' without completing the shipping address form
I see a flash message indicating that I need to complete the form for successful order creation

Sortable Reviews

As a visitor,
When I visit an item's show page to see their reviews,
I see additional links to sort their reviews in the following ways:

  • sort reviews by highest rating, then by descending date
  • sort reviews by lowest rating, then by ascending date

Flash Message for Item Create and Update

As a visitor
When I am updating or creating a new item
If I try to submit the form with incomplete information
I see a flash message indicating which field(s) I am missing

Delete a review

As a visitor,
When I visit an item's show page,
I see a link next to each review to delete the review.
When I delete a review I am returned to the item's show page
Then I should no longer see that review.

Items with Orders Cannot be Deleted

As a visitor
If an item has been ordered
I can not delete that item
Either:

  • there is no button visible for me to delete the item
  • if I click on the delete button, I see a flash message indicating that the item can not be deleted.

New Order Page

As a visitor
When I check out from my cart
On the new order page I see the details of my cart:

  • the name of the item
  • the merchant I'm buying this item from
  • the price of the item
  • my desired quantity of the item
  • a subtotal (price multiplied by quantity)
  • a grand total of what everything in my cart will cost
    I also see a form to where I must enter my shipping information for the order:
  • name
  • address
  • city
  • state
  • zip
    I also see a button to 'Create Order'

Cart Show Page

As a visitor
When I have added items to my cart
And I visit my cart ("/cart")
I see all items I've added to my cart
Each item in my cart shows the following information:

  • the name of the item
  • the item image
  • the merchant I'm buying this item from
  • the price of the item
  • my desired quantity of the item
  • a subtotal (price multiplied by quantity)
    I also see a grand total of what everything in my cart will cost

Removing Item from Cart

As a visitor
When I have items in my cart
And I visit my cart
Next to each item in my cart
I see a button or link to remove that item from my cart

  • clicking this button will remove the item but not other items

Merchants with no Orders can be Deleted

As a visitor
If a merchant has items that have not been ordered
I can delete that merchant.
When that merchant is deleted
Then all of their items are deleted as well.

Emptying Cart

As a visitor
When I have items in my cart
And I visit my cart ("/cart")
And I click the link to empty my cart
Then I am returned to my cart
All items have been completely removed from my cart
The navigation bar shows 0 items in my cart

Merchant Statistics

As a visitor
When I visit a merchant's show page
I see statistics for that merchant, including:

  • count of items for that merchant
  • average price of that merchant's items
  • Distinct cities where my items have been ordered

Review Creation

As a visitor,
When I visit an item's show page
I see a link to add a new review for this item.
When I click on this link, I am taken to a new review path
On this new page, I see a form where I must enter:

  • a review title
  • a numeric rating that can only be a number from 1 to 5
  • some text for the review itself
    When the form is submitted, I should return to that item's
    show page and I should see my review text.

Item Link Navigation

As a visitor
With the exception of an item's show page,
Anywhere I see an item name on the site,
I can click on the item name to go to that item's show page.

Decreasing Item Quantity from Cart

As a visitor
When I have items in my cart
And I visit my cart
Next to each item in my cart
I see a button or link to decrement the count of items I want to purchase
If I decrement the count to 0 the item is immediately removed from my cart

More Merchant Statistics

As a visitor,
When I visit an merchant's show page
I see the top 3 highest rated items for that merchant (by average rating)

Adding Item Quantity to Cart

As a visitor
When I have items in my cart
And I visit my cart
Next to each item in my cart
I see a button or link to increment the count of items I want to purchase
I cannot increment the count beyond the item's inventory size

Review Creation, cont.

As a visitor,
When I fail to fully complete the new review form, but still try to submit the form
I see a flash message indicating that I need to complete the form in order to submit a review

Empty Cart Show Page

As a visitor
When I add NO items to my cart yet
And I visit my cart ("/cart")
I see a message that my cart is empty
I do NOT see the link to empty my cart

Review Statistics

As a visitor
When I visit an item's show page,
I see an area on the page for statistics about reviews:

  • the top three reviews for this item (title and rating only)
  • the bottom three reviews for this item (title and rating only)
  • the average rating of all reviews for this item

Merchants with Orders cannot be Deleted

As a visitor
If a merchant has items that have been ordered
I can not delete that merchant
Either:

  • there is no button visible for me to delete the merchant
  • if I click on the delete button, I see a flash message indicating that the merchant can not be deleted.

Order Creation

As a visitor
When I fill out all information on the new order page
And click on 'Create Order'
An order is created and saved in the database
And I am redirected to that order's show page with the following information:

  • My name and address (shipping information)
  • Details of the order:
  • the name of the item
  • the merchant I'm buying this item from
  • the price of the item
  • my desired quantity of the item
  • a subtotal (price multiplied by quantity)
  • a grand total of what everything in my cart will cost
  • the date when the order was created

Reviews on Item Show Page

As a visitor,
When I visit an item's show page,
I see a list of reviews for that item
Each review will have:

  • title
  • content of the review
  • rating (1 to 5)

Deploy your application to Heroku

As a visitor or user of the site
I will perform all user stories
By visiting the application on Heroku.
Localhost is fine for development, but
the application must be hosted on Heroku.

Cart Creation

As a visitor
When I visit an item's show page from the items index
I see a link or button to add this item to my cart
And I click this link or button
I am returned to the item index page
I see a flash message indicating the item has been added to my cart
The cart indicator in the navigation bar increments my cart count

Link to Checkout

As a visitor
When I have items in my cart
And I visit my cart
I see a button or link to Checkout
When I click that button, I am taken to the new order page

Merchant Link Navigation

As a Visitor
With the exception of an merchant's show page,
Anywhere I see an merchant name on the site,
I can click on the merchant name to go to that merchant's show page.

Cart Indicator

As a visitor
I see a cart indicator in my navigation bar
The cart indicator shows a count of items in my cart
I can see this cart indicator from any page in the application

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.