Flask Boilerplate - Open-Source App styled with Paper Design

Hello Coder,

Thank you for landing on this page. This article presents another Flask boilerplate, built with automation tools on top of an amazing design crafted by Creative-Tim agency.

In a rush? Click to see the LIVE demo or grab the sources and code something amazing. License? MIT off course.

Flask Paper Kit - Gif animated intro.


What is Flask

A short note for newcomers: Flask is a lightweight web framework written in Python suitable for (almost) any kind of web app: one-page, API servers or complex eCommerce apps and portals. The official info (copied from their website):

Flask is a lightweight WSGI web application framework. It is designed to make getting started quick and easy, with the ability to scale up to complex applications. It began as a simple wrapper around Werkzeug and Jinja and has become one of the most popular Python web application frameworks.

We are using Flask as an underline framework in our app generation process based on the popularity of the framework and the freedom to design the app structure.


App Boilerplate

In our app generation process we are using boilerplate code all the time. Sometimes using a solid and tested code-base can help you to win time and speed up a little the development process.

What's in the box?

  • Database: SQLite
  • ORM  - SQLAlchemy
  • Authentication flow: login and register
  • Tooling: static export script (via Flask-Frozen) and FTP live deploy script

How to use it

The project, published on Github comes with a comprehensive README file. To start using the app, without leaving this page just type:

$ # clone the repo

$ git clone https://github.com/app-generator/flask-argon-dashboard.git
$ cd flask-argon-dashboard

$ # install the dependencies
$ pip install -r requirements.txt

$ # create the database (using Flask shell)

$ flask shell
$ >>> from app import db
$ >>> db.create_all()

$ flask run

$ # App is running on http://localhost:5000 

If all goes well, the app should be visible in your browser:

Flask Paper Kit - Gif animated intro.


Static export - via Flask-Frozen

For simple apps, one-page or coming soon pages, we are exporting the Flask app as static using Flask-Frozen module. The static export script is saved into the repository, if anyone is interested to use it.

import os
from app import app
from flask_frozen import Freezer

#----------------------------------------
# launch
#----------------------------------------

if __name__ == "__main__":
    freezer = Freezer(app)
    freezer.freeze()

And voila, the static content goes to `app/public` directory.


FTP Live deploy

The deploy.js script uses a node.js module to upload the content from a directory ( app/public in our case ) to an FTP server. Before executing the script don't forget to run a yarn command in the root of the project (to install locally the Node.js module ftp-deploy) and to edit the FTP credentials in the file:

var FtpDeploy = require('ftp-deploy');
var ftpDeploy = new FtpDeploy();
 
var config = {
    user:     "FTP_USER", # edit ME
    password: "FTP_PASS", # edit ME                           
    host:     "FTP_HOST", # edit ME
    port: 21,
    localRoot: __dirname + '/app/build', # upload ME 
    remoteRoot: '/',
    include: ['*', '**/*'],      
    ....
}

Where to go from here?

For more Flask apps, boilerplates, dashboards or LIVE support (PAID plans only)  please access AppSeed.  Thank you!
Show Comments

Get the latest posts delivered right to your inbox.