GithubHelp home page GithubHelp logo

rest-api-demo's Introduction


Sample Restaurants API

Project DescriptionProject SetupDocumentationAPI EndpointsAuthorsLicense

Project Description

This is a simple API test for fun

Project Setup

To run the project locally,

Clone this repo git clone https://github.com/mashm3ll0w/rest-api-demo.git

Move into the directory cd rest-api-demo

Install project dependencies bundle install

Create the databases and add some seed data rails db:migrate db:seed

Start the server rails server

Navigate on your browser to http://localhost:3000/

Note:

  1. This project depends on ruby 2.7.6
  2. For testing, Postman is recommended for it's ease of use (you can use curl if you are comfortable on the terminal)

Documentation

The Project documentation can be viewed at https://documenter.getpostman.com/view/24296873/2s93z6dj6U

API Endpoints

POST /signup


Creates a new user.

Takes 4 parameters name, email, password, password_confirmation

POST /login


Logins a user

Takes 2 params email, password

GET /restaurants


View all restaurants

Uses Authorization: Bearer <token> for authorization.

Returns a list of all the restaurants

GET /restaurants/:id


View a single restaurant with the given id

Uses Authorization: Bearer <token> for authorization.

Returns the restaurant and a list of all its menus

GET /restaurants/:id/menus


View a single restaurant with the given id

Uses Authorization: Bearer <token> for authorization.

Returns a list of menus served at the restaurant

GET /restaurants/:id/menus/:id


View a single restaurant with the given id and the menu with the second id

Uses Authorization: Bearer <token> for authorization.

Returns a single menu item with the given id

POST /restaurants/:id/menus/:id


Order from the restaurant with the given id and the menu with the second id

Uses Authorization: Bearer <token> for authorization.

Returns an order for the menu given id

GET /orders


View all orders

Uses Authorization: Bearer <token> for authorization.

Returns a list of all the orders for the current user

GET /orders/:id


View the order with the given id

Uses Authorization: Bearer <token> for authorization.

Returns a single order with the given id

PATCH /orders/:id


Handles order fulfillment

Uses Authorization: Bearer <token> for authorization.

Takes a single parameter, either true or false

Returns the order with the fulfilled status using the parameter sent.


Authors

Charles Swaleh

License

This software is licensed under the MIT License

rest-api-demo's People

Contributors

mashm3ll0w 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.