Welcome to the Full Stack Application Development Workshop . This repository contains the materials needed to create the sample application and the associated REST API. In this workshop, we will see how to create a custom RESTful API using Flask - a microframework for Python. A Single Page Application (SPA) will also be created using Vue.js to interface with our API.
We will be creating an application called Brewery Finder
that will act as a crowdsourcing application where users can view, create, update, delete, and export brewery information in a mapping context as well as add featured beers for each brewery. Under the hood, we will be using a Sqlite Database to store the brewery information and the REST API we create will be the broker for communicating to the database.
in order to have the best development experience, it is recommended that before starting you have the following things insalled:
- node.js (version8.11+) - asynchronous JavaScript runtime
- git (with bash) - version control software
- code editors such as VS Code, WebStorm, Atom, etc.
- need editor for Python as well, (VS Code can be configured to work with both Python and JavaScript) such as PyScripter, PyCharm (community edition is free), etc.
- Google Chrome - best browser for debugging
- Fiddler - web debugging proxy to monitor requests
- Postman - API Development Environment that will be used to test our REST API
- DB Browser for Sqlite - convenieintly view/update Sqlite databases
- it would also be beneficial to have both
pip
andvirtualenv
installed for Python
Images of the Brewery Finder
Demo App can be found below:
Map View showing Brewery Locations
Auto-Complete search for breweries by name
Quick overview of Brewery with featured beers
Login Page to authenticate users for extended app functionality
As well as allowing new users to register with form validation
Export Tables from the database (with a shapefile option for Breweries)
Add/Edit/Update/Delete Brewery
Also can add/delete featured beers from this screen
Or create a new beer and upload a photo for it
In the interest of saving time, I have created some boiler plates to start with that have both the core Python Flask service set up as well as the skeleton of our Brewery Finder
app. These are located in the student folder. The sections below outline the contents of this folder:
/config/config.json
- contains a configuration file for our app- email account settings, photo storage mode for beers
base.py
-FlaskExtension
class that will allows error custom handling anderrorHandler
decorator__init__.py
- this is the entry point file to the Flask Application- sets up basic Flask app configuration options as well as two test routes for our REST API
/
and/test
- sets up basic Flask app configuration options as well as two test routes for our REST API
utils.py
- contains utility functions essential to the application such ascollect_args()
, etcdatabase_utils.py
- contains helper function for processing photos for beersmodels.py
- contains the schema and table objects for SqlAlchemysecurity.py
- contains boiler plate code for security/mac_venv
- pythonvirtualenv
for mac/beer_sample
- contains csv's and other sample data used to create the brewery datacreate_db_data.py
- script that creates Sqlite database and loads in all brewery data
create_databases.sh
- shell script that startsvirtualenv
and creates the datbaserun.py
- python script that runs the Flask apprun.sh
- shell script that runs the Flask app sript through thevirtualenv
(use this to start the app)
/components
- contains theVue
components used to comprise the app (.vue
files)/modules
- contains normal es6 JavaScript modulesApp.vue
- the main template for the applicationmain.js
- entry point to applicationbabel.config.js
- contains the babel configuration options for webpackpackage.json
- manifest for the application, includes dependency infovue.config.js
- main configuration options for webpack and production build
The instructions for going through this workshop are broken into sections for each part. There is also an associated branch for each part with the exception of part one as the boiler plates are already created in the master
version of this branch. To begin, go to Step 1. Getting Started.