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.
- Host: GitHub
- URL: https://github.com/devqueue/cgmdashwebapp
- Owner: devqueue
- License: apache-2.0
- Created: 2022-01-03T07:05:30.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-02-01T05:56:10.000Z (over 4 years ago)
- Last Synced: 2024-10-12T00:30:48.382Z (over 1 year ago)
- Topics: flask, plotly-dash
- Language: Python
- Homepage: https://cgmdashwebapp.herokuapp.com/
- Size: 96.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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