Skip to content

Commit e23dec1

Browse files
committed
Updated Readme
1 parent d435744 commit e23dec1

File tree

2 files changed

+46
-14795
lines changed

2 files changed

+46
-14795
lines changed

README.md

Lines changed: 46 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# TODO: Add important files table from Django Readme
2-
3-
# Flask-VueJs-Template
1+
# Flask-VueJs-Template 🌶️✌
42

53
[![Build Status](https://travis-ci.org/gtalarico/flask-vuejs-template.svg?branch=master)](https://travis-ci.org/gtalarico/flask-vuejs-template)
64
[![codecov](https://codecov.io/gh/gtalarico/flask-vuejs-template/branch/master/graph/badge.svg)](https://codecov.io/gh/gtalarico/flask-vuejs-template)
@@ -9,19 +7,28 @@ _Flask + Vue.js Web Application Template_
97

108
![Vue Logo](/docs/vue-logo.png "Vue Logo") ![Flask Logo](/docs/flask-logo.png "Flask Logo")
119

12-
[Live Demo](https://flask-vuejs-template.herokuapp.com/#/api)
13-
1410
## Features
1511
* Minimal Flask 1.0 App
1612
* [Flask-RestPlus](http://flask-restplus.readthedocs.io) API with class-based secure resource routing
1713
* Starter [PyTest](http://pytest.org) test suite
18-
* [vue-cli 3](https://github.com/vuejs/vue-cli/blob/dev/docs/README.md)
14+
* [vue-cli 3](https://github.com/vuejs/vue-cli/blob/dev/docs/README.md) + yarn
1915
* [Vuex](https://vuex.vuejs.org/)
2016
* [Vue Router](https://router.vuejs.org/)
2117
* [Axios](https://vuex.vuejs.org/) for backend communication
2218
* Sample Vue [Filters](https://vuejs.org/v2/guide/filters.html)
2319
* Heroku Configuration with one-click deployment + Gunicorn
2420

21+
#### Alternatives
22+
If this setup is not what you are looking for, you might want look at other similar projects:
23+
24+
* [oleg-agapov/flask-vue-spa](https://github.com/oleg-agapov/flask-vue-spa)
25+
* [testdrivenio/flask-vue-crud](https://github.com/testdrivenio/flask-vue-crud)
26+
27+
Prefer Django? Checkout my [gtalarico/django-vue-template](https://github.com/gtalarico/django-vue-template)
28+
29+
## Demo
30+
[Live Demo](https://flask-vuejs-template.herokuapp.com/#/api)
31+
2532
## Template Structure
2633

2734
The template uses Flask & Flask-RestPlus to create a minimal REST style API,
@@ -43,11 +50,25 @@ files as generated by vue cli + webpack
4350

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

53+
#### Important Files
54+
55+
| Location | Content |
56+
|----------------------|--------------------------------------------|
57+
| `/app` | Flask Application |
58+
| `/app/api` | Flask Rest Api (`/api`) |
59+
| `/app/client.py` | Flask Client (`/`) |
60+
| `/src` | Vue App . |
61+
| `/src/main.js` | JS Application Entry Point |
62+
| `/public/index.html` | Html Application Entry Point (`/`) |
63+
| `/public/static` | Static Assets |
64+
| `/dist/` | Bundled Assets Output (generated at `yarn build` |
65+
66+
4667
## Installation
4768

4869
##### Before you start
4970

50-
Before getting started you should have the following installed and running:
71+
Before getting started, you should have the following installed and running:
5172

5273
- [X] Yarn - [instructions](https://yarnpkg.com/en/docs/install#mac-stable)
5374
- [X] Vue Cli 3 - [instructions](https://cli.vuejs.org/guide/installation.html)
@@ -94,8 +115,9 @@ $ yarn serve
94115
The Vuejs application will be served from `localhost:8080` and the Flask Api
95116
and static files will be served from `localhost:5000`.
96117

97-
The dual dev server setup allows you to take advantage of
118+
The dual dev-server setup allows you to take advantage of
98119
webpack's development server with hot module replacement.
120+
99121
Proxy config in `vue.config.js` is used to route the requests
100122
back to Flask's Api on port 5000.
101123

@@ -114,30 +136,35 @@ $ python run.py
114136
This template is configured to work with Heroku + Gunicorn and it's pre-configured
115137
to have Heroku build the application before releasing it.
116138

139+
#### JS Build Process
140+
141+
Heroku's nodejs buidlpack will handle install for all the dependencies from the `packages.json` file.
142+
It will then trigger the `postinstall` command which calls `yarn build`.
143+
This will create the bundled `dist` folder which will be served by whitenoise.
144+
145+
#### Python Build Process
146+
147+
The python buildpack will detect the `Pipfile` and install all the python dependencies.
148+
149+
#### Release
150+
151+
The `Procfile` will run Django migrations and then launch Django's app using gunicorn, as recommended by heroku.
152+
153+
#### Production Sever Setup
154+
117155
Here are the commands we need to run to get things setup on the Heroku side:
118156

119157
```
120158
$ heroku apps:create flask-vuejs-template-demo
121159
$ heroku git:remote --app flask-vuejs-template-demo
122160
$ heroku buildpacks:add --index 1 heroku/nodejs
123161
$ heroku buildpacks:add --index 2 heroku/python
124-
$ heroku addons:create heroku-postgresql:hobby-dev
125162
$ heroku config:set FLASK_ENV=production
126163
$ heroku config:set FLASK_SECRET=SuperSecretKey
127164

128165
$ git push heroku
129166
```
130167

131-
Heroku's nodejs buidlpack will handle install for all the dependencies from the `packages.json` file.
132-
It will then trigger the `postinstall` command which calls `yarn build`.
133-
This will create the bundled `dist` folder which will be served by whitenoise.
134-
135-
The python buildpack will detect the `pipfile` and install all the python dependencies.
136-
137-
The `Procfile` will run Django migrations and then launch Django'S app using gunicorn, as recommended by heroku.
138-
139168
### Heroku deployment - One Click Deploy
140169

141-
You can spin up your on version of this template on Heroku:
142-
143170
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/gtalarico/flask-vuejs-template)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy