Rails Engine is a Ruby on Rails API that provides endpoints for managing merchants and items in an e-commerce platform.
- RESTful API for Merchants and Items
- Advanced search functionality for both Merchants and Items
- Relationship endpoints (e.g., items for a merchant, merchant for an item)
- Clone the repository:
git clone https://github.com/noahdurbin/rails-engine.git
cd rails-engine
- Install dependencies:
bundle install
- Set up the database:
rails db:create db:migrate db:seed
- Start the server:
rails server
To run the test suite:
bundle exec rspec
- Download the Collections: Click on each provided link and use your browser's "Save Page As" (Cmd-S or Ctrl-S) function to download the files to your computer.
- Import into Postman: Open Postman, click the "Import" button in the top left corner. Navigate to where you saved the files and select both.
- Confirm Import: Ensure the import type is "Collection" and the format is "Postman Collection v2.1". Click "Import" to finalize.
- Run Collections: You should now see two new collections in Postman and be able to open each collection and run them.
-
GET /api/v1/merchants
-
GET /api/v1/merchants/:id
-
GET /api/v1/merchants/:id/items
-
GET /api/v1/merchants/find?name=#{name}
-
GET /api/v1/merchants/find_all?name=#{name}
-
GET /api/v1/items
-
GET /api/v1/items/:id
-
POST /api/v1/items
-
PATCH /api/v1/items/:id
-
DELETE /api/v1/items/:id
-
GET /api/v1/items/:id/merchant
-
GET /api/v1/items/find?name=#{name}
-
GET /api/v1/items/find_all?name=#{name}
-
GET /api/v1/items/find?min_price=#{price}
-
GET /api/v1/items/find?max_price=#{price}
- Ruby 3.2.2
- Rails 7.1.3.4
- RSpec for testing
- Capybara
- Factory Bot for test data generation
- JSON:API serialization