Skip to content

Callbritton/rails_engine

Repository files navigation

Rails Engine

BE Mod 3 Week 3 Solo Project

Development Team:

Background and Description

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

Learning Goals

  • 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 ⭐

Schema

Schema Light Screenshot

Setup

This project utilizes two separate Rails applications:

Both projects require:

  • Ruby 2.5.3.
  • Rails 5.2.4.3

Setup Rails Engine:

  • 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

Setup Rails Driver

  • 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

Testing

Test Rails Engine:

  • CD into the Rails Engine directory
  • Run the test suite with bundle exec rspec.

Test the Spec Harness In Rails Driver:

  • 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!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published