Develop a responsive website for a clothing retailer. The page displays all available products and the shopping basket to which they can be added.
###User stories
- As a User I can add a product to my shopping cart
- As a User I can remove a product from my shopping cart
- As a User I can view the total price for the products in my shopping cart
- As a User I can apply a voucher to my shopping cart
- As a User I can view the total price for the products in my shopping cart with discounts applied
- As a User I am alerted when I apply an invalid voucher to my shopping cart
- As a User I am unable to add Out of Stock products to the shopping cart
###Discount vouchers
Apply vouchers to your order by typing one of the following codes into the Voucher Code box and pressing the Submit Voucher button.
AWESOME5OFF - £5 off your order
AWESOME10OFF - £10 off orders over £50
AWESOME15SHOE - £15 off orders over £75 which contain at least one footwear item
###Assumptions
- Users can only apply one voucher to their order at a time. If a new voucher is applied successfully, the previous voucher is removed.
- Users can see all products, including those which are currently out of stock. They cannot order or increase the desired quantity of an out of stock product.
##Tools
Testing: Karma, Protractor
Application Code: Javascript, HTML & CSS
Frameworks: AngularJS, Bootstrap
##How To Run
###Serve locally
- Ensure you have npm and bower installed
- Clone this repo (git clone https://github.com/natstar93/clothing_shop)
- In terminal, go to the root of the folder and type the following commands into terminal
- npm install
- bower install
- npm start
- Navigate to localhost:8000 in your browser of choice
###Run Tests
Protractor Feature Tests
- Type npm start into terminal
- Open a new terminal window (leave the initial window running) and type protractor test/e2e/conf.js
Karma Unit Tests
Type karma start test/karma.conf.js into terminal
##File Structure:
.
├── README.md
├── bower.json
├── css
│ └── main.css
├── images
├── index.html
├── js
│ ├── app.js
│ ├── awesomeclothing.json
│ ├── clothingShopController.js
│ ├── dataService.js
│ └── orderProducts.js
├── package.json
└── test
├── clothingShopController.spec.js
├── dataServiceSpec.spec.js
├── e2e
│ ├── clothingShopFeature.js
│ └── conf.js
├── karma.conf.js
└── orderProductsSpec.spec.js
##Future Improvements
- Pin shopping basket to top of window, so that when a user scrolls down the basket is still visible.
- Refactor payment and voucher logic into a separate service.
- Enhance mobile experience by hiding the shopping basket on small devices. This would be achieved by implementing a single column layout with a side menu (basket) that would be shown by tapping a basket icon in the header area.
- Replace bootstrap buttons with custom button images.