All Projects → gtalarico → Flask Vuejs Template

gtalarico / Flask Vuejs Template

Licence: mit
Flask + Vue JS Template

Programming Languages

python
139335 projects - #7 most used programming language
python3
1442 projects

Projects that are alternatives of or similar to Flask Vuejs Template

Carbon Api
Unofficial API for generating beautiful images of your source code using Carbon.
Stars: ✭ 89 (-91.71%)
Mutual labels:  heroku, flask
Flask Heroku Sample
Flask Heroku Sample Application
Stars: ✭ 68 (-93.67%)
Mutual labels:  heroku, flask
Deploying Flask To Heroku
Deploying a Flask App To Heroku Tutorial
Stars: ✭ 81 (-92.46%)
Mutual labels:  heroku, flask
Whoogle Search
A self-hosted, ad-free, privacy-respecting metasearch engine
Stars: ✭ 4,645 (+332.5%)
Mutual labels:  heroku, flask
Flask Boilerplate
Simple flask boilerplate with Postgres, Docker, and Heroku/Zeit now
Stars: ✭ 251 (-76.63%)
Mutual labels:  heroku, flask
Shadowsocksshare
Python爬虫/Flask网站/免费ShadowSocks账号/ssr订阅/json 订阅
Stars: ✭ 3,062 (+185.1%)
Mutual labels:  heroku, flask
Kamifaka
一款基于VUE3.0的开源免费的卡密发卡系统,高效、稳定可靠。
Stars: ✭ 253 (-76.44%)
Mutual labels:  heroku, flask
Heroku Buildpack Python
The official Heroku buildpack for Python apps.
Stars: ✭ 849 (-20.95%)
Mutual labels:  heroku, flask
Cookiecutter Flask Minimal
Cookicutter template for minimal production-ready Flask project
Stars: ✭ 48 (-95.53%)
Mutual labels:  flask
Yesterday I Learned
Brainfarts are caused by the rupturing of the cerebral sphincter.
Stars: ✭ 50 (-95.34%)
Mutual labels:  flask
Live Stream Face Detection
Live Streaming and Face Detection with Flask in Browser
Stars: ✭ 47 (-95.62%)
Mutual labels:  flask
Acmicpc.cc
백준 온라인 저지용 OP.GG
Stars: ✭ 48 (-95.53%)
Mutual labels:  flask
Flask Track Usage
Basic metrics tracking for the Flask framework.
Stars: ✭ 50 (-95.34%)
Mutual labels:  flask
Guides
Guides for learning + doing better web and app development. Created by Coding for Entrepreneurs.
Stars: ✭ 1,042 (-2.98%)
Mutual labels:  heroku
Channelstream
Channelstream is a websocket communication server for web applications
Stars: ✭ 52 (-95.16%)
Mutual labels:  flask
Crud Flask Python
CRUD básico com FLASK+PYTHON. Um sisteminha de cadastro de clientes. Muito simples. :)
Stars: ✭ 46 (-95.72%)
Mutual labels:  flask
Metaci
Lightweight, Salesforce specific CI app run on Heroku to build Github repositories configured for CumulusCI
Stars: ✭ 45 (-95.81%)
Mutual labels:  heroku
Openclubhouse
A third-part web application based on flask to play Clubhouse audio.
Stars: ✭ 1,061 (-1.21%)
Mutual labels:  flask
Datingtoday
基于Flask开发企业级API应用系列文章项目源码
Stars: ✭ 52 (-95.16%)
Mutual labels:  flask
Cookiecutter Django
Cookiecutter Django is a framework for jumpstarting production-ready Django projects quickly.
Stars: ✭ 8,826 (+721.79%)
Mutual labels:  heroku

Flask-VueJs-Template 🌶️✌

Build Status codecov

Flask + Vue.js Web Application Template

Vue Logo Flask Logo

Features

Demo

Live Demo

Alternatives

If this setup is not what you are looking for, here are some similar projects:

Old Template

This template was updated to use a flatter folder structure and use yarn instead of npm. You can now run yarn serve as well as other yarn commands from the template root directory. The old template will be kept in the npm-template branch but will not be maintained.

Django

Prefer Django? Checkout the gtalarico/django-vue-template

Template Structure

The template uses Flask & Flask-RestPlus to create a minimal REST style API, and let's VueJs + vue-cli handle the front end and asset pipline. Data from the python server to the Vue application is passed by making Ajax requests.

Application Structure

Rest Api

The Api is served using a Flask blueprint at /api/ using Flask RestPlus class-based resource routing.

Client Application

A Flask view is used to serve the index.html as an entry point into the Vue app at the endpoint /.

The template uses vue-cli 3 and assumes Vue Cli & Webpack will manage front-end resources and assets, so it does overwrite template delimiter.

The Vue instance is preconfigured with Filters, Vue-Router, Vuex; each of these can easilly removed if they are not desired.

Important Files

Location Content
/app Flask Application
/app/api Flask Rest Api (/api)
/app/client.py Flask Client (/)
/src Vue App .
/src/main.js JS Application Entry Point
/public/index.html Html Application Entry Point (/)
/public/static Static Assets
/dist/ Bundled Assets Output (generated at yarn build

Installation

Before you start

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

  • [X] Yarn - instructions
  • [X] Vue Cli 3 - instructions
  • [X] Python 3
  • [X] Pipenv (optional)
  • [X] Heroku Cli (if deploying to Heroku)
Template and Dependencies
  • Clone this repository:

     $ git clone https://github.com/gtalarico/flask-vuejs-template.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.

Production Sever Setup

Here are the commands we need to run to get things setup on the Heroku side:

```
$ heroku apps:create flask-vuejs-template-demo
$ heroku git:remote --app flask-vuejs-template-demo
$ heroku buildpacks:add --index 1 heroku/nodejs
$ heroku buildpacks:add --index 2 heroku/python
$ heroku config:set FLASK_ENV=production
$ heroku config:set FLASK_SECRET=SuperSecretKey

$ git push heroku
```

Heroku deployment - One Click Deploy

Deploy

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].