Giter VIP home page Giter VIP logo

online-cookbook-6's Introduction

Project Online Cookbook

Online cookbook to Find and Share recipes.

ResponsiveView

Table of Content:


Features

  • Site owner's goal: Allow users to share recipes

  • Potential features to include:

    • Create a web application that allows users to store and easily access cooking recipes. Recipes would include fields such as ingredients, preparation steps, required tools, cuisine, etc.

    • Create the backend code and frontend form(s) to allow users to add new recipes to the site, edit them and delete them.

    • Create the backend and frontend functionality for users to locate recipes based on the recipe's fields. You may choose to create a full search functionality, or just a directory of recipes.

    • Provide results in a manner that is visually appealing and user friendly.

  • Advanced potential feature (nice-to-have):

    • Create a dashboard to provide some statistics about all the recipes.

UX

See the initial mockup here

Color choices:

Primary Secondary
Primary Color Secondary Color

Database

MongoDB

We will be using the free tier of MongoDB Atlas which is a cloud MongoDB service. You can find more information here

Creating the Database

  1. Create a free account on the mongodb website and [sign in].(https://cloud.mongodb.com/user#/atlas/login)

  2. Create a free tier cluster, database and a mongodb user for your cluster. You can follow the instructions here how to do this.

  3. In your database the following collections will be created by the application:

    • user
    • recipe

And the following collections need to be manually created:

  • category ( as per ER diagram below )
  • cuisine ( as per ER diagram below )
  • countries ( import this json file )

ER Diagram

The database will be constructed according to the following Entity Relationship diagram:

ER-Diagram

Click here to view the diagram in your browser.

This ER-Diagram is made using draw.io.

Technologies Used

  • HTML
  • CSS
  • Javascript
  • Python3
  • MongoDB

Modules/Frameworks:

  • JQuery
  • Materialize
  • Flask
  • Flask-Login
  • Flask-WTF
  • Python unitttest

Testing

The Flask app is tested using pythons unittest module in combination with the coverage module for seeing the code coverage of the unit tests.

Coverage:

Name Stmts Miss Cover
app.py 142 44 69%
form.py 9 0 100%
tests.py 75 0 100%
user.py 15 3 80%
TOTAL 241 47 80%

Click here for > full coverage report.

You can run the tests manually with the following command:

python3 -m unittest

Using the coverage module( add the -m flag to see which lines are not being tested )

# To run the tests.
coverage run tests.py

# To get a report in plain view
coverage report -m *.py

# To generate a pretty HTML report
coverage html *.py

Deployment

Heroku

This application is deployed to heroku here https://wickz-recipe-share.herokuapp.com/.

When deploying to heroku use the following config vars

Variable Value
DEBUG True or Empty
MONGO_URI MONGO connection link
DBNAME MONGO DB name
IP 0.0.0.0
PORT 5000
SECRECT_KEY yoursecretkey

Local deployment

Instructions for linux

1.Make sure you have python3 installed

2.Install virtualenv with pip

#On linux you first need to install pip
sudo apt install python3-pip

#Then u can install virtualenv using pip3
sudo pip3 install virtualenv

3.Clone this repository and put the contents in your virtualenv

4.Create a python virtualenv and activate it

#Replace online-cookbook with your directory name
virtualenv online-cookbook

#activate the virtualenv
source online-cookbook/bin/activate

#deactive the virualenv
deactivate

5.Install the packages in the virutalenv

pip3 install -r requirements.txt

6.Create the following .env file in the root of the directory and fill in the values.

# See https://github.com/theskumar/python-dotenv for instructions

# Connection link to MONGODB
MONGO_URI = ""

# DB to connect to
DBNAME= ""

# Flask secret key
SECRET_KEY = ""

# Set to empty for false i.e. DEBUG = ""
DEBUG = "True"

7.Run the app.py

python3 app.py

Credits

Media

online-cookbook-6's People

Watchers

 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.