Quick Start
This guide will help you get started with Flask Datta Able PRO

Compile the product

To compile the product and use it locally, Python3 should be installed and accessible via the terminal. The source code can be downloaded from the official repository or downloaded in ZIP format from the product page.
Download the sources and unzip the archive.
1
$ cd flask-datta-able-pro
Copied!
Create a virtual environment.
1
$ virtualenv env
2
$ source env/bin/activate
Copied!
Install modules.
1
$ pip3 install -r requirements.txt
Copied!
Set up the environment.
1
$ export FLASK_APP=run.py
2
$ export FLASK_ENV=development
Copied!
Start the application.
1
$ flask run
Copied!
​
If all goes well, we can access Flask Datta Able PRO in the 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 Datta Able - Login Page.

Codebase structure

The project is coded using a simple and intuitive structure presented below:
1
< PROJECT ROOT >
2
|
3
|-- app/ # Implements app logic
4
| |-- base/ # Base Blueprint - handles the authentication
5
| |-- home/ # Home Blueprint - serve UI Kit pages
6
| |
7
| __init__.py # Initialize the app
8
|
9
|-- requirements.txt # Development modules - SQLite storage
10
|-- requirements-mysql.txt # Production modules - Mysql DMBS
11
|-- requirements-pqsql.txt # Production modules - PostgreSql DMBS
12
|
13
|-- .env # Inject Configuration via Environment
14
|-- config.py # Set up the app
15
|-- run.py # Start the app - WSGI gateway
16
|
17
|-- ************************************************************************
Copied!

​

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 the Login page
  • Unlock the pages served by home blueprint for authenticated users
​

Deployment

The app is provided with a basic configuration to be executed in Docker, a popular virtualization software. To start the project inside a Docker container, please type the following commands:
UNZIP the archive and change the current directory
1
$ cd flask-datta-able-pro
Copied!
Download the required packages
1
$ sudo docker-compose pull
Copied!
Build the Docker packages
1
$ sudo docker-compose build
Copied!
Start the dockerized application
1
$ sudo docker-compose up
Copied!
By visitinghttp://localhost:5005the browser we should see the app running.
Flask Datta PRO - Dashboard Page.
​
​
Last modified 7mo ago