"Rails Engine"/"Rails Driver" is a mock E-Commerce Application that utilizes service-oriented architecture, where the backend (Rails Engine) and the front end (Rails Driver) communicate via APIs. The primary purpose of the project is to expose the data (via Rails Engine) that powers the "site" through an API that the front end will consume.
- Expose an API ⭐ ⭐ ⭐
- Use serializers to format JSON responses ⭐ ⭐ ⭐
- Test API exposure ⭐ ⭐ ⭐
- Compose advanced ActiveRecord queries to analyze information stored in SQL databases ⭐ ⭐
- Write basic SQL statements without the assistance of an ORM ⭐
This project utilizes two separate Rails applications:
Both projects require:
- Ruby 2.5.3.
- Rails 5.2.4.3
- Fork this repository
- Clone your fork
- From the command line, install gems and set up your DB:
bundle install
rails db:create
rails db:migrate
rails import
-
Clone Rails Driver
-
From the command line, install gems and set up your DB:
bundle install
rails db:create
rails db:migrate
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. Append this to config/application.yml:
RAILS_ENGINE_DOMAIN: http://localhost:3000
- CD into the Rails Engine directory
- Run the test suite with
bundle exec rspec
.
- Within the Rails Engine app run your development server with
rails s
. - While the Rails Engine server is running, and in a separate terminal tab (
cmd+t
), CD into the Rails Driver directory. - Once the Rails Engine server is running, from within the Rails Driver directory run the test suite with
bundle exec rspec
- At this time there should be 1 failing test!