Giter Site home page Giter Site logo

recipe_db's Introduction

Recipe DB

This repository aims to create a user interface to browse through a collection of recipes. The advantage it brings is to find recipes not only by their name, but also by ingredients or text contained within the recipe (e.g. style of cooking, dinner or lunch recipes, number of servings, etc.).

The user requirements for this digital recipe cookbook may change over time, but the scope of this project will include:

  • Keeping a collection of recipes, visible to anyone.
  • Authentication system, to register and login users who may want to create or add their recipes.
  • To create a recipe, a user must register and login.
  • To create a recipe, it must have a title, a set of ingredients, and a set of instructions. Otherwise, the creation of the recipe is not successful.
  • Upon creation, the author may edit the contents of the recipe.
  • Search recipe by name
  • Search recipe by ingredient
  • Regex search.

New points to build on:

  • Recipe recommendation system
  • Have a "favourite" recipes page
  • Have a "reduce waste" recommendation system

Stack

The project is run with Flask as the back-end server and MongoDB as the database engine.

Project structure

The main app is inside the folder "Flaskr". It contains

  • "static" folder: For css and js files
  • "templates" folder: For html files
    • base.html: Base HTML template used in the other templates
    • "auth" folder: HTML files for the authentication pages
    • "recipes" folder: HTML files for the recipe interface pages
  • init.py - starting point for the app
  • auth.py - blueprint responsible for authentication routes
  • home.py - blueprint responsible for the recipe-interface routes
  • recipe.py - middleware that interacts with db.py for DB tasks
  • user.py - middleware that interacts with db.py for authentication DB tasks
  • db.py - file responsible of managing the DB interactions

The "tests" folder contains the tests. The "config.py" file in the main directory contains the different configurations used for development and testing.

MongodDB structure

MongoDB is used as the database solution, because it provides more flexibility when it comes to storing varying amounts of text for the "ingredients" and "instructions. The Mongo database instance was generated on Mongo Atlas, and two collections were created: "users" and "recipes".

  • "users" collection: Designed to store the email, username and password hashes.
  • "recipes" collection: Design to store the details of the recipes. Currently, it doesn't store the author id or author name, although this could be implemented in the future.

## How to run the project Dependencies for the project:

  • Python
  • Flask
  • PyMongo
  • MongoDB Collection - this is running on a cloud instance. It will go dormant after extended periods of being unused. Will need to log in and activate the collection if that's the case.

On the terminal run "flask run".

recipe_db's People

Contributors

martanunesdea avatar

Watchers

James Cloos avatar  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.