Code Monkey home page Code Monkey logo

rails_engine's Introduction

Rails Engine

rails_engine is an exercise in creating an internal API that serves up business anyltics. It features endpoints that return information on customers, merchants, invoices, invoice items and transactions.

This project was built as part of the Turing School Back End Engineering Curriculum. The spec (containing all of the endpoints that can be reached) can be found here.

Collaborators

Annie Wolff

Daniel Rodriguez

Setup

To run rails_engine on your own machine simply clone this repository by running:

git clone [email protected]:wlffann/rails_engine.git

You will also need the data from Sales Engine. Clone this repository and copy the data by running:

git clone https://github.com/turingschool-examples/sales_engine.git

mkdir rails_engine/db/data

cp -R sales_engine/data/ rails_engine/db/data/

To set up your app and create your database, run:

cd rails_engine

bundle install

rake db:create

rake db:migrate

rake db:test:prepare

rake db:seed

This will give you a fully bundled app and a seeded database. Use the command rspec to run the test suite and start hitting endpoints!

Available endpoints

Merchants

Records

GET /api/v1/merchants

GET /api/v1/merchants/:id

GET /api/v1/merchants/find?parameters

GET /api/v1/merchants/find_all?parameters

GET /api/v1/merchants/random

Relationships

GET /api/v1/merchants/:id/items

GET /api/v1/merchants/:id/invoices

Business Intelligence

GET /api/v1/merchants/:id/revenue

GET /api/v1/merchants/:id/revenue?date=x

GET /api/v1/merchants/most_items?quantity=x

GET /api/v1/merchants/:id/customers_with_pending_invoices

GET /api/v1/merchants/:id/favorite_customer

GET /api/v1/merchants/revenue?date=x

GET /api/v1/merchants/most_revenue?quantity=x

Items

Records

GET /api/v1/items

GET /api/v1/items/:id

GET /api/v1/items/find?parameters

GET /api/v1/items/find_all?parameters

GET /api/v1/items/random

Relationships

GET /api/v1/items/:id/invoice_items

GET /api/v1/items/:id/merchant

Business Intelligence

GET /api/v1/items/:id/best_day

GET /api/v1/items/most_items?quantity=x

GET /api/v1/items/most_revenue?quantity=x

Invoices

Records

GET /api/v1/invoices

GET /api/v1/invoices/:id

GET /api/v1/invoices/find?parameters

GET /api/v1/invoices/find_all?parameters

GET /api/v1/invoices/random

Relationships

GET /api/v1/invoices/:id/transactions

GET /api/v1/invoices/:id/invoice_items

GET /api/v1/invoices/:id/items

GET /api/v1/invoices/:id/customer

GET /api/v1/invoices/:id/merchant

GET /api/v1/invoice_items/:id/invoice

Invoice_Items

Records

GET /api/v1/invoice_items

GET /api/v1/invoice_items/:id

GET /api/v1/invoice_items/find?parameters

GET /api/v1/invoice_items/find_all?parameters

GET /api/v1/invoice_items/random

Relationships

GET /api/v1/invoice_items/:id/invoice

GET /api/v1/invoice_items/:id/item

Transactions

Records

GET /api/v1/transactions

GET /api/v1/transactions/:id

GET /api/v1/transactions/find?parameters

GET /api/v1/transactions/find_all?parameters

GET /api/v1/transactions/random

Relationships

GET /api/v1/transactions/:id/invoice

Customers

Records

GET /api/v1/customers

GET /api/v1/customers/:id

GET /api/v1/customers/find?parameters

GET /api/v1/customers/find_all?parameters

GET /api/v1/customers/random

Relationships

GET /api/v1/customers/:id/invoices

GET /api/v1/customers/:id/transactions

Business Intelligence

GET /api/v1/customers/:id/favorite_merchant

rails_engine's People

Contributors

drod1000 avatar wlffann avatar

Watchers

James Cloos 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.