Giter Site home page Giter Site logo

omaraskr1 / dinner-resturant-apis Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 78 KB

My portfolio project for the Codecademy Spring framework course. The goal is to build an API that can be used to rate different restaurants' ability to handle different types of allergies. In this project peanut, egg and dairy allergies are only taken into account.

dinner-resturant-apis's Introduction

Dining Reviews APIs

My portfolio project for the Codecademy Spring framework course. The goal is to build an API that can be used to rate different restaurants' ability to handle different types of allergies. In this project peanut, egg and dairy allergies are only taken into account.

Setting up and running the project

After downloading/forking the code, you can configure the server through the application.properties file found under the resources folder. To run the project open a terminal and change the directory to the project's directory and run the command mvn spring-boot:run.

Restaurants

All the http requests that can be made to the /restaurants endpoint.

Get all restaurants:
curl -X GET http://localhost:8080/restaurants

Get a specific restaurant by its id:
curl -X GET http://localhost:8080/restaurants/id

Insert a restaurant into the database:
curl -X POST -H "Content-Type: application/json" -d '{"name":"restaurantName","city":"restaurantCity","state":"restaurantState","zipcode":"restaurantZipcode"}' http://localhost:8080/restaurants/new 

Dining Reviews

All the http requests that can be made to the /reviews endpoint.

Get all dining reviews:
curl -X GET http://localhost:8080/reviews

Get a specific restaurant by its id:
curl -X GET http://localhost:8080/reviews/id

Insert a dining review into the database:
curl -X POST -H "Content-Type: application/json" -d '{"name":"username","restaurantId":"reviewRestaurantId","peanutScore":"reviewPeanutScore","eggScore":"reviewEggScore","dairyScore":"reviewDairyScore"}' http://localhost:8080/reviews/new

Users

All the http requests that can be made to the /users endpoint.

Get all users:
curl -X GET http://localhost:8080/users

Get a specific user by their username:
curl -X GET http://localhost:8080/users/username

Insert a new user into the database:
curl -X POST -H "Content-Type: application/json" -d '{"name":"username","city":"userCity","state":"userState","zipcode":"userZipcode","isPeanutAllergic":isUserAllergicToPeanuts,"isEggAllergic":isUserAllergicToEggs,"isDairyAllergic":isUserAllergicToDairy}' http://localhost:8080/users/new/signup

Admin

Get all the pending dining reviews:
curl -X GET http://localhost:8080/admin/pendingReviews

Update a specific dining review status:
curl -X PUT http://localhost:8080/admin/pendingReviews/reviewId?status=newReviewStatus

dinner-resturant-apis's People

Contributors

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