---
# System prepended metadata

title: Untitled

---

## Summary
Many food banks must store lots of data and information regarding their stock of various food items. Currently, most food banks do not provide a way for clients to remotely see what is in stock. This requires clients to physically go to the location to see what the food bank has available. Additionally, there is no centralized way for people to see the inventory at all their local food banks. We created an API for clients to easily check the inventory at multiple food banks as well as get directions, recipe ideas, and check the weather. 

## External APIs
* Google Maps Embed API 
    * Users can query for directions to the desired food bank
* OpenWeatherMap API 
    * Check whether it is appropriate to travel to a foodbank on foot/bike
* Spoonacular
    * Given the available inventory, give recipe recommendations

## Tools
* MySQL
    * Created a MySQL database within a docker container to store inventory and food bank data
* Docker container to contain the APIs
    * Packages all of our dependencies that we might need for our APIs
* Docker compose
    * We created a docker-compose.yml to handle the setup for all our docker containers

## API Endpoints
* Food API
    * `v1/food`
        * Returns a list of all food items.
    * `v1/food/category/<CAT>`
        * Cat is one of fruit, vegetable, grain, protein, dairy, dessert
        * Cat is the category of type of food
        * Returns a list of food items:
    * `v1/food/name/<NAME>`
        * Returns the number of items of that food each bank has (only listed if a bank has it)
    * `v1/food/id/<ID>`
        * Returns the number of items of that food each bank has (only listed if a bank has it)
* Bank API
    * `v1/banks`
        * List out all the food banks
    * `v1/banks/<BANKID>`
        * List out all `<food, number>` from that bank
    * `v1/banks/<BANKID>/category/<CAT>`
        * List out all all the food's of category `<CAT>` from that bank
    * `v1/banks/<BANKID>/food/name/<NAME>`
        * List out all the foods with name `<NAME>` from that bank
    * `v1/banks/<BANKID>/food/id/<FID>`
        * List out food with id `<FID>` form that bank
    * `v1/banks/<BANKID>/directions`
        * Returns directions from input location to that bank
    
## Extra APIs

*   `/v1/recipes/<bid>`
    *   Given ingredients, we can provide list of food items they can make with a specific bank of id `bid`
    *   Params
        *   List of ingredientss that Food Bank has
    *   Output
        *   List of food items that the Food bank can potentially make (with the ingredients it has now)
*   `/v1/serve_now/<bid>`
    *   Checks the weather of some bank with `bid` 
    *   Params
        *   bid: Bank ID 
    *   Output
        *   Current Temperature
        *   Whether it is raining