dushi27 / depot

B to C E-comm app managed by D Pieris

Home Page:http://dushi27.github.io/depot/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

##E-commerce Web App

Book-Z is a business to consumer e-commerce application built based on Agile Web Development with Rails. Currently the application is live on bookz.herokuapp.com. Please feel free to explore the consumer interface and the admin interface of the application (admin username: bookzrails and password: bookzrails2014). If you have any questions, concerns or issues please feel free to contact me via @Dushyanthi1 twitter handle.

The following documentation describes;

  1. About and Technical Specs

  2. How to use the Products API

  3. Create a locat copy and testing

##About and Technical Specs

Book-z is built using Ruby on Rails version 4.1.1 and Ruby 2.1.1. It is currently in production using Postgresql database on Heroku cloud scalable server. It also integrate Mendrill email infrastructure and Google Analytics for application usage statistics.

##Using the Products API

Book-Z also offers an autheticated RESTful JSON API of its products catalog. The access is limited to the Admin users of the application. To use the products API;

Step 1: Go to bookz.herokuapp.com/api/v1/products.json

Step 2: If you are not already signed in as an admin user, it will alert a login. Please ender the username "john" and password "john2014" OR if you have created a new Admin user, enter the appropriate credentials. Note that only an Admin user can create another admin user.

Step 3: It'll render a list of products currently saved on the catalog

Step 4: To access a single product, add the product id to the URL. Example, bookz.herokuapp.com/api/v1/products/1.json. Above will render the first product in the catalog.

###Curl Examples for Products API

  1. To get the products catalog
curl -u john:john2014 http://bookz.herokuapp.com/api/v1/products.json
  1. Get each product by product ID
curl -u john:john2014 http://bookz.herokuapp.com/api/v1/products/1.json

##Creating a Local Copy and Testing

Step 1: Click the 'Fork' button on the top right on your screen. That will create a copy of the repo under your Github username.

Step 2: In your command line/ terminal run

$ git clone GIT CLONE URL 

GIT CLONE URL = https://github.com/INSERT YOUR USERNAME/Twitter.git or you can copy the "HTTP CLONE url"

Step 3: Run the following commands to install the necessary gems

$ bundle install 

to migrate the database (This repository use Rails 4.1.1 if you are using older version migrate the test environment):

$ rake db:migrate

to execute the lib task sample data

$ rake db:seed 

Note:Seed will create an Admin user for the admin tools demo.

to run project in a locally

$ rails s 

###Testing

The application uses Rails test suite for automated testing. All the tests are located in the test directory.

To run all the existing tests;

$ rake test test/

To run products controller tests

$ rake test test/controllers/products_controller_test.rb

About

B to C E-comm app managed by D Pieris

http://dushi27.github.io/depot/


Languages

Language:JavaScript 65.0%Language:CSS 32.7%Language:Ruby 1.6%Language:HTML 0.7%Language:CoffeeScript 0.1%