No Description http://refrigerator-alevel.tk

Vitalii Ivanov 8a60cf1883 v2.7 dashboard init 1 week ago
app 8a60cf1883 v2.7 dashboard init 1 week ago
bootstrap 2323cf4293 v1.0 complited migrations, seeders, models, relationships, tymonjwt authentication, API routes, controllers(signature) 3 weeks ago
config 174b4b4ac5 make socialite github FB GOOGLE 1 week ago
database 8a60cf1883 v2.7 dashboard init 1 week ago
public 8a60cf1883 v2.7 dashboard init 1 week ago
resources 8a60cf1883 v2.7 dashboard init 1 week ago
routes 8a60cf1883 v2.7 dashboard init 1 week ago
storage f9bd2f1719 refrig_controller 2 weeks ago
tests 2323cf4293 v1.0 complited migrations, seeders, models, relationships, tymonjwt authentication, API routes, controllers(signature) 3 weeks ago
.gitignore 8e3ebba17a make auth:web github icons 1 week ago
artisan 2323cf4293 v1.0 complited migrations, seeders, models, relationships, tymonjwt authentication, API routes, controllers(signature) 3 weeks ago
composer.json 8e3ebba17a make auth:web github icons 1 week ago
composer.lock 174b4b4ac5 make socialite github FB GOOGLE 1 week ago
package.json 2323cf4293 v1.0 complited migrations, seeders, models, relationships, tymonjwt authentication, API routes, controllers(signature) 3 weeks ago
phpunit.xml 2323cf4293 v1.0 complited migrations, seeders, models, relationships, tymonjwt authentication, API routes, controllers(signature) 3 weeks ago
readme.md af71e2945d v2.5 All Controllers have been done and merged with docs(Get recommended Recipes due to refrigerator too) 1 week ago
server.php 2323cf4293 v1.0 complited migrations, seeders, models, relationships, tymonjwt authentication, API routes, controllers(signature) 3 weeks ago
webpack.mix.js 2323cf4293 v1.0 complited migrations, seeders, models, relationships, tymonjwt authentication, API routes, controllers(signature) 3 weeks ago

readme.md

Refrigerator API


An instruction for BackEnd

  • clone repo
  • composer install
  • configure .env
  • php artisan key:generate
  • php artisan jwt:secret
  • php artisan config:cache
  • php artisan migrate
  • php artisan db:seed

Do not forget to add into .gitignore: .env .idea/ vendor/ .gitignore and other custom files or dirs.



API Documentation for FrontEnd

http://refrigerator-alevel.tk/api

USER

Url: /auth/register
Method: POST
Header: {Content-Type: application/json, Accept: application/json}
Body: { "name":"name", "email":"name@test.com", "password":"111111", "password_confirmation":"111111" }

Url: /auth/login
Method: POST
Header: {Content-Type: application/json, Accept: application/json}
Body: { "email":"name@test.com", "password":"111111" }

Url: /auth/user
Method: GET
Header: {Content-Type: application/json, Accept: application/json, Authorization: Bearer ghhdjd...}

Url: /auth/user
Method: PUT
Header: {Content-Type: application/json, Accept: application/json, Authorization: Bearer ghhdjd...}
Body: { "name":"newname", "email":"newemail@test.com" }

Url: /auth/user/password
Method: PUT
Header: {Content-Type: application/json, Accept: application/json, Authorization: Bearer ghhdjd...}
Body: { "password":"newpassword", "password_confirmation":"newpassword" }

Url: /auth/user
Method: DELETE
Header: {Content-Type: application/json, Accept: application/json, Authorization: Bearer ghhdjd...}

INGREDIENTS

Url: /ingredients
Method: GET
Header: {Accept: application/json, Authorization: Bearer ghhdjd...}

Url: /ingredients/id
Method: GET
Header: {Accept: application/json, Authorization: Bearer ghhdjd...}

Url: /ingredients
Method: POST
Header: {Content-Type: application/json, Accept: application/json, Authorization: Bearer ghhdjd...}
Body: { "name":"juice" }

Url: /ingredients/id
Method: PUT
Header: {Content-Type: application/json, Accept: application/json, Authorization: Bearer ghhdjd...}
Body: { "name":"juice new" }

Url: /ingredients/id
Method: DELETE
Header: {Accept: application/json, Authorization: Bearer ghhdjd...}

RECIPES

Url: /recipes
Method: GET
Header: {Accept: application/json, Authorization: Bearer ghhdjd...}
Api route to get all vavilable recipes for user(not recommended)

Url: /recipes/id
Method: GET
Header: {Accept: application/json, Authorization: Bearer ghhdjd...}

Url: /recipes
Method: POST
Header: {Content-Type: application/json, Accept: application/json, Authorization: Bearer ghhdjd...}
Body: { "name":"рецепт тест", "text":"ddddddddddddddd", "ingredients":[ {"juice":"1 шт"}, {"морковь":"1 шт"}, {"вода":"1 л"}, {"сода":" 1 г"} ] }

Url: /recipes/id
Method: PUT
Header: {Content-Type: application/json, Accept: application/json, Authorization: Bearer ghhdjd...}
Body: { "name":"рецепт тест", "text":"ddddddddddddddd", "ingredients":[ {"juice":"1 l"}, {"морковь":"1 шт"}, {"вода":"1 л"}, {"сода":" 1 г"} ] }
Fields "name", "text", "ingredients" are not required

Url: /recipes/id
Method: DELETE
Header: {Accept: application/json, Authorization: Bearer ghhdjd...}

REFRIGERATORS

Url: /refrigerator/ingredients
Method: GET
Header: {Accept: application/json, Authorization: Bearer ghhdjd...}
User's ingredients in the refrigerator

Url: /refrigerator/ingredients/id
Method: GET
Header: {Accept: application/json, Authorization: Bearer ghhdjd...}
User's ingredient by id

Url: /refrigerator/ingredients
Method: POST
Header: {Content-Type: application/json, Accept: application/json, Authorization: Bearer ghhdjd...}
Body: { "ingredient_id":"12", "amount":"40 g" }

Url: /refrigerator/ingredients/id
Method: PUT
Header: {Content-Type: application/json, Accept: application/json, Authorization: Bearer ghhdjd...}
Body: { "amount":"40 ff" }

Url: /refrigerator/ingredients/id
Method: DELETE
Header: {Accept: application/json, Authorization: Bearer ghhdjd...}
Delete user's ingredient from refrigerator

Url: /refrigerator/recipes
Method: GET
Header: {Accept: application/json, Authorization: Bearer ghhdjd...}
Api route to get recommended recipes for user (paginated by 9)