Giter VIP home page Giter VIP logo

travisgm92 / the_engine Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 752 KB

This was a solo project during Module 3 while I attended Turing School of Software & Design. The main goal here was to expose an API. We created multiple endpoints and the tests to go along with them. We had to test our final results against a spec harness that was provided

Ruby 99.73% HTML 0.27%
api-rest api tdd rails ruby ruby-on-rails rubocop-rails rspec mvc

the_engine's Introduction

README

Set-up

  1. First make sure your computer is running the correct Rails and Ruby versions (Rails: 5.2.4.3, Ruby: 2.5.3). If you aren't running the correct versions, visit this page and follow the instructions.

  2. Clone this repo into your computer, enter into that repository on your command line and run the following command in your terminal: bundle then run rails db:{created,migrate}, lastly run bundle exec figaro install.

  3. From here you can run bundle exec rspec to see all the tests that were written for this project. In order to run the spec harness one would need to clone the rails_driver repo into the same directory as this one, then add RAILS_ENGINE_DOMAIN: http://localhost:3000 inside the config/application.yml file inside the rails_engine repo on your local copy. Then, run rails s from one terminal window (while inside the rails_engine repo) and open a second terminal window and go into the rails_driver repo and run bundle exec rspec to see the spec harness for this project. This is where you can clone the rails_driver repo.

Project Purpose

The main purpose of this project was to develop an application that exposed it's own API. We had to first import a series of CSV files, then process them into our database. The tables we created were; merchants, customers, items, invoice items, invoices, and transactions. We then had to establish relationships between all of the tables. Merchants have items and invoices, and through invoices, has invoice items which gives access to customers, etc.

API Endpoints

  1. One specific item ("/api/v1/items/179")
  2. All items in the database ("/api/v1/items")
  3. CRUD items (post, get, patch and destroy-- "/api/v1/items")
  4. CRUD merchants (post, get, patch and destroy-- "/api/v1/merchants")
  5. All merchants in the database ("/api/v1/merchants")
  6. Get all items for one specific merchant ("/api/v1/merchants/(merchant id)/items")
  7. Find what merchant an item belongs to ("/api/v1/items/(item id)/merchant")
  8. Search the database with any of the attributes belonging to merchants or items and get back either a list of objects that match the query or one object that matches the query ("/api/vi/merchants/find_all?name=ill") OR ("/api/v1/items/find?name=haru").
  9. And lastly, search the database for specific calculations.
  • merchants with the most revenue
  • merchants who have sold the most items
  • total revenue of ALL merchants within a specific date range

the_engine's People

Contributors

travisgm92 avatar

Watchers

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