Skip to content

Commit

Permalink
Release v1.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
App Generator committed Jan 18, 2022
1 parent 8447cac commit 85523ec
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 140 deletions.
210 changes: 71 additions & 139 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,40 @@ Open-Source **Flask Dashboard** coded with basic modules, database, ORM and depl

> Features
- DBMS: SQLite, PostgreSQL (production)
- DB Tools: SQLAlchemy ORM, Alembic (schema migrations)
- Modular design with **Blueprints**
- `Up-to-date dependencies`
- `DBMS`: SQLite, PostgreSQL (production)
- `DB Tools`: SQLAlchemy ORM, Flask-Migrate (schema migrations)
- Session-Based authentication (via **flask_login**), Forms validation
- Deployment scripts: Docker, Gunicorn / Nginx, Heroku
- `Deployment`: **Docker**, Gunicorn / Nginx, HEROKU
- Support via **Github** (issues tracker) and [Discord](https://discord.gg/fZC6hup).

<br />

> Links
- [Flask Material Lite](https://appseed.us/admin-dashboards/flask-dashboard-material-lite) - product page
- [Flask Material Lite](https://flask-dashboard-material-lite.appseed.us/) - LIVE deployment
- [Flask Material Lite](https://docs.appseed.us/products/flask-dashboards/materialpro-lite) - product documentation
- 👉 [Flask Material Lite](https://appseed.us/admin-dashboards/flask-dashboard-material-lite) - product page
- 👉 [Flask Material Lite](https://flask-dashboard-material-lite.appseed.us/) - LIVE deployment
- 👉 [Flask Material Lite](https://docs.appseed.us/products/flask-dashboards/materialpro-lite) - product documentation

<br />

## Want more? Go PRO!
## ✨ Quick Start in `Docker`

PRO versions include **Premium UI Kits**, Lifetime updates and **24/7 LIVE Support** (via [Discord](https://discord.gg/fZC6hup))
> Get the code
| [Flask Material PRO Wpx](https://appseed.us/admin-dashboards/flask-material-dashboard-wpx-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 Material PRO Wpx](https://raw.githubusercontent.com/app-generator/flask-material-dashboard-wpx-pro/master/media/flask-material-dashboard-wpx-pro-screen.png)](https://appseed.us/admin-dashboards/flask-material-dashboard-wpx-pro) | [![Flask Dashboard Black PRO](https://raw.githubusercontent.com/app-generator/flask-dashboard-black-pro/master/media/flask-dashboard-black-pro-screen.png)](https://appseed.us/admin-dashboards/flask-dashboard-black-pro) | [![Flask Dashboard Argon PRO](https://raw.githubusercontent.com/app-generator/flask-dashboard-argon-pro/master/media/flask-dashboard-argon-pro-screen.png)](https://appseed.us/admin-dashboards/flask-dashboard-argon-pro)
```bash
$ git clone https://github.com/app-generator/flask-material-pro-lite.git
$ cd flask-material-pro-lite
```

> Start the app in Docker
```bash
$ docker-compose up --build
```

Visit `http://localhost:85` in your browser. The app should be up & running.

<br />
<br />

![Flask Material Lite - Template project provided by AppSeed.](https://raw.githubusercontent.com/app-generator/flask-dashboard-material-lite/master/media/flask-dashboard-material-lite-screen.png)
Expand All @@ -42,8 +50,8 @@ PRO versions include **Premium UI Kits**, Lifetime updates and **24/7 LIVE Suppo

```bash
$ # Get the code
$ git clone https://github.com/app-generator/flask-dashboard-material-lite.git
$ cd flask-dashboard-material-lite
$ git clone https://github.com/app-generator/flask-material-pro-lite.git
$ cd flask-material-pro-lite
$
$ # Virtualenv modules installation (Unix based systems)
$ virtualenv env
Expand Down Expand Up @@ -81,148 +89,72 @@ $ # Access the dashboard in browser: http://127.0.0.1:5000/
<br />

## Code-base structure
## 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
The project is coded using blueprints, app factory pattern, dual configuration profile (development and production), and an intuitive structure presented below:

```bash
< PROJECT ROOT >
|
|-- app/ # Implements app logic
| |-- base/ # Base Blueprint - handles the authentication
| |-- home/ # Home Blueprint - serve UI Kit pages
|-- apps/
| |
| __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 >
| |-- home/ # A simple app that serve HTML files
| | |-- routes.py # Define app routes
| |
| |-- authentication/ # Handles auth routes (login and register)
| | |-- routes.py # Define authentication routes
| | |-- models.py # Defines models
| | |-- forms.py # Define auth forms (login and register)
| |
| |-- static/
| | |-- <css, JS, images> # CSS files, Javascripts files
| |
| |-- templates/ # Templates used to render pages
| | |-- includes/ # HTML chunks and components
| | | |-- 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 # Register page
| | |
| | |-- home/ # UI Kit Pages
| | |-- index.html # Index page
| | |-- 404-page.html # 404 page
| | |-- *.html # All other pages
| |
| config.py # Set up the app
| __init__.py # Initialize the app
|
|-- 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
|
|-- requirements.txt # Development modules - SQLite storage
|-- requirements-mysql.txt # Production modules - Mysql DMBS
|-- requirements-pqsql.txt # Production modules - PostgreSql DMBS
|-- Dockerfile # Deployment
|-- docker-compose.yml # Deployment
|-- gunicorn-cfg.py # Deployment
|-- nginx # Deployment
| |-- appseed-app.conf # Deployment
|
|-- .env # Inject Configuration via Environment
|-- config.py # Set up the app
|-- run.py # Start the app - WSGI gateway
|-- .env # Inject Configuration via Environment
|-- 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/), [Heroku](https://www.heroku.com/), [Gunicorn](https://gunicorn.org/), and [Waitress](https://docs.pylonsproject.org/projects/waitress/en/stable/).

<br />

### [Docker](https://www.docker.com/) execution
---

The application can be easily executed in a docker container. The steps:

> Get the code
```bash
$ git clone https://github.com/app-generator/flask-dashboard-material-lite.git
$ cd flask-dashboard-material-lite
```

> Start the app in Docker
```bash
$ 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.

<br />

### [Heroku](https://www.heroku.com/)
---

Expand All @@ -235,8 +167,8 @@ Steps to deploy on **Heroku**

```bash
$ # Clone the source code:
$ git clone https://github.com/app-generator/flask-dashboard-material-lite.git
$ cd flask-dashboard-material-lite
$ git clone https://github.com/app-generator/flask-material-pro-lite.git
$ cd flask-material-pro-lite
$
$ # Check Heroku CLI is installed
$ heroku -v
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "flask-material-pro-lite",
"mastertemplate": "boilerplate-code-flask-dashboard",
"version": "1.0.1",
"version": "1.0.2",
"description": "Template project - Flask Boilerplate Code",
"repository": {
"type": "git",
Expand Down

0 comments on commit 85523ec

Please sign in to comment.