Coder Social home page Coder Social logo

the-silverwood-institute / frontend Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 100 KB

Recibase's front-end Python app

Home Page: https://reciba.se/

License: Apache License 2.0

Python 56.12% HTML 26.65% CSS 6.44% JavaScript 10.69% Procfile 0.10%
python webpy recipes

frontend's Introduction

Frontend

Tests and deployment status

The website of Recibase, the recipe ingestion and discovery service.

Recibase's frontend uses web.py.

Requirements

  • Python 3.9
  • pip

Installation

pip install -r requirements.txt

Test with pytest

Usage

To start

  1. BACKEND_URL="https://api.reciba.se/" python3 app.py
  2. Navigate to http://0.0.0.0:8080/

If you don't specify BACKEND_URL you will need to also have the Recibase API running locally.

To stop

Hold Ctrl + C until it quits

frontend's People

Contributors

dependabot[bot] avatar kittsville avatar

Stargazers

 avatar

Watchers

 avatar  avatar

frontend's Issues

Indicate when search hasn't finished

There is currently no loading indicator to show that a search has not yet completed.

Given the backend is a separate heroku instance it can take a few seconds to start up, which causes the menu UI to incorrectly show a list of recipes which don't match the search terms.

Material design has a loading spinner/bar which I've used in other apps, along with some JavaScript to toggle it. This should just be a <1 hour lift and shift job.

Recipe menu cache not invalided by API deployments

The left-hand recipe menu isn't updated when new recipes are added to Recibase's API

Steps to reproduce:

  1. Add new recipe to recibase API
  2. Deploy updated API
  3. Browse to front-end: recibase.herokuapp.com/

Expected behaviour:

Menu contains new recipe.

Recipe can be viewed by clicking its permalink in the menu.

Actual behaviour:

Menu does not.

Recipe can be viewed by knowing its permalink.

Further notes

This is caused because the front-end loads the recipe list on launch. Presumably the Heroku app falling asleep and rewaking would fix this after an hour or two.

Database seeder broken

Recibase's schema was updated but seed.py wasn't, so it now produces unusable fixtures. Could fix it to use the new schema or just get rid of it.

Generate sitemap

Recibase should have a sitemap.xml file that lists all recipes and the homepage so search engine crawlers and other automated systems can easily navigate the site.

Add ingredient scaling

Add buttons/a number field to easily multiply all of the ingredients. Even a hidden feature using a URL Param would be useful. The ingredient data is separated by quantity in the UI but merged when templating occurs, so it avoid changing too much this could be done in the templating code.

redirect www subdomain

Some browsers automatically add www to the address, so Recibase should have DNS records to redirect to the naked domain

Cache menu contents

Given the database doesn't change once Recibase generates it the menu will always been the same (the name and url of every recipe). As such this could be created when the server boots then stored in a variable, or any other low-effort caching method.

We'll never be under high load or face millions of queries, but this might keep page loads blazingly fast.

Current recipe not being highlighted

Steps to replicate

Visit a single recipe's page

Expected behaviour

The current recipe is highlighted in the left-hand recipes menu

Actual behaviour

No recipe is highlighted from the menu

Add "fork me" banner to website

A fork me on GitHub banner would help make people aware that the entire project is open source, recipes included.

I'd imagine the grey or black right ribbon would look good, although it's probably best to experiment and see what it looks like.

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.