An open API service indexing awesome lists of open source software.

https://github.com/devqueue/cgmdashwebapp

A dashboard application built with flask and plotly-dash to display metrics.
https://github.com/devqueue/cgmdashwebapp

flask plotly-dash

Last synced: 2 months ago
JSON representation

A dashboard application built with flask and plotly-dash to display metrics.

Awesome Lists containing this project

README

          

# CGM-dashboard
A Dashboard application built using flask and plotly-dash.

## Configuring the data path:
Use the `.env` to add an absolute path to the directory of files or you may export the path an environment variable `DATA_PATH` The app expects a directory and not a file. The directory must contain excel files only. either ending with `.xlsx` or `.xls`.
The `get_data_path()` function in `dataprocessor.py` is responsible for returning the folder path to each endpoint.
It returns the value of environment variable `DATA_PATH`.

## Format for the data:
The app also expects the excel file to follow a certain format. The details of which have been mentioned below. Any deviation from this standard will cause a `runtimeError`
- The summary data must be in the first 2 columns.
- second column name must contain count (case insensitive)
- File name should be id_CGM_month_year.xlsx
- Oncomine, parental should be in order
- count must include month name

## Authentication for uploading files.
The app can connect to any local or remote database given that you specify the URI as an environment variable.
The `DATABASE_URI` must be specified using the standard convention
```
[DB_TYPE]+[DB_CONNECTOR]://[USERNAME]:[PASSWORD]@[HOST]:[PORT]/[DB_NAME]
```

## Deploying using mod_wsgi (Apache)
1. Install the mod_wsgi:
```
apt-get install libapache2-mod-wsgi-py3
```
2. Edit `app.wsgi`:
- Change the path for the vitual environment under `activate_this`
- Make sure it's a python file
3. Edit `flaskapp.config`:
- Change the port, hostIP or domain, path, etc...
4. Make sure to create a `logs` directory inside the main app directory