Code Monkey home page Code Monkey logo

depot's Introduction

##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

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.