|
|
@@ -1,24 +1,24 @@
|
|
|
# [Flask Dashboard - Black Design](https://appseed.us/admin-dashboards/flask-dashboard-black)
|
|
|
|
|
|
-> **Open-Source Admin Dashboard** coded in **Flask Framework** by **AppSeed** [Web App Generator](https://appseed.us/app-generator) - Features
|
|
|
+> Open-Source admin dashboard coded in **Flask Framework** by **AppSeed** [Web App Generator](https://appseed.us/app-generator) - Features
|
|
|
|
|
|
- UI Kit: **Black Dashboard** (Free version) provided by **Creative-Tim**
|
|
|
-- Modular design with **Blueprints**
|
|
|
- SQLite, PostgreSQL, SQLAlchemy ORM
|
|
|
- Alembic (DB schema migrations)
|
|
|
+- Modular design with **Blueprints**
|
|
|
- Session-Based authentication (via **flask_login**)
|
|
|
-- Deployment scripts: Docker, Gunicorn / Nginx
|
|
|
-- **MIT License**
|
|
|
-- Free support via **Github**
|
|
|
-- Paid Support **24/7 LIVE Support** via [Discord](https://discord.gg/fZC6hup)
|
|
|
+- Forms validation
|
|
|
+- Deployment scripts: Docker, Gunicorn / Nginx, Heroku
|
|
|
+- **[MIT License](https://github.com/app-generator/license-mit)**
|
|
|
+- Support via **Github** and [Discord](https://discord.gg/fZC6hup).
|
|
|
|
|
|
> Links
|
|
|
|
|
|
-- [Flask Dashboard - Black Design](https://appseed.us/admin-dashboards/flask-dashboard-black) - Product page
|
|
|
-- [Flask Dashboard Black Demo](https://flask-dashboard-black.appseed.us/) - LIVE app
|
|
|
+- [Flask Dashboard - Black Design](https://appseed.us/boilerplate-code/flask-dashboard) - Product page
|
|
|
+- [Flask Dashboard - Black Demo](https://flask-dashboard-black.appseed.us/) - LIVE App deployment
|
|
|
- [Flask Dashboard Black Docs](https://docs.appseed.us/admin-dashboards/flask-dashboard-black/) - App Documentation
|
|
|
-- More [Flask Dashboards](https://appseed.us/admin-dashboards/flask) - index hosted by **AppSeed**
|
|
|
-- More [Admin Dashboards](https://appseed.us/admin-dashboards) - index hosted by **AppSeed**
|
|
|
+- More [Flask Admin Dashboards](https://appseed.us/admin-dashboards/flask) - index hosted by **[AppSeed](https://appseed.us)**
|
|
|
+- [Open-Source Admin Dashboards](https://appseed.us/admin-dashboards/open-source) - index hosted by **[AppSeed](https://appseed.us)**
|
|
|
|
|
|
<br />
|
|
|
|
|
|
@@ -26,9 +26,9 @@
|
|
|
|
|
|
PRO versions include **Premium UI Kits**, Lifetime updates and **24/7 LIVE Support** (via [Discord](https://discord.gg/fZC6hup))
|
|
|
|
|
|
-| [Flask Dashboard Material PRO](https://appseed.us/admin-dashboards/flask-dashboard-material-pro) | [Flask Dashboard Black PRO](https://appseed.us/admin-dashboards/flask-dashboard-black-pro) | [Flask Dashboard Argon PRO](https://appseed.us/admin-dashboards/flask-dashboard-argon-pro) |
|
|
|
+| [Flask DattaAble PRO](https://appseed.us/admin-dashboards/flask-dashboard-dattaable-pro) | [Flask Dashboard Black PRO](https://appseed.us/admin-dashboards/flask-dashboard-black-pro) | [Flask Dashboard Argon PRO](https://appseed.us/admin-dashboards/flask-dashboard-argon-pro) |
|
|
|
| --- | --- | --- |
|
|
|
-| [](https://appseed.us/admin-dashboards/flask-dashboard-material-pro) | [](https://appseed.us/admin-dashboards/flask-dashboard-black-pro) | [](https://appseed.us/admin-dashboards/flask-dashboard-argon-pro)
|
|
|
+| [](https://appseed.us/admin-dashboards/flask-dashboard-dattaable-pro) | [](https://appseed.us/admin-dashboards/flask-dashboard-black-pro) | [](https://appseed.us/admin-dashboards/flask-dashboard-argon-pro)
|
|
|
|
|
|
<br />
|
|
|
<br />
|
|
|
@@ -45,11 +45,11 @@ $ git clone https://github.com/app-generator/flask-black-dashboard.git
|
|
|
$ cd flask-black-dashboard
|
|
|
$
|
|
|
$ # Virtualenv modules installation (Unix based systems)
|
|
|
-$ virtualenv --no-site-packages env
|
|
|
+$ virtualenv env
|
|
|
$ source env/bin/activate
|
|
|
$
|
|
|
$ # Virtualenv modules installation (Windows based systems)
|
|
|
-$ # virtualenv --no-site-packages env
|
|
|
+$ # virtualenv env
|
|
|
$ # .\env\Scripts\activate
|
|
|
$
|
|
|
$ # Install modules - SQLite Database
|
|
|
@@ -76,11 +76,127 @@ $
|
|
|
$ # 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.
|
|
|
+
|
|
|
+<br />
|
|
|
+
|
|
|
+## Code-base structure
|
|
|
+
|
|
|
+The project is coded using blueprints, app factory pattern, dual configuration profile (development and production) and an intuitive structure presented bellow:
|
|
|
+
|
|
|
+> Simplified version
|
|
|
+
|
|
|
+```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
|
|
|
+ |
|
|
|
+ |-- ************************************************************************
|
|
|
+```
|
|
|
+
|
|
|
+<br />
|
|
|
+
|
|
|
+> The 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
|
|
|
+
|
|
|
+<br />
|
|
|
+
|
|
|
+> App / Base Blueprint
|
|
|
+
|
|
|
+The *Base* blueprint handles the authentication (routes and forms) and assets management. The structure is presented below:
|
|
|
+
|
|
|
+```bash
|
|
|
+< PROJECT ROOT >
|
|
|
+ |
|
|
|
+ |-- app/
|
|
|
+ | |-- home/ # Home Blueprint - serve app pages (private area)
|
|
|
+ | |-- base/ # Base Blueprint - handles the authentication
|
|
|
+ | |-- static/
|
|
|
+ | | |-- <css, JS, images> # CSS files, Javascripts files
|
|
|
+ | |
|
|
|
+ | |-- templates/ # Templates used to render pages
|
|
|
+ | |
|
|
|
+ | |-- includes/ #
|
|
|
+ | | |-- navigation.html # Top menu component
|
|
|
+ | | |-- sidebar.html # Sidebar component
|
|
|
+ | | |-- footer.html # App Footer
|
|
|
+ | | |-- scripts.html # Scripts common to all pages
|
|
|
+ | |
|
|
|
+ | |-- layouts/ # Master pages
|
|
|
+ | | |-- base-fullscreen.html # Used by Authentication pages
|
|
|
+ | | |-- base.html # Used by common pages
|
|
|
+ | |
|
|
|
+ | |-- accounts/ # Authentication pages
|
|
|
+ | |-- login.html # Login page
|
|
|
+ | |-- register.html # Registration page
|
|
|
+ |
|
|
|
+ |-- 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
|
|
|
+ |
|
|
|
+ |-- ************************************************************************
|
|
|
+```
|
|
|
+
|
|
|
+<br />
|
|
|
+
|
|
|
+> App / Home Blueprint
|
|
|
+
|
|
|
+The *Home* blueprint handles UI Kit pages for authenticated users. This is the private zone of the app - the structure is presented below:
|
|
|
+
|
|
|
+```bash
|
|
|
+< PROJECT ROOT >
|
|
|
+ |
|
|
|
+ |-- app/
|
|
|
+ | |-- base/ # Base Blueprint - handles the authentication
|
|
|
+ | |-- home/ # Home Blueprint - serve app pages (private area)
|
|
|
+ | |
|
|
|
+ | |-- templates/ # UI Kit Pages
|
|
|
+ | |
|
|
|
+ | |-- index.html # Default page
|
|
|
+ | |-- page-404.html # Error 404 - mandatory page
|
|
|
+ | |-- page-500.html # Error 500 - mandatory page
|
|
|
+ | |-- page-403.html # Error 403 - mandatory page
|
|
|
+ | |-- *.html # All other HTML pages
|
|
|
+ |
|
|
|
+ |-- 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
|
|
|
+ |
|
|
|
+ |-- ************************************************************************
|
|
|
+```
|
|
|
+
|
|
|
<br />
|
|
|
|
|
|
## Deployment
|
|
|
|
|
|
-The app is provided with a basic configuration to be executed in [Docker](https://www.docker.com/), [Gunicorn](https://gunicorn.org/), and [Waitress](https://docs.pylonsproject.org/projects/waitress/en/stable/).
|
|
|
+The app is provided with a basic configuration to be executed in [Docker](https://www.docker.com/), [Heroku](https://www.heroku.com/), [Gunicorn](https://gunicorn.org/), and [Waitress](https://docs.pylonsproject.org/projects/waitress/en/stable/).
|
|
|
|
|
|
<br />
|
|
|
|
|
|
@@ -102,7 +218,42 @@ $ cd flask-black-dashboard
|
|
|
$ sudo docker-compose pull && sudo docker-compose build && sudo docker-compose up -d
|
|
|
```
|
|
|
|
|
|
-Visit `http://localhost:5005` in your browser. The app should be up & running.
|
|
|
+Visit `http://localhost:5005` in your browser. The app should be up & running.
|
|
|
+
|
|
|
+<br />
|
|
|
+
|
|
|
+### [Heroku](https://www.heroku.com/)
|
|
|
+---
|
|
|
+
|
|
|
+Steps to deploy on **Heroku**
|
|
|
+
|
|
|
+- [Create a FREE account](https://signup.heroku.com/) on Heroku platform
|
|
|
+- [Install the Heroku CLI](https://devcenter.heroku.com/articles/getting-started-with-python#set-up) that match your OS: Mac, Unix or Windows
|
|
|
+- Open a terminal window and authenticate via `heroku login` command
|
|
|
+- Clone the sources and push the project for LIVE deployment
|
|
|
+
|
|
|
+```bash
|
|
|
+$ # Clone the source code:
|
|
|
+$ git clone https://github.com/app-generator/flask-black-dashboard.git
|
|
|
+$ cd flask-black-dashboard
|
|
|
+$
|
|
|
+$ # Check Heroku CLI is installed
|
|
|
+$ heroku -v
|
|
|
+heroku/7.25.0 win32-x64 node-v12.13.0 # <-- All good
|
|
|
+$
|
|
|
+$ # Check Heroku CLI is installed
|
|
|
+$ heroku login
|
|
|
+$ # this commaond will open a browser window - click the login button (in browser)
|
|
|
+$
|
|
|
+$ # Create the Heroku project
|
|
|
+$ heroku create
|
|
|
+$
|
|
|
+$ # Trigger the LIVE deploy
|
|
|
+$ git push heroku master
|
|
|
+$
|
|
|
+$ # Open the LIVE app in browser
|
|
|
+$ heroku open
|
|
|
+```
|
|
|
|
|
|
<br />
|
|
|
|
|
|
@@ -125,7 +276,6 @@ Serving on http://localhost:8001
|
|
|
|
|
|
Visit `http://localhost:8001` in your browser. The app should be up & running.
|
|
|
|
|
|
-
|
|
|
<br />
|
|
|
|
|
|
### [Waitress](https://docs.pylonsproject.org/projects/waitress/en/stable/)
|
|
|
@@ -151,28 +301,11 @@ Visit `http://localhost:8001` in your browser. The app should be up & running.
|
|
|
|
|
|
## Credits & Links
|
|
|
|
|
|
-<br />
|
|
|
-
|
|
|
-### What is [Flask](https://www.palletsprojects.com/p/flask/)
|
|
|
-
|
|
|
-[Flask](https://www.palletsprojects.com/p/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.
|
|
|
-
|
|
|
-<br />
|
|
|
-
|
|
|
-### [What is a dashboard](https://en.wikipedia.org/wiki/Dashboard_(business))
|
|
|
-
|
|
|
-A dashboard is a set of pages that are easy to read and offer information to the user in real-time regarding his business. A dashboard usually consists of graphical representations of the current status and trends within an organization. Having a well-designed dashboard will give you the possibility to act and make informed decisions based on the data that your business provides - *definition provided by [Creative-Tim - Free Dashboard Templates](https://www.creative-tim.com/blog/web-design/free-dashboard-templates/?AFFILIATE=128200)*.
|
|
|
-
|
|
|
-<br />
|
|
|
-
|
|
|
-### [Black Dashboard](https://www.creative-tim.com/product/black-dashboard?AFFILIATE=128200)
|
|
|
-
|
|
|
-[Black Dashboard](https://www.creative-tim.com/product/black-dashboard?AFFILIATE=128200) is a beautiful Bootstrap 4 Admin Dashboard with a huge number of components built to fit together and look amazing. If you are looking for a tool to manage and visualize data about your business, this dashboard is the thing for you. It combines colors that are easy on the eye, spacious cards, beautiful typography, and graphics.
|
|
|
-Black Dashboard comes packed with all plugins that you might need inside a project and documentation on how to get started. It is light and easy to use, and also very powerful.
|
|
|
-
|
|
|
-[Black Dashboard](https://www.creative-tim.com/product/black-dashboard?AFFILIATE=128200) features over 16 individual components, giving you the freedom of choosing and combining. This means that there are thousands of possible combinations. All components can take variations in color, that you can easily modify using SASS files. You will save a lot of time going from prototyping to full-functional code because all elements are implemented.
|
|
|
+- [Flask Framework](https://www.palletsprojects.com/p/flask/) - The offcial website
|
|
|
+- [Boilerplate Code](https://appseed.us/boilerplate-code) - Index provided by **AppSeed**
|
|
|
+- [Boilerplate Code](https://github.com/app-generator/boilerplate-code) - Index published on Github
|
|
|
|
|
|
<br />
|
|
|
|
|
|
---
|
|
|
-[Flask Dashboard - Black Design](https://appseed.us/admin-dashboards/flask-dashboard-black) - Provided by **AppSeed** [Web App Generator](https://appseed.us/app-generator).
|
|
|
+[Flask Dashboard - Black Design](https://appseed.us/admin-dashboar - Provided by **AppSeed** [Web App Generator](https://appseed.us/app-generator).
|