Python web-app (Flask) to browse Tandoor recipes on the local network

Overview

RecipeBook - Tandoor

Python web-app (Flask) to browse Tandoor recipes on the local network. Designed for use with E-Ink screens.

For a version that works with Nextcloud Cookbook, please navigate to RecipeBook

Deploy with DockerLocal BuildScreenshotsUpcoming

Overview

I created this to access recipes from Tandoor and easily view them on Kindle's web browser whilst cooking. The view is designed for such screens, and is not as nice as the actual app. Therefore, accessing your Tandoor website with a mobile device or tablet would just as effectively provide kitchen access to your recipes. This project is not associated with Tandoor.

Please note that the web application is very basic and should not be run on untrusted networks. It is not designed to be exposed publicly.

The application reads data from Tandoor using its API, and a valid token must be provided. This is (an extension of) my first project using Flask and building Docker containers. Feedback is appreciated.

Supported Architectures

Pulling from DockerHub should provide the correct image for your system. The application is built on the python-alpine base image. The "tandoor" tag is necessary to pull the version build for use with Tandoor. See DockerHub Repository,

Images are available for the following architectures:

Architecture
x86-64
arm64
armhf

Application Setup

Install and run using docker, examples provided below. See LinuxServer.io and Docker for more information on Docker containers.

Access main page at :5000 . See below for changing port number.

Usage

This container uses data from your Tandoor instance by calling its API. Therefore, an appropriate API Token and URL are required for it to function. Data for the homepage will be saved, and only refreshing the data will require a valid token and URL. However, each recipe-page needs to use the API, and therefore Tandoor must be accessible.

Find your API Token at http:// /settings/#api

Example configurations to build container are shown below. Some Environmental Variables are listed with default values and do not need to be specified, Token and URL must be correctly set for the application to function. Healthcheck is optional.

docker-compose

---
version: "2"
services:
  recipe:
    image: nbpub/recipelook:tandoor
    container_name: recipebook
    ports:
      - 5000:5000
    environment:
      - TZ=America/Los_Angeles
      - PAGE_TITLE=Recipe Book
      - FONT_SMALL=30
      - FONT_LARGE=36
      - Token=PasteYourTokenHere
      - URL=http://localhost:8080/
    healthcheck:
      test: curl -I --fail http://localhost:5000 || exit 1
      interval: 300s
      timeout: 10s
      start_period: 5s
    restart: unless-stopped

docker cli (click here for more info)

docker run -d \
  --name=recipebook \
  -e TZ=America/Los_Angeles \
  -e PAGE_TITLE=Recipe Book \
  -e FONT_SMALL=30 \
  -e FONT_LARGE=36 \
  -e Token=PasteYourTokenHere
  -e URL=http://localhost:8080/
  -p 5000:5000 \
  --restart unless-stopped \
  nbpub/recipelook:tandoor

Parameters

Container images are configured using parameters passed at runtime (such as those above). These parameters are separated by a colon and indicate : respectively. For example, -p 5001:5000 would expose port 5000 from inside the container to be accessible from the host's IP on port 5001 outside the container.

Parameter Function
-p 5000:5000 Default Flask port. Internal port should not be changed.
-e TZ=America/Los_Angeles Set timezone for logging using tzdata.
-e PAGE_TITLE=Recipe Book Home page title. Displays on tab.
-e FONT_SMALL=30 Default size for "small" sections: Description and Keywords. Can be changed to any to adjust web-page display.
-e FONT_LARGE=36 Default size for "large" sections: Steps data. Can be changed to any to adjust web-page display.
-e Token=PasteYourTokenHere Default Token is an empty string. API calls will not work unless a valid token is provided.
-e URL=http://localhost:8080/ Default URL for Tandoor instance. This should be changed to the appropriate base URL for Tandoor.

Upcoming

Version 1.0 is released. If issues are found or enhancements dreamt, they will come here until pushed to a new version.

I do not use Tandoor, and built this application with recipes downloaded from the demo website. Therefore, many features may not be supported. Please open an issue if you have ideas for improvements or bug-fixes. Listed below are some limitations I am aware of, but there are likely many others I have not encountered. Thank you for your help!

Known Limitations

  • Support for non-text based Steps (Type = time / file / recipe)
  • Ratings and comments <- should be easy to integrate

