[go: nahoru, domu]

Skip to content

A mini e-commerce application (Jungle) built with Rails 4.2 for purposes of learning Rails by example.

Notifications You must be signed in to change notification settings

adamhirzalla/jungle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jungle

logo

A mini Rails e-commerce application

Built with Rails 4.2, PostgreSQL, Bootstrap and CSS/ Sass

📚 Introduction

Jungle is a mini e-commerce application built for the purpose of learning Rails by example.

Built with Rails 4.2, PostgreSQL, Bootstrap and CSS/ Sass. Tested using RSpec, Capybara ( Poltergeist, PhantomJS).

✨ Contributions

The idea behind this project was to inherit a partially-completed project and fix existing bugs, add new features, pages, and test different functionalities.

🐛 Bugs Fixed

  • Empty cart checkout
  • Adding an out-of-stock item to cart
  • Price formatting (humanized money formatting and leading '$' signs)

✅ Features Added

  • Shop-wide sales that offer periodic discount on products
  • "Sold Out" badge for products that are out of stock
  • Basic http-athentication for Admin features
  • Admin dashboard which offers viewing/adding new categories/sales
  • User authentication for login/signup through bcrypt
  • Order details to to view product summary after payment

🧪 RSpec Testing

  • Models:

    • User
    • Product
    • Category
  • Features - Capybara (Poltergeist/PhantomJS):

    • User login
    • Add-to-cart
    • Product details page
    • Home page

📷 Screenshots

home

login

payment

order

dashboard

sales

admin-category

category-show

🛠 Installation

  1. Clone or download this repository
    git clone https://github.com/adamhirzalla/jungle
    
  2. Navigate to the project directory and install dependencies
    cd jungle-rails && bundle
    
  3. Create config/database.yml
    cp config/database.example.yml config/database.yml
    
  4. Create config/secrets.yml
    cp config/secrets.example.yml config/secrets.yml
    
  5. Create, load, and seed the database
    bin/rake db:reset
    
  6. Sign up for a Stripe account
  7. Create .env and update with your own Stripe & admin info
    cp .env.example .env
    
  8. Launch the development web server
    bin/rails s -b 0.0.0.0
    
  9. Visit http://localhost:3000/ on your browser

🧪 Testing (RSpec, Stripe)

  1. Run BDD tests (RSpec)

    rspec
    
  2. Manually test Stripe checkout scenarios using the following info:

    # Card number
    4242 4242 4242 4242
    
    # Expiration date (or any future date)
    05/33
    
    # CVC (any 3 numbers)
    123
    

🧾 Dependencies

About

A mini e-commerce application (Jungle) built with Rails 4.2 for purposes of learning Rails by example.

Topics

Resources

Stars

Watchers

Forks