> For the complete documentation index, see [llms.txt](https://codedthemes.gitbook.io/flask-datta-pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://codedthemes.gitbook.io/flask-datta-pro/quick-start.md).

# Quick Start

### Compile the product <a href="#compile-the-product" id="compile-the-product"></a>

&#x20;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](https://codedthemes.com/item/datta-able-pro-flask-template/).

&#x20;**Download the sources** and unzip the archive.

```
$ cd flask-datta-able-pro
```

&#x20;**Create a virtual environment.**

```
$ virtualenv env
$ source env/bin/activate
```

&#x20;**Install modules.**

```
$ pip3 install -r requirements.txt
```

&#x20;**Set up the environment.**

```
$ export FLASK_APP=run.py
$ export FLASK_ENV=development
```

&#x20;**Start the application.**

```
$ flask run
```

If all goes well, we can access [**Flask Datta Able PRO**](https://codedthemes.com/item/datta-able-pro-flask-template/) 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.](/files/-MX0pGwfjInswgkSOVdK)

### Codebase structure <a href="#codebase-structure" id="codebase-structure"></a>

The project is coded using a simple and intuitive structure presented below:

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

### &#x20;<a href="#the-bootstrap-flow" id="the-bootstrap-flow"></a>

### The bootstrap flow <a href="#the-bootstrap-flow" id="the-bootstrap-flow"></a>

* `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 <a href="#deployment" id="deployment"></a>

&#x20;The app is provided with a basic configuration to be executed in [Docker](https://www.docker.com/), a popular virtualization software. To start the project inside a Docker container, please type the following commands:

&#x20;**UNZIP the archive** and change the current directory

```
$ cd flask-datta-able-pro
```

&#x20;**Download the required packages**

```
$ sudo docker-compose pull
```

&#x20;**Build the Docker packages**

```
$ sudo docker-compose build
```

&#x20;**Start the dockerized application**

```
$ sudo docker-compose up
```

&#x20;By visiting`http://localhost:5005`the browser we should see the app running.

![Flask Datta PRO - Dashboard Page.](/files/-MX0rFP4JdmTKxAk9bMF)
