This is a mock website for an online book store. It has basic user authentication, so that only logged in users may review products, and only administrators can create, edit, and delete products.
To install on your own machine, follow the instructions below:
- Clone this repository.
- Create a
.env
file and format as follows:PUBLISHABLE_KEY='[Your Stripe Publishable Key]' SECRET_KEY='[Your Stripe Secret Key]' CURRENCYLAYERKEY='[Your Currency Layer Key]' AVATAX_KEY='[Your Avatax API Key]'
- You will need to acquire API keys for Stripe, AvaTax and Currency Layer.
- Run the following commands in the project root directory:
bundle update rake db:setup rails db:seed rails s
- Open
localhost:3000
in your web browser - To give an account admin privileges:
- In the project root run
rails c
- Then run:
User.find_by(email: "[account email address]").update(admin: true)
- The account will now have admin access to the app.
- In the project root run
- Products
- All users may view products
- Administrators may add, edit, and delete products
- Administrators may set a product on sale until a specified date
- Users can raincheck a product for later purchase
- Users can sort product index by one of three methods: alphabetical, price (low to high), and price (high to low)
- Accounts
- Accounts and Users have a one-to-one association
- Administrators may change an account's "Preferred" status
- Preferred accounts receive a 10% discount on non-sale items
- Users
- Users may be either standard user or Admin
- Users may log in with email and password
- Orders
- Orders are created and edited when a user updates or purchases their cart
- Orders are charged using Stripe
- At checkout, total order cost is displayed in the following currencies:
- US Dollars
- Canadian Dollars
- Euros
- Great British Pounds
- Polish Złoty
- At checkout, Seattle sales tax is added to the order total
- An order's status changes from "Cart" to "Placed" when user is charged for the order at checkout
- Orders may not be placed if there is not sufficient stock for all order items
- User receives a confirmation email once their order has been placed
- Order Items
- Order items can be moved from Raincheck to Cart
- Order items reserve the price of the product at time they are added to cart
- Reviews
- Reviews cannot be added unless user has purchased the product
- Users may edit and delete their own reviews
- Administrators may delete any user reviews
- All users can view reviews
- When updating a product to "Featured," if there are no other featured products AJAX will not display the "Featured" section without a page refresh.
- Products updated to "On Sale" will not display in the "On Sale" section of the homepage without a page refresh.
- If cart is empty, refresh is required to display change of item from Raincheck to Cart.
Please contact kels.langlois@gmail.com or ldmackrell@gmail.com with questions, comments, or issues.
- Ruby
- Rails
- Bootstrap
- Devise
- Stripe
- AJAX
Copyright (c) 2017 Kelsey Langlois & L. Devin MacKrell
This software is licensed under the MIT license.