-
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.
-
Clone this repo into your computer, enter into that repository on your command line and run the following command in your terminal:
bundle
then runrails db:{created,migrate}
, lastly runbundle exec figaro install
. -
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 therails_driver
repo into the same directory as this one, then addRAILS_ENGINE_DOMAIN: http://localhost:3000
inside theconfig/application.yml
file inside the rails_engine repo on your local copy. Then, runrails 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 runbundle exec rspec
to see the spec harness for this project. This is where you can clone the rails_driver repo.
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.
- One specific item ("/api/v1/items/179")
- All items in the database ("/api/v1/items")
- CRUD items (post, get, patch and destroy-- "/api/v1/items")
- CRUD merchants (post, get, patch and destroy-- "/api/v1/merchants")
- All merchants in the database ("/api/v1/merchants")
- Get all items for one specific merchant ("/api/v1/merchants/(merchant id)/items")
- Find what merchant an item belongs to ("/api/v1/items/(item id)/merchant")
- 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").
- 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