Flask Dashboard - Corona Dark Design
Tags: flask, beginners, webdev, appseed
Published: 2020-06-07 16:21:02

---
title: Flask Dashboard - Corona Dark Design
published: true
description: A simple Flask starter coded with authentication and basic modules on top of a modern Dark Design
tags: flask, beginners, webdev, appseed
cover_image: https://raw.githubusercontent.com/app-generator/flask-dashboard-corona-dark/master/media/flask-dashboard-corona-dark-screen.png
---
Hello coders,

This article presents an open-source, MIT licensed **Flask** state coded on top of modern design - **[Corona Dashboard Dark](https://appseed.us/admin-dashboards/flask-dashboard-corona-dark)** (Free Version). The product is **actively supported** via Github and Discord and based on the licensing model can be used for unlimited hobby & commercial projects. 

> *Thanks for reading!* - Content provided by **[App Generator](https://appseed.us/)**.

---

- ✨ [Flask Corona Dark](https://appseed.us/admin-dashboards/flask-dashboard-corona-dark) - product page
- ✨ [Flask Corona Dark](https://flask-corona-dark.appseed-srv1.com/) - LIVE Demo

---

![Flask Corona Dark - Open-Source admin panel coded in Flask, Main dashboard page.](https://raw.githubusercontent.com/app-generator/flask-dashboard-corona-dark/master/media/flask-dashboard-corona-dark-screen-1.png)

--- 

## ✨ [What is Flask](https://docs.appseed.us/content/what-is/flask)

*Short intro for newcomers* - [Flask](https://palletsprojects.com/p/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. 
This framework can be used to code API servers, full-stack apps, SPA's, or microservices.  
Personally, I like it based on simplicity and opinionated architecture - for more information please access: 

- [What is Flask](https://palletsprojects.com/p/flask/) - the official website
- [Flask Docs](https://flask.palletsprojects.com/en/1.1.x/)

---

## ✨ Code-Base Structure

The app is coded using a simple code-base that uses [Blueprints](https://flask.palletsprojects.com/en/1.1.x/blueprints/) and **app-factory** pattern, enhanced with basic modules and features: 

- Session-Based authentication, Forms validation
- Dual DMBS config: SQLite(dev) / PostgreSQL (prod)
- DB Tools: SQLAlchemy ORM, Alembic for migration
- Deployment: Docker, Nginx/Gunicorn stack

---

> Files structure

```bash
< 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
   |
   |-- ************************************************************************
```

--- 

> App bootstrap flow

- `run.py` loads the `.env` file
- Initialize the app using the specified profile: *Debug* or *Production*
  - If env.DEBUG is set to *True* the SQLite storage is used
  - If env.DEBUG is set to *False* the specified DB driver is used (MySql, PostgreSQL)
- Call the app factory method `create_app` defined in app/__init__.py
- Redirect the guest users to Login page
- Unlock the pages served by *home* blueprint for authenticated users

--- 

## ✨ How to build the app

To see the app running locally, we need a basic toolchain properly installed in the workstation: 

- [Python3](https://www.python.org/) - the programming language used to code the app
- [GIT](https://git-scm.com/) command tools - used to clone the source code from the Github repository
- Basic development tools (g++ compiler, python development libraries ..etc) used by Python to compile the app dependencies in your environment.

For more information on how to set up your environment please access the resources listed below, just in case I've missed something: 

- [How to set up Python](https://docs.appseed.us/how-to/install-python)
- [Setup CentOS for development](https://docs.appseed.us/how-to/setup-centos-for-development/)
- [Setup Ubuntu for development](https://docs.appseed.us/how-to/setup-ubuntu-for-development/)
- [Setup Windows for development](https://docs.appseed.us/how-to/setup-windows-for-development/)

Now, the actual build, executed in a terminal window, basically does a few simple things like cloning the source code from Github, prepare the environment and install the app dependencies and start the app in development mode using Flask embedded server. 

> For full build instructions, please access the project [README](https://github.com/app-generator/flask-dashboard-corona-dark/blob/master/README.md). 

```bash
$ # Get the code
$ git clone https://github.com/app-generator/flask-dashboard-corona-dark.git
$ cd flask-dashboard-corona-dark
$
$ # Virtualenv modules installation (Unix based systems)
$ virtualenv env
$ source env/bin/activate
$
$ # Install modules - SQLite Database
$ pip3 install -r requirements.txt
$
$ # Set the FLASK_APP environment variable (Unix based systems)
$ export FLASK_APP=run.py
$
$ # Start the application (development mode)
$ # --host=0.0.0.0 - expose the app on all network interfaces (default 127.0.0.1)
$ # --port=5000    - specify the app port (default 5000)  
$ flask run --host=0.0.0.0 --port=5000
$
$ # Access the dashboard in browser: http://127.0.0.1:5000/
```

---

If the build goes well, we can visit the app in the browser. The first thing we should see is the login page. To unlock the private pages, we need to use the registration page to create a new user, and after authenticate. For authenticated users, the all will unlock some nice dark-designed pages: 

![Flask Corona Dark - ](https://raw.githubusercontent.com/app-generator/flask-dashboard-corona-dark/master/media/flask-dashboard-corona-dark-screen-login.png)

---

> ✨ Flask Corona dark - Charts Page

![Flask Corona dark - Charts Page.](https://raw.githubusercontent.com/app-generator/flask-dashboard-corona-dark/master/media/flask-dashboard-corona-dark-screen-4.png)

--- 

> ✨ Flask Corona Dark - UI Tables Page

![Flask Corona dark - UI Tables Page.](https://raw.githubusercontent.com/app-generator/flask-dashboard-corona-dark/master/media/flask-dashboard-corona-dark-screen-3.png)

--- 

> ✨ Flask Corona Dark - Registration Page

![Flask Corona dark - Registration Page.](https://raw.githubusercontent.com/app-generator/flask-dashboard-corona-dark/master/media/flask-dashboard-corona-dark-screen-register.png)

--- 

> Thanks for reading! 

---

### Links & Resources

> Links

- More [Flask Admin Dashboards](https://appseed.us/admin-dashboards/flask) - a curated index 
- [Open-Source Admin Dashboards](https://appseed.us/admin-dashboards/open-source) - index hosted by AppSeed