GithubHelp home page GithubHelp logo

rails-engine's Introduction

Rails Engine

An Exercise in Building an API in Rails
Turing School of Software and Design, Module 3

Table of Contents
  1. About The Project
  2. Getting Started
  3. Contributors

Project Details

The purpose of this project is to practice building a practical API application.
Using data related to a mocked e-commerce platform, the goal of this project is to design serializers to format JSON files that can be accessed through a controller.

For a complete breakdown of the project's technical requirements and goals for understanding, please click this link:
Rails Engine Lite

Built With

Tested With

(back to top)

Getting Started

Installation

  1. Fork this Repo (optional), or Clone this Repo with the following command:
  • Using https:
  git clone https://github.com/ZacHazelwood/Rails-Engine.git
  • Using SSH key:
  git clone [email protected]:ZacHazelwood/Rails-Engine.git
  1. Install Required Technologies, or check for correct versions using the following commands:
  ruby -v
  rails-v
  rspec -v
  postgres -V
  1. Install required gems included within the gemfile:
  bundle install
  1. Create PostgreSQL database, run migrations and seed the database:
  rails db:{create,migrate,seed}

(back to top)

Usage

To access the data presented, simply launch a local server by typing rails s into the command prompt.
Then, use a browser or PostMan (or equivalent) to explore the API from the following URL and included endpoints, listed below:

  http://localhost:3000

If using PostMan, please follow the instructions provided beneath the Postman header from the project details page, Rails Engine Lite

API Endpoints

Merchants:

  • get all merchants GET http://localhost:3000/api/v1/merchants
  • get one merchant GET http://localhost:3000/api/v1/merchants/:merchant_id
  • get all items held by a given merchant GET http://localhost:3000/api/v1/merchants/:merchant_id/items

Items:

  • get all items GET http://localhost:3000/api/v1/items
  • get one item GET http://localhost:3000/api/v1/items/:item_id
  • create an item POST http://localhost:3000/api/v1/items/:item_id
  • edit an item PUT http://localhost:3000/api/v1/items/:item_id
  • delete an item DESTROY http://localhost:3000/api/v1/items/:item_id
  • get the merchant data for a given item ID GET http://localhost:3000/api/v1/items/:item_id/merchant

Search:

  • find one merchant by name GET http://localhost:3000/api/v1/merchants/find?name=some_query
  • find all merchants by name GET http://localhost:3000/api/v1/merchants/find_all?name=some_query
  • find one item by name GET http://localhost:3000/api/v1/items/find?name=some_query
  • find all items by name GET http://localhost:3000/api/v1/items/find_all?name=some_query
  • find one item by minimum price GET http://localhost:3000/api/v1/items/find?min_price=some_query
  • find one item by maxmimum price GET http://localhost:3000/api/v1/items/find?max_price=some_query
  • find one item by price range GET http://localhost:3000/api/v1/items/find?min_price=some_query&max_price=another_query

(back to top)

Contributors

Zac Hazelwood

(back to top)

rails-engine's People

Contributors

zachazelwood avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.