Git Product home page Git Product logo

combining-flask-with-vue's Introduction

Combining Flask and Vue

Blog post for testdriven.io. If you want to follow along and create the projects yourself, you can find the post here.

Initial Setup

If you don't already have them, install Git, Python, and node.

In a terminal, Clone the repo to your computer with git clone https://github.com/based-jace/combining-flask-with-vue.git. cd into the folder.

Next, I recommend creating a Python virtual environment with python3 -m venv env. (Optional)

Install the required Python dependencies from the requirements.txt file using pip install -r requirements.txt.

Running the Examples

Method 1 - Vue in Jinja

In a terminal, cd into the "01_vue_in_jinja" folder of your cloned repo. Since you already have everything you need installed, just use flask run to start your app in a development server on localhost:5000.

Methods 2 - Separate Front and Back Ends with Vue

In two terminals, cd into the "02_separate_ends" folder of your cloned repo.

In your first terminal, cd into the "api" folder. Use flask run to start your Flask api in development server on localhost:5000.

In your second terminal, cd into the "webapp" folder. Install your node dependencies with npm install. Run the development version of the Vue webapp with npm run serve. The webapp will be running on localhost:8080.

Method 2.5 - Separate Front and Back Ends with Nuxt

In two terminals, cd into the "02_separate_ends_with_ssr" folder of your cloned repo.

In your first terminal, cd into the "api" folder. Use flask run to start your Flask api in development server on localhost:5000.

In your second terminal, cd into the "webapp" folder. Install your node dependencies with npm install. Run the development version of the Nuxt webapp with npm run dev. The webapp will be running on localhost:3000.

Method 3 - Flask Blueprints

In a terminal, cd into the "03_flask_blueprints" folder of your cloned repo. Just like Method 1, you already have everything you need installed. Use flask run to start your app in a development server on localhost:5000.

combining-flask-with-vue's People

Contributors

based-jace avatar dependabot[bot] avatar mjhea0 avatar

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.