Coder Social home page Coder Social logo

rails-engine's Introduction

Rails-Engine-Lite

Contents:

  • Rails Engine Lite is a project that exposes API endpoints for a E-Commerce Application. The front and back end of this application are seperate and communicate vie API.
  • Exposes API enpoints

  • Uses serializers to format JSON responses

  • Test API exposure

  • Use SQL and AR to gather data

Installation

  1. Clone the repo

    git clone https://github.com/caden-jarrett/rails-engine
  2. Install Ruby 2.7.4 and Rails 5.2.7

  3. Install required gems using the included gemfile

    bundle install
  4. Create Postgresql database, run migrations and seed database

    rails db:{create,migrate,seed}
  5. Launch local server

    rails s
  6. Use a browser or tool like PostMan to explore the API on http://localhost:3000

    http://localhost:3000

Dependencies:

  • Ruby Version: 2.7.4

  • Rails Version: 5.2.8

Gems:

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=iLl

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.