Coder Social home page Coder Social logo

rails_engine's Introduction

Build Status Test Coverage Ruby Version Rails Version

Rails Engine

Introduction

This project uses provided sales data to provide a basic API for accessing that data. You can also run a variety of business intelligence queries against the database. Data is returned in the JSON format. Here are some sample requests:

See a list of all merchants

Visiting /api/v1/merchants/ returns:

[
  { 
    "id":1,
    "name":"Schroeder-Jerde"
  },
  {
    "id":2,
    "name":"Klein, Rempel and Jones"
  },
  {
    "id":3,
    "name":"Willms and Sons"
   }
]

Find a merchant by name

Visiting /api/v1/merchants/find?name=Kozey%20Group returns:

{
  "id":12,
  "name":"Kozey Group"
}

Find all items associated with a merchant

[
  {
    "id":210,
    "name":"Item Aut Sit",
    "description":"Rerum eos sapiente repellendus cupiditate praesentium. Nulla sint quisquam corrupti autem. Sapiente unde doloremque non et sunt ipsa.",
    "unit_price":"244.29",
    "merchant_id":12
  },
  {
    "id":211,
    "name":"Item Commodi Eveniet",

    "description":"Et exercitationem quas et expedita enim laborum. Facere incidunt illum expedita praesentium. Sequi ut labore sint in.",
    "unit_price":"77.37",
    "merchant_id":12
  }
]

Find total revenue for a merchant

Visiting /api/v1/merchants/12/revenue returns:

{
  "revenue":"725116.93"
}

Installation

To get started, run bundle from the command line in the root application directory.

Database Creation

To setup the database for initialization, run rake db:{create,migrate} from the command line.

Database Initialization

To import sales data from the provided CSV files, run rake import:csv from the command line. This process may take a few minutes.

Running the Test Suite

To run the test suite, run rspec from the command line to run the full test suite. You can also run rspec <path_to_spec_file> from the command line to run just one test, or run rspec spec/<models || requests> from the command line to run either model tests OR request tests.

rails_engine's People

Contributors

mikecm1141 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.