Your section headers will be used to reference location of destination.
Cookbook is a community driven recipe database, which gives users the ability to sign-up, submit recipes, search for community recipes, and search a larger 3rd party database.
Cookbook skips the unnecessary and presents straight-forward recipes, including name, photo, ingredients, and instructions. No filler, no life-story needed.
Our app is purpose-built from recipe submission to display to provide only the information you need to go from grocery store to kitchen.
Simply open the application in any browser. Once the page is loaded, signup, login, and begin adding and searching for recipes. Cookbook is community-driven, so why not share your favorite recipes!
Cookbook is live here
Axios\ Bulma\ dotenv\ Express\ Handlebars\ Moment.js\ multer\ MySQL\ Node.js\ Passport.js\ Sequelize\ spoonacular API
Future improvements for the application:
Routes returning a user recipe or spoonacular API random recipes:
app.get("/recipe/:id", function (req, res) {
const searchId = req.params.id;
db.Recipe.findOne({
where: { id: searchId },
include: db.Ingredient
})
.then((dbResult) => {
console.log(dbResult.dataValues)
const recipe = dbResult.dataValues;
let hbsObject = {
recipe: {
id: recipe.id,
title: recipe.title,
description: recipe.description,
instructions: recipe.instructions,
createdAt: () => {
return recipe.createdAt = moment().format("MMM Do YYYY");
},
ingredients: recipe.Ingredients.map(ingredient => {
return {
name: ingredient.name,
qty: ingredient.qty,
measurement: ingredient.measurement
}
})
}
};
res.render("recipe", {
recipe: hbsObject.recipe
})
})
.catch(err => console.log(err))
});
app.get("/api/random-recipe", function (req, res) {
let keys = [process.env.SPOON_API_KEY_1, process.env.SPOON_API_KEY_2, process.env.SPOON_API_KEY_3, process.env.SPOON_API_KEY_4];
let key = keys[Math.floor(Math.random() * keys.length)];
axios.get("https://api.spoonacular.com/recipes/random?number=2&tags=dinner&apiKey=" + key)
.then((response) => {
res.send(response.data);
})
.catch((error) => {
console.log(error);
})
MIT © shiftymitch, nvalline, nabeek
Developer | GitHub |
---|---|
Mitch Henderson | shiftymitch |
Nate Valline | nvalline |
Nick Beekhuizen | nabeek |