Possible Future Improvements

  • Provide option to not load images by default. Restore image button will still be present.

  • Cache recipe data to reduce needed API calls, provide functionality without accessing Tandoor

    • More local storage vs Less network traffic
  • Clean up exception handling code

  • wget instead of curl for healthchecks - does this provide smaller docker image?

  • keyword handling

  • Add tests

  • clean up CSS styling

  • Volume binding for configuration folder, let user poke through directories

Screenshots

Home Page, lists all recipes

Home

Filter Button

Home

Text Search, recipe titles only

Home

Recipe Page example, with image

Home

Recipe Page example, without image

Home

Recipe Page example, single Step

Home

Recipe Page example, multipe Steps

Home

Recipe Page example, multipe Steps continued

Home

Error Page - Invalid API Token

Home

Error Page - Invalid URL

Home

Build Locally

Instructions may not be comprehensive. Docker deployment is recommended.

If you want to run RecipeBook without Docker, a python virtual environment is recommended. See Flask Installation for more details (and appropriate commands for Windows). Python 3.7 or newer is recommended.

  1. Download the code in the repository. Click the green code button at the top of the page for options.

  2. Extract the folder contents. Copy the files+folders within "app" directory and "requirements.txt" to a new directory. All other contents can be deleted.

  3. Move to newly made directory and create and activate venv.

$ cd newdirectory
$ python -m venv venv
$ . venv/bin/activate
  1. Install Flask, dependencies.
$ pip install -r requirements.txt
  1. Adjust Flask parameters as desired, see Flask Quickstart. A Flask Env file saves some typing when running the application. For example, if you only want the server to be visible from the local machine, remove FLASK_RUN_HOST=0.0.0.0 from the file. The port number (default, 5000) can be changed in this file, too.
$ nano .flaskenv

Note that all local variables associated with environmental variables can be modified by changing the code. See next step for an example

  1. Modify URL and API-Token variables. See lines 15 and 19 of Tandoor_Reader.py. URL=" " and Token=" " .

