GithubHelp home page GithubHelp logo

rails_driver's Introduction

Endpoints

List of resources.
'/api/v1/'.
List by id.
'/api/v1//'.
Relationships.
'/api/v1/merchants/:id/items' - Merchant with all thier items.
'/api/v1/items/:id/merchant' - Item with associated merchant.
'/api/v1/merchants/find?=' Locate merchant by name.
Business Intellignce.
'/api/v1/merchants/find_all?=' Locate all merchants with related name.
'/api/v1/merchants/most_revenue?quantity='. List of merchants with highest revenue (quantity will return that many top revenues).
'/api/v1/merchants/most_items?quantity='. List of merchants with most items sold (quantity will return that many top revenues).

Rails Driver

This application is part of the Rails Engine project for the Turing School of Software and Design.

It includes

  1. A Test Suite for Rails Engine
  2. A Front End for Rails Engine

Set Up

Versions

  • Rails 5.1.7
  • Ruby 2.5.3

First clone the repository and then run the following commands:

  1. bundle (if this fails, try to bundle update and then retry)
  2. rails db:create && rails db:migrate
  3. bundle exec figaro install

This last command should create the file config/application.yml. Open this file and add configuration for the Environment variable RAILS_ENGINE_DOMAIN. This should be the url from where Rails Engine is being served. If you are only using Rails Driver locally, append this to config/application.yml:

RAILS_ENGINE_DOMAIN: http://localhost:3000

Test Suite

spec/features/harness_spec.rb includes tests for the Rails Engine Project. In order for this test suite to run properly, you will need to:

  1. Make sure your Rails Engine Database is seeded with the original data from the provided csv files
  2. Make sure Rails Engine is serving from the url you specified in config/application.yml (localhost:3000 if you copied the example config/application.yml above)

Front End

You can also use the Front End to test Rails Engine. The Front End is an example of how your Rails Engine API could be consumed.

First, you will need to enable Cross Origin Resource Sharing (CORS) on your Rails Engine. Do this using the Rack CORS gem. Folllow the instructions to get this set up (make sure you are following these instructions for Rails Engine, NOT Rails Driver).

If you are running Rails Engine on localhost:3000 as in the examples above, you will need to run Rails Driver on a different port, for example:

rails s -p 3001

Navigate your browser to localhost:3001 to see Rails Driver in action.

If you are just starting the project, you should see an empty Item index.

rails_driver's People

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.