Coder Social home page Coder Social logo

rasi5050 / bioreactor_dashboard Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 19.25 MB

This is a hobby project to create web-based dashboard to visualize real-time process data originating from a bioreactors(simulated via containarized Postgres DB). This project also leverages advanced concepts like Containerization(Docker & Docker compose) and Python entry points

Dockerfile 5.41% Python 82.64% CSS 11.94%

bioreactor_dashboard's Introduction

Bioreactor dashboard

I have deployed the project on AWS, view at https://bit.ly/bioreactor-dashboard

Motivation:

This is a hobby project to create a web-based dashboard(Python & Dash) to visualize real-time process data originating from a bioreactors(simulated via containerized Postgres DB). This project also leverages advanced concepts like Containerization(Docker & Docker compose) and packaging applications using Python entry points

This project idea and skeleton is obtained from internet.

Screenshot 2023-07-20 at 19 06 36

What all have I done?

● Built a Python-Dash interactive web-based data visualization application to monitor metrics like temperature, pH, pressure, oxygen% of a Bioreactor streaming from Postgres DB.

● Stylized application using HTML and CSS, further Implemented interactive features for users to select the time window and hot reloading.

● Configured application to run as python package automatically leveraging python entry points

● Containerized the application and Postgres DB and further leveraged Docker-compose to abstract and run the application underneath.

Whats used?

Python, Pandas, Dash, HTML, CSS, Docker, Docker-compose, Postgres

Functionality

The dashboard plots each of the metrics(Temperature, pH, Distilled Oxygen, and Pressure) over time.

The features include select time window along both axes or in box, double click to reset, auto-refresh the page, download plot as png, pan, zoom

How to run?

(skip if you have it) install docker from https://docs.docker.com/engine/install/

$ git clone https://github.com/rasi5050/Bioreactor_Dashboard.git

$ cd Bioreactor_Dashboard

$ docker-compose up


Edit

11/18/2023: When I tried to deploy app on AWS, it thowed error from postgres docker container. Errors suggest that its due to permissions on /pgdata supplied along with the project. Since I was not able to find the root cause, I have found alternate method to run the application by zipping the orginal files and unzipping on the destination.

If you cannot run app normally, follow as below

$ unzip Bioreactor_Dashboard.zip

$ cd Bioreactor_Dashboard

$ docker-compose up


Navigate your browser to http://localhost:8888/. That's it!

Whats happening behind:

In the directory, you'll find a Dockerfile that defines the image the code will be copied into and installed in. Specifically, the source code will be installed into a Python 3.10 virtual environment as a package via pip, along with all dependencies specified in a requirements.txt file.

You'll also find a compose.yaml file that defines the container that'll be used to run the code. Specifically, to serve the web-based dashboard in a local browser at http://localhost:8888/, Docker is configured to start the container by executing run-app, the expected entrypoint for the application.

The database

The data visualized will be in a Postgres database, also configured in compose.yaml. Credentials to access this database is provided in the following environment variables accessed through local.env:

  • POSTGRES_HOST provides the host
  • POSTGRES_PORT provides the port
  • POSTGRES_USER provides the user
  • POSTGRES_PASSWORD provides the password
  • POSTGRES_DB provides the database

The data

The tables in the database:

brx1=# \dt
                      List of relations
 Schema |           Name           | Type  |      Owner       
--------+--------------------------+-------+------------------
 public | CM_HAM_DO_AI1/Temp_value | table | process_trending
 public | CM_HAM_PH_AI1/pH_value   | table | process_trending
 public | CM_PID_DO/Process_DO     | table | process_trending
 public | CM_PRESSURE/Output       | table | process_trending

Each table has the same schema, like so:

brx1=# \d public."CM_HAM_DO_AI1/Temp_value"
                Table "public.CM_HAM_DO_AI1/Temp_value"
 Column |            Type             | Collation | Nullable | Default 
--------+-----------------------------+-----------+----------+---------
 time   | timestamp without time zone |           |          | 
 value  | double precision            |           |          | 

Each table contains the following data:

Table Name Units
CM_HAM_DO_AI1/Temp_value Temperature Celsius
CM_HAM_PH_AI1/pH_value pH n/a
CM_PID_DO/Process_DO Distilled Oxygen %
CM_PRESSURE/Output Pressure psi

Screenshots

Screenshot 2023-07-20 at 19 06 36 Screenshot 2023-07-20 at 19 08 25 Screenshot 2023-07-20 at 19 07 00 Screenshot 2023-07-20 at 19 08 45

--

Happy learning! Happy to connect on Linkedin

bioreactor_dashboard's People

Contributors

rasi5050 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.