Giter Site home page Giter Site logo

srhcrete / e-commerce-refactor Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1 MB

Rails Week 3 project - independent project refactoring and adding AJAX to an existing e-commerce site

Ruby 61.55% JavaScript 19.14% CSS 1.41% HTML 17.61% CoffeeScript 0.31%

e-commerce-refactor's Introduction

E-Commerce Refactor

Description and Goals.

The original developer of this e-commerce site quit abruptly. The goal of this project is to refactor and add AJAX to shopping cart and product features.

Set Up

  1. $ git clone this repository
  2. $ cd e-commerce-refector
  3. $ bundle
  4. $ rake db:create
  5. $ rake db:migrate
  6. $ rake db:test:prepare (for testing environment)
  7. $ rake db:seed
  8. $ rake db:reset (to perform database create, migrate, & seed in single command)
  9. $ rails s to start the server, then navigate to localhost:3000 in your browser.

To use Stripe for credit card payment:

  1. Visit Stripe
  2. Login or create an account to get your API keys.
  3. Paste the following text in the .env file and add your own API keys: PUBLISHABLE_KEY=your key here SECRET_KEY=your key here

Changes Made

AJAX

  • added ajax request for updating the carts items when new item added.
  • added ajax request for updating the cart when an item is deleted.
  • show product details with ajax and jquery.

Refactoring

  • added flash notice for sign in and sign out.
  • fixed deprecated callback method by changing before_filter to before_action in the Products Controller.
  • added validation for order item quantity.
  • change the cart item method to update quantity when more than one item of the same order_item is added to the cart. Moved method to the application helper for access throughout the app.
  • added Stripe for charges.
  • added route to admin and new product page.
  • changed orders total_price column from string to decimal to fix charges.
  • added thanks route to charges.
  • added Paperclip to handle image uploading.
  • added avatar to users sign in and and upload for new users.
  • add photo to products details page and upload for new products.

Technologies Used

  • Ruby-on-Rails
  • ActiveRecord
  • AJAX

e-commerce-refactor's People

Contributors

franzknupfer avatar srhcrete avatar

Watchers

 avatar

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.