Skip to content

A Rust CRUD app for storing recipes, with Axum and Sqlx.

License

Notifications You must be signed in to change notification settings

andreweggleston/OxiDish

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OxiDish

A Rust CRUD app for storing recipes, with Axum and Sqlx. Heavily borrowed from https://github.com/davidpdrsn/realworld-axum-sqlx.

API Reference

Recipes

Listing recipes

GET /api/recipes
Parameters
name type data type description
ingredient_name_ids optional Integer Array list of ids of ingredient names to filter recipes by. If not provided, all recipes will be returned
Responses
http code content-type response
200 application/json {"recipes": [{id, title, description}..]}

Creating a recipe

POST /api/recipes
Parameters
name type data type description
title required String Title for new recipe
description required String description for new recipe
ingredients optional Array of {int,int,int} array of RecipeIngredientDto objects with format: {id_ingredient_name: integer, id_ingredient_quantity: integer, id_ingredient_unit: integer}
Responses
http code content-type response
200 application/json {id, title, description, ingredients: [{id_ingredient_name, id_ingredient_quantity, id_ingredient_unit}..]}

Showing one recipe

GET /api/recipes/:recipe_id
Responses
http code content-type response
200 application/json {id, title, description, ingredients: [{id_ingredient_name, id_ingredient_quantity, id_ingredient_unit}..]}

Updating a recipe

PUT /api/recipes/:recipe_id
Parameters
name type data type description
title required String new title for recipe
description required String new description for recipe
ingredients required Array of {int,int,int} array of RecipeIngredientDto objects with format: {id_ingredient_name: integer, id_ingredient_quantity: integer, id_ingredient_unit: integer}
Responses
http code content-type response
200 application/json {id, title, description, ingredients: [{id_ingredient_name, id_ingredient_quantity, id_ingredient_unit}..]}

Ingredient Names

Listing ingredient names

GET /api/ingredients/names
Responses
http code content-type response
200 application/json {"names": [{id, name}..]}

Creating an ingredient name

POST /api/ingredients/names
Parameters
name type data type description
name required String new ingredient name
Responses
http code content-type response
200 application/json {"id": integer, "name": string}

Ingredient Quantities

Listing ingredient quantities

GET /api/ingredients/quantities
Responses
http code content-type response
200 application/json {"quantities": [{id, quantity}..]}

Creating an ingredient quantity

POST /api/ingredients/quantities
Parameters
name type data type description
quantity required String new ingredient quantity
Responses
http code content-type response
200 application/json {"id": integer, "quantity": string}

Ingredient Units

Listing ingredient units

GET /api/ingredients/units
Responses
http code content-type response
200 application/json {"units": [{id, unit}..]}

Creating an ingredient unit

POST /api/ingredients/units
Parameters
name type data type description
unit required String new ingredient unit
truncation required String new ingredient unit truncation
Responses
http code content-type response
200 application/json {"id": integer, "unit": string, "truncation": string}

About

A Rust CRUD app for storing recipes, with Axum and Sqlx.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages