All Projects → madeindjs → market_place_api_6

madeindjs / market_place_api_6

Licence: other
Code example of API on Rails 6 book https://github.com/madeindjs/api_on_rails

Programming Languages

ruby
36898 projects - #4 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to market place api 6

FSharp.JsonApi
Use F# to create and consume flexible, strongly typed web APIs following the JSON:API specification
Stars: ✭ 20 (+11.11%)
Mutual labels:  jsonapi, api-rest
reky
Reky is an opensource API development platform. It automatically visualizes API response with outstanding graphs & tables.
Stars: ✭ 22 (+22.22%)
Mutual labels:  api-rest
jsonapi-serializable
Conveniently build and efficiently render JSON API resources.
Stars: ✭ 43 (+138.89%)
Mutual labels:  jsonapi
vemdezapbe.be
Vem de zap bb 😏😊😂
Stars: ✭ 33 (+83.33%)
Mutual labels:  api-rest
dart-express
Express-like HTTP framework written in Dart
Stars: ✭ 34 (+88.89%)
Mutual labels:  api-rest
cleanapi
Pretty tornado wrapper for making lightweight REST API services
Stars: ✭ 26 (+44.44%)
Mutual labels:  api-rest
laravel5-jokes-api-with-jwt-and-pagination
Laravel5 Full Fledged API with JWT auth
Stars: ✭ 15 (-16.67%)
Mutual labels:  api-rest
cv4pve-api-php
Proxmox VE Client API for PHP
Stars: ✭ 45 (+150%)
Mutual labels:  api-rest
buscador-ao
Ponto de obtenção de informações públicas de Angola
Stars: ✭ 21 (+16.67%)
Mutual labels:  api-rest
reedelk-runtime
Reedelk Runtime Platform Community Edition
Stars: ✭ 25 (+38.89%)
Mutual labels:  api-rest
fire
An idiomatic micro-framework for building Ember.js compatible APIs with Go.
Stars: ✭ 56 (+211.11%)
Mutual labels:  jsonapi
The-Code-Bending-Dictionary
🧚🏽‍♀️ learn tech vocab in a friendly way 🧚🏽‍♀️ CONTRIBUTIONS WELCOME! 🔥
Stars: ✭ 19 (+5.56%)
Mutual labels:  api-rest
liuye
柳叶清单开放 API 文档
Stars: ✭ 32 (+77.78%)
Mutual labels:  api-rest
openbrewerydb-rails-api
Official v1 Open Brewery DB REST API built with Ruby on Rails
Stars: ✭ 17 (-5.56%)
Mutual labels:  api-rest
JSONAPISerializer
JSONAPISerializer for Server Side Swift
Stars: ✭ 21 (+16.67%)
Mutual labels:  jsonapi
php-serializer
Serialize PHP variables, including objects, in any format. Support to unserialize it too.
Stars: ✭ 47 (+161.11%)
Mutual labels:  jsonapi
nuada-cli
Nuada CLI was designed to improve your development experience by using ExpressJS and Mongoose tools.
Stars: ✭ 19 (+5.56%)
Mutual labels:  api-rest
Aweme-Kuaishou-Douyin
抖音大部分接口,以及快手的首页feed接口 soul app接口 nice app接口 毒app加签接口
Stars: ✭ 109 (+505.56%)
Mutual labels:  api-rest
AniAPI
Core behind AniAPI HTTP Rest APIs.
Stars: ✭ 144 (+700%)
Mutual labels:  api-rest
go-api-boilerplate
Boilerplate for Golang API
Stars: ✭ 153 (+750%)
Mutual labels:  api-rest

Market Place API

This repository contains application example build into the API on Rails 6 book.

This final application will scratch the surface of being a market place where users will be able to place orders, upload products and more. There are plenty of options out there to set up an online store, such as Shopify, Spree or Magento.

The purpose of this application is not only to teach you how to build an API with Rails but rather to teach you how to build an evolutive and maintainable API with Rails. That is, improve your current knowledge with Rails. On this journey, you will learn to:

  • Building JSON responses
  • Test your end-points with unit and functional tests
  • Set up authentication with JSON Web Tokens (JWT)
  • Optimize and cache the API

Setup

git clone https://github.com/madeindjs/market_place_api_6
cd market_place_api_6
bundle install
rake db:create
rake db:migrate

Usage

Create user

curl -X POST -d 'user[email][email protected]' -d 'user[password]=toto1234' localhost:3000/api/v1/users

Obtain token

curl -X POST -d 'user[email][email protected]' -d 'user[password]=toto1234' localhost:3000/api/v1/tokens

Manage product

export TKN="eyJhbG...WqaXAcnE" # from /api/v1/tokens
# create
curl -X POST -H "Authorization: $TKN" -d "product[title]=Bag" -d "product[price]=10" localhost:3000/api/v1/products
# update: publish and add stock
curl -X PATCH -H "Authorization: $TKN" -d "product[published]=true" -d "product[quantity]=2" localhost:3000/api/v1/products/19
# list
curl -H "Authorization: $TKN" localhost:3000/api/v1/products
# delete
curl -X DELETE -H "Authorization: $TKN" localhost:3000/api/v1/products/19

Manage order

export TKN="eyJhbG...WqaXAcnE" # from /api/v1/tokens
# create
curl -X POST -H "Authorization: $TKN" -d "order[product_ids_and_quantities][][product_id]=20" -d "order[product_ids_and_quantities][][quantity]=1" localhost:3000/api/v1/orders
# list
curl -H "Authorization: $TKN" localhost:3000/api/v1/orders
# show
curl -H "Authorization: $TKN" localhost:3000/api/v1/orders/7

Requirments

  • Ruby 2.5+
  • Sqlite
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].