Skip to content

Jonathan-M-Wilson/rails-engine

Repository files navigation

Rails Engine

Contributors Forks Stargazers Issues

Rails Engine

Rails Engine is a backend application providing fully tested API endpoints that powers a fictitious E-commerce application.
Explore the docs »

· Report Bug · Request Feature

Table of Contents

About The Project

Rails Engine is a backend application providing fully tested API endpoints that powers a fictitious E-commerce application. Merchants have full CRUD functionality for their inventory, including business intelligence endpoints such as finding merchants with the most revenue, merchants with most items sold, revenue across a date range, and the total revenue for a single merchant.

This application exposes 20 RESTful endpoints. The statistical data provided through the business intelligence endpoints were calculated by analyzing over 4000 records of data. Rails Engine is backed by a PostgreSQL database, using ActiveRecord for an ORM as well as Fast_jsonapi for serialization.

Built With

Getting Started

To use Rails Engine locally, you can fork or clone this repo.

Configuration

  1. git clone git@github.com:Jonathan-M-Wilson/rails-engine.git
  2. cd rails_engine
  3. bundle install
  4. rake db:{create,migrate,seed}
  5. bundle exec rspec to run the test suite

Testing

Rails Engine has been fully tested. To view the test coverage;

Once inside your terminal within the Rails Engine directory run the following command.

open coverage

This will open up a folder with an index.html file. Clicking on this file will show you a list of all lines of code within this project, and whether they have been tested or not.

Additionally, running bundle exec rspec will show you the quick summary of the test coverage in this application.

Schema

After running your migrations, your schema will look something like this!

database

Endpoints

Below are listed some examples of the endpoints within Rails Engine. To see all endpoint available, please checkout the docs!

GET /merchants

List of all merchants recorded in the database

response

{
    "data": [
        {
            "id": "1",
            "type": "merchant",
            "attributes": {
                "name": "Schroeder-Jerde"
            }
        },
        {
            "id": "2",
            "type": "merchant",
            "attributes": {
                "name": "Klein, Rempel and Jones"
            }
        }
    ]
}
GET /merchants/1

Information about a specific merchant

{
    "data": {
        "id": "1",
        "type": "merchant",
        "attributes": {
            "name": "Schroeder-Jerde"
        }
    }
}
Get /merchants/5/revenue

Total revenue for a specified merchant.

{
    "data": {
        "id": null,
        "type": "revenue",
        "attributes": {
            "revenue": 714320.6700000002
        }
    }
}

Roadmap

See the open issues for a list of proposed features, known issues, and project extensions.

Contributing

Contributions are what make this community such an amazing and fun place to learn, grow, and create! Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch git checkout -b feature/NewGreatFeature
  3. Commit your Changes git commit -m 'Add some NewGreatFeature'
  4. Push to the Branch git push origin feature/NewGreatFeature
  5. Open a new Pull Request!

Contact

Jonathan Wilson - LinkedIn - GitHub

Project Link: Rails Engine

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published