Rails Engine is an E-Commerce Application using a service-oriented architecture. The front and back ends of this application are separate and communicate via APIs. The main objective of this project is to expose the data that powers the site through various API endpoints that the front end will consume.
- Expose an API
- Test API exposure
- Use serializers to format JSON responses
- Compose advanced ActiveRecord queries to analyze information stored in SQL databases
- Write SQL statements without the assistance of an ORM
- In your terminal, create a directory called
rails-engine
mkdir rails-engine
- Next you will want to
cd
into this new directory
cd rails-engine
- Fork this repo and put it into your
rails-engine
directorygit clone [email protected]:github_username/rails-engine.git
cd
into your forked repo and open up atom- You will then run
bundle install
to load all of the gems - Then you will need to run:
rake db:{create,migrate,seed}
; This will create, migrate and seed your database
- You will also need to put the Front end portion of this project (Rails Driver) into the
rails-engine
directory you created
- Fork this repo
git clone [email protected]:github_username/rails_driver.git
cd
into your forked repo and open up atom- follow the set up instructions located in the README
- Since this is using service-oriented architecture, you will need to run both of these simultaneously. I found that having four separate tabs open in my terminal helps with this. So you will have your
rails-engine
running in one tab, you will then runrails s
in another tab. You will want to haverails_driver
open in another tab and in your final tab you will runrails s -p 3001
.
rails-engine -> rails s
rails_driver -> rails s -p 3001
In this project you will be building multiple endpoints for merchants and items. To see what these endpoints should look like and implement them, you can refere to the rails-engine-postman_collection.json
file located in the file tree and import that into Postman.
Below you will see a diagaram showing the relationships for all of the tables
For this project you will need to run the tests for both your rails-engine
and also run the spec harness tests for rails_driver
.
The tests for rails-engine
will be written by you using OOP, encapsulation and abstraction. We want to make sure that we are using SRP.
rails-engine will use rails s
The tests for rails_driver
have already been written.
rails_driver will use rails s -p 3001
Both consoles will be running simultaneously. You will use the following command to run the tests:
bundle exec rspec
Dani Coleman - LinkedIn
Project Link: Rails Engine