Optional - Modify other local variables that are typically specified by docker-container environmental variables. See lines 25-27 or the same file. Values can be changed by modifying the second entry in environ.get(" ", " " .

  1. Run! Open site in web browser (http://localhost:5000).
$ flask run
  1. Press Ctrl+C to stop server. Deactivate venv when finished.
$ deactivate
You might also like...
Lux Academy & Data Science East Africa Python Boot Camp, Building and Deploying  Flask Application Using Docker  Demo App.
Lux Academy & Data Science East Africa Python Boot Camp, Building and Deploying Flask Application Using Docker Demo App.

Flask and Docker Application Demo A Docker image is a read-only, inert template that comes with instructions for deploying containers. In Docker, ever

An python flask app with webserver example

python-flask-example-keepalive How it works? Basically its just a python flask webserver which can be used to keep any repl/herokuapp or any other ser

A Python chat app built with Flask that runs in the browser.

A Python chat app built with Flask that runs in the browser. Designed for local area networks that are not connected to the Internet.

Flask-Bcrypt is a Flask extension that provides bcrypt hashing utilities for your application.

Flask-Bcrypt Flask-Bcrypt is a Flask extension that provides bcrypt hashing utilities for your application. Due to the recent increased prevelance of

Flask-Rebar combines flask, marshmallow, and swagger for robust REST services.

Flask-Rebar Flask-Rebar combines flask, marshmallow, and swagger for robust REST services. Features Request and Response Validation - Flask-Rebar reli

Flask-Bcrypt is a Flask extension that provides bcrypt hashing utilities for your application.

Flask-Bcrypt Flask-Bcrypt is a Flask extension that provides bcrypt hashing utilities for your application. Due to the recent increased prevelance of

Flask Project Template A full feature Flask project template.

Flask Project Template A full feature Flask project template. See also Python-Project-Template for a lean, low dependency Python app. HOW TO USE THIS

A Fast API style support for Flask. Gives you MyPy types with the flexibility of flask
A Fast API style support for Flask. Gives you MyPy types with the flexibility of flask

Flask-Fastx Flask-Fastx is a Fast API style support for Flask. It Gives you MyPy types with the flexibility of flask. Compatibility Flask-Fastx requir

Flask pre-setup architecture. This can be used in any flask project for a faster and better project code structure.

Flask pre-setup architecture. This can be used in any flask project for a faster and better project code structure. All the required libraries are already installed easily to use in any big project.

Releases(v1.0)
This is a Flask web app which predicts fare of Flight ticket

Flight Fare Prediction: Table of Content Demo Overview Motivation Installation Deployement on Heroku Directory Tree Bug / Feature Request Future scope

Ayshwarya 1 Jan 24, 2022
Python3🐍 webApp to display your current playing music on OBS Studio.

Spotify Overlay A Overlay to display on Obs Studio or any related video/stream recorder, the current music that is playing on your Spotify. Installati

carlitos 0 Oct 17, 2022
A Microsub server built with Python Flask and SQLite.

Microsub Server This repository contains the code that powers my personal Microsub server. Microsub is an IndieWeb specification currently in developm

jamesg 8 Oct 26, 2022
A template themes for phyton flask website

Flask Phyton Web template A template themes for phyton flask website

Mesin Kasir 2 Nov 29, 2021
A gRpc server like Flask (像Flask一样的gRpc服务)

Mask A gRpc server just like Flask. Install Mask support pypi packages, you can simply install by: pip install mask Document Mask manual could be fou

吴东 16 Jun 14, 2022
Lightweight library for providing filtering mechanism for your APIs using SQLAlchemy

sqlalchemy-filters-plus is a light-weight extendable library for filtering queries with sqlalchemy. Install pip install sqlalchemy-fitlers-plus Usage

Karami El Mehdi 38 Oct 05, 2022
Small flask based opds catalog designed to serve a directory via OPDS

teenyopds Small flask based opds catalog designed to serve a directory via OPDS, it has currently only been verified to work with KyBook 3 on iOS but

Adam Furbee 4 Jul 14, 2022
A service made with Flask and Python to help you find the weather of your favorite cities.

Weather-App A service made with Flask and Python to help you find the weather of your favorite cities. Features Backend using Flask and Jinja Weather

Cauã Rinaldi 1 Nov 17, 2022
flask-reactize is a boostrap to serve any React JS application via a Python back-end, using Flask as web framework.

flask-reactize Purpose Developing a ReactJS application requires to use nodejs as back end server. What if you want to consume external APIs: how are

Julien Chomarat 4 Jan 11, 2022
Flask Multiple Database Login

Flask Multiple Database Login Handle login with flask using two diferent databases: UE | European; BR | Brazilian; These databases are separed to resp

Jose Pedro 1 Dec 16, 2021
A template for Flask APIs.

FlaskAPITempate A template for a Flask API. Why tho? I just wanted an easy way to create a Flask API. How to setup First, use the template. You can do

TechStudent10 1 Dec 28, 2021
Free casino website. Madden just for learning / fun

Website Casino Free casino website. Madden just for learning / fun. Uses Jinja2 (HTML), Flask, JavaScript, etc. Dice game Preview

Kirill Zhosul 0 Jun 22, 2022
A swagger 2.0 spec extractor for flask

flask-swagger A Swagger 2.0 spec extractor for Flask You can now specify base path for yml files: app = Flask(__name__) @app.route("/spec") def spec(

Sling 457 Dec 02, 2022
MongoEngine flask extension with WTF model forms support

Flask-MongoEngine Info: MongoEngine for Flask web applications. Repository: https://github.com/MongoEngine/flask-mongoengine About Flask-MongoEngine i

MongoEngine 815 Jan 03, 2023
Flask extension that takes care of API representation and authentication.

Flask-API-Utils Flask-API-Utils helps you to create APIs. It makes responses in appropriate formats, for instance, JSON. All you need to do is to retu

Marsel Mavletkulov 55 Aug 28, 2022
A live chat built with python(flask + gevent + apscheduler) + redis

a live chat room built with python(flask / gevent / apscheduler) + redis Basic Architecture Screenshot Install cd /path/to/source python bootstrap.py

Limboy 309 Nov 13, 2022
Flask app + (html+css+ajax) contain ability add employee and place where employee work - plant or salon

#Manage your employees! With all employee information stored in one place, you no longer have to sift through hoards of spreadsheets to manually searc

Kateryna 1 Dec 22, 2021
A simple example using Flask inside a container

This is a simple example of how create a container for a Python Flask Web Application using Docker.

Fazt Web 8 Aug 30, 2022
Flask Boilerplate - Paper Kit Design | AppSeed

Flask Paper Kit Open-Source Web App coded in Flask Framework - Provided by AppSeed Web App Generator. App Features: SQLite database SQLAlchemy ORM Ses

App Generator 86 Nov 29, 2021