loading...
Cover image for Flask Boilerplate - Open-Source Apps built with automation tools

Flask Boilerplate - Open-Source Apps built with automation tools

sm0ke profile image Sm0ke Updated on ・7 min read

Hello Coders,

This article presents a short-list with Flask apps and light Flask Dashboards generated using an automatized workflow:

  • Flat HTML themes (bootstrap based) are parsed and transformed into production-ready Jinja2 templates (the native Flask template engine) using an HTML Parser
  • The processed design is injected into an existing boilerplate code enhanced with SQLite database, SqlAlchemy helpers, and basic tooling.
  • A minimum set of tests is automatically executed via Selenium and Puppeteer.

Some Links (for fast runners)


Flask (for newcomers)

Flask is a micro web framework written in Python. It is classified as a microframework because it does not require particular tools or libraries. It has no database abstraction layer, form validation, or any other components where pre-existing third-party libraries provide common functions. It has no database abstraction layer, form validation, or any other components where pre-existing third-party libraries provide common functions - Some links:


What is Boilerplate Code

In programming, boilerplate code is a piece of software that can be reused over and over without changing a single line of code. The whole idea behind a starter (sometimes boilerplate code) is to skip coding that piece of code common to many projects.


Setup the environment

In order to use the boilerplate code, we need Python and Flask installed on the workstation. The Python can be downloaded from the official website and Flask can be easily added using PIP command:

$ # Test the Python install 
$ python --version
$ Python 3.7.2

$ # install Flask using PIP
$ pip install Flask


Flask Boilerplate Codebase

The codebase is organized using a modular structure:

< PROJECT ROOT >
   |
   |-- app/                      # Implements app logic
   |    |-- base/                # Base Blueprint - handles the authentication
   |    |-- home/                # Home Blueprint - serve UI Kit pages
   |    |
   |   __init__.py               # Initialize the app
   |
   |-- requirements.txt          # Development modules - SQLite storage
   |-- requirements-mysql.txt    # Production modules  - Mysql DMBS
   |-- requirements-pqsql.txt    # Production modules  - PostgreSql DMBS
   |
   |-- .env                      # Inject Configuration via Environment
   |-- config.py                 # Set up the app
   |-- run.py                    # Start the app - WSGI gateway
   |
   |-- ***********************

How to Build the Boilerplates

All Flask starters share the same codebase and the build instructions are identical for all projects. For instance, if we want to build Flask Dashboard Black boilerplate, we need to write a few simple commands in a terminal window:

$ # Get the code
$ git clone https://github.com/app-generator/flask-black-dashboard.git
$ cd flask-black-dashboard
$
$ # Virtualenv modules installation 
$ virtualenv env
$ source env/bin/activate
$
$ # Install modules - SQLite Database
$ pip3 install -r requirements.txt
$ 
$ # Set the FLASK_APP environment variable
$ export FLASK_APP=run.py
$
$ # Start the application (development mode)
$ flask run
$
$ # Access the dashboard in browser: http://127.0.0.1:5000/

Note: To use the app, please access the registration page and create a new user. After authentication, the app will unlock the private pages.


Flask Dashboard Black - Open-Source Dashboard.

Pretty cool!


Flask Dashboard - Black Design

Open-Source Flask Boilerplate with Black Dashboard Design (free version).

  • SQLite, PostgreSQL,
  • SQLAlchemy ORM, Alembic (database migrations)
  • Modular design with Blueprints
  • Session-Based authentication (via flask_login)
  • Deployment scripts: Docker, Gunicorn

Links


Flask Dashboard - Black Design.


Flask Dashboard - DattaAble Design

Open-Source Flask Boilerplate with DattaAble Design (free version).

  • SQLite, PostgreSQL, SQLAlchemy ORM
  • Alembic (DB schema migrations)
  • Modular design with Blueprints
  • Session-Based authentication (via flask_login)
  • Forms validation
  • Deployment scripts: Docker, Gunicorn / Nginx

Links


Flask Dashboard - DattaAble Design.


Flask Dashboard - Material Design

A simple Flask Dashboard starter with Material Design (Free Version).

  • Modular design with Blueprints
  • SQLite, PostgreSQL, SQLAlchemy ORM
  • Alembic (DB schema migrations)
  • Session-Based authentication (via flask_login)
  • Deployment scripts: Docker, Gunicorn / Nginx

Links


Flask Dashboard - Material Design.


Flask iDashboard Free

Open-Source Admin Dashboard coded in Flask Framework on top of iDashboard Free design. Features:

  • SQLite, PostgreSQL,
  • SQLAlchemy ORM, Alembic (database migrations)
  • Modular design with Blueprints
  • Session-Based authentication (via flask_login)
  • Deployment scripts: Docker, Gunicorn

Flask iDashboard Free - Open-Source Admin Panel.


Flask Dashboard CoreUI

Open-Source Admin Dashboard coded in Flask Framework on top of CoreUI design. Features:

  • SQLite, PostgreSQL,
  • SQLAlchemy ORM, Alembic (database migrations)
  • Modular design with Blueprints
  • Session-Based authentication (via flask_login)
  • Deployment scripts: Docker, Gunicorn

Flask Dashboard CoreUI - Open-Source Admin Panel.

Links


Flask Dashboard AdminLTE

Open-Source Admin Dashboard coded in Flask Framework on top of AdminLTE design. Features:

  • SQLite, PostgreSQL,
  • SQLAlchemy ORM, Alembic (database migrations)
  • Modular design with Blueprints
  • Session-Based authentication (via flask_login)
  • Deployment scripts: Docker, Gunicorn

Flask Dashboard Argon - Open-Source Flask Boilerplate.

Links


Flask Boilerplate - Paper Kit

UI crafted by Creative-Tim, MIT license: demo, sources

Flask Boilerplate Paper Kit - Open-Source Web App.


Flask Boilerplate - NowUI Dashboard

A simple Flask Dashboard starter with NowUI Design (MIT license).
Links: demo, sources

Flask Dashboard Material Kit - GIF Animated intro.


Flask Boilerplate - Dashboard Argon

Flask Dashboard Argon is built on top of a fully responsive, pixel-perfect design, crafted by Creative-Tim. This admin panel, released as an open-source project includes an SQLite database, SQLAlchemy ORM, and is fully integrated into Jinja2 templating system.

Flask Dashboard Argon - App ScreenShot.

Build from sources

$ git clone https://github.com/app-generator/flask-argon-dashboard.git
$ cd flask-argon-dashboard
$ pip install -r requirements.txt
$ python app.py

Dashboard links


Flask Boilerplate - Dashboard Adminator

Adminator Dashboard designed by ColorLib in Bootstrap and coded in Flask with SQLite database, ORM and authentication. Adminator is a responsive Bootstrap 4 Admin Template. It provides you with a collection of ready to use code snippets and utilities, custom pages, a collection of applications and some useful widgets.

Flask Dashboard Links

Flask Dashboard Adminator - Open-Source Dashboard coded in Flask.


Other resources


Thank you!

Posted on by:

sm0ke profile

Sm0ke

@sm0ke

#Automation, my favorite programming language

Discussion

markdown guide
 

The definition of Boilerplate is not quite correct in your paragraph. By boilerplate we usually mean verbosity.

 

Hello Stavro,
Point me please to the sentence. Thank you!

 

In programming, boilerplate code is a piece of software that can be reused over and over without changing a single line of code

I am not saying that it is wrong. But AFAIK we refer to the boilerplate as too much redunant(perhaps) code.