No description, website, or topics provided.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
docs
migrations
public
src
tests
uploads
.bumpversion.cfg
.flaskenv
.gitignore
.travis.yml
HISTORY.md
LICENSE.md
Pipfile
Pipfile.lock
Procfile
README.md
VERSION
app.json
package.json
run.py
tox.ini
vue.config.js
yarn.lock

README.md

🌶 Eat•In•Der ️🧀

Build Status codecov

An #openfooddata project started at Open Food Data Hackdays Zug 2018

Vue Logo Flask Logo Open Food Data

Installation

Based on flask-vuejs-template. See the upstream project for updates and further details.

Before you start

Before getting started, you should have the following installed and running:

Template and Dependencies
  • Clone this repository:

     $ git clone https://github.com/AndizzleB/Eatinder.git
    
  • Setup virtual environment, install dependencies, and activate it:

     $ pipenv install --dev
     $ pipenv shell
    
  • Install JS dependencies

     $ yarn install
    

Development Server

Run Flask Api development server:

$ python run.py

From another tab in the same directory, start the webpack dev server:

$ yarn serve

The Vuejs application will be served from localhost:8080 and the Flask Api and static files will be served from localhost:5000.

The dual dev-server setup allows you to take advantage of webpack's development server with hot module replacement.

Proxy config in vue.config.js is used to route the requests back to Flask's Api on port 5000.

If you would rather run a single dev server, you can run Flask's development server only on :5000, but you have to build build the Vue app first and the page will not reload on changes.

$ yarn build
$ python run.py

Production Server

This template is configured to work with Heroku + Gunicorn and it's pre-configured to have Heroku build the application before releasing it.

JS Build Process

Heroku's nodejs buidlpack will handle install for all the dependencies from the packages.json file. It will then trigger the postinstall command which calls yarn build. This will create the bundled dist folder which will be served by whitenoise.

Python Build Process

The python buildpack will detect the Pipfile and install all the python dependencies.

Release

The Procfile will run Django migrations and then launch Django's app using gunicorn, as recommended by heroku.

Heroku deployment - One Click Deploy

Deploy