Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/raghavendranhp/battery-data-dashboard
This project involves the creation of a battery data dashboard utilizing Streamlit for data visualization, Flask for REST API endpoints, and SQLite for data storage. The project includes data preprocessing, unit test coverage, secure authentication, pagination, filtering, and API documentation.
https://github.com/raghavendranhp/battery-data-dashboard
flask pytest sql-server sqlite3 streamlit streamlit-dashboard unittest
Last synced: 14 days ago
JSON representation
This project involves the creation of a battery data dashboard utilizing Streamlit for data visualization, Flask for REST API endpoints, and SQLite for data storage. The project includes data preprocessing, unit test coverage, secure authentication, pagination, filtering, and API documentation.
- Host: GitHub
- URL: https://github.com/raghavendranhp/battery-data-dashboard
- Owner: raghavendranhp
- Created: 2024-08-08T02:13:10.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-08-08T09:08:02.000Z (6 months ago)
- Last Synced: 2025-01-18T12:15:55.530Z (14 days ago)
- Topics: flask, pytest, sql-server, sqlite3, streamlit, streamlit-dashboard, unittest
- Language: Jupyter Notebook
- Homepage:
- Size: 21.3 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#
# Battery Data Dashboard
## Overview
This project is a simple three-page dashboard for visualizing the performance of Li-ion cells. The dashboard displays various metrics such as State of Health (SoH), Voltage, Current, Temperature, and Capacity over time for each cell.
## Table of Contents
- [Project Structure](#project-structure)
- [Features](#features)
- [Technologies Used](#technologies-used)
- [Setup and Installation](#setup-and-installation)
- [Running the Project](#running-the-project)
- [API Endpoints](#api-endpoints)
- [Dashboard Pages](#dashboard-pages)
- [Testing](#testing)
- [Author](#author)## Project Structure
├── app.py # Flask application
├── streamlit_app.py # Streamlit application
├── test_app.py # Unit tests for Flask application
├── requirements.txt # Python dependencies
├── packages.txt # System packages required
├── Procfile # Command to run the application
├── battery_database.db # SQLite database file
└── README.md # This file## Features
- Displays State of Health (SoH) for different Li-ion cells.
- Provides Voltage, Current, Temperature, and Capacity over time graphs for each cell.
- REST API for accessing battery data.
- Unit tests for ensuring code reliability.## Demo
### Project Overview
![Project Demo](assets/Code_animation.gif)
*Above GIF shows the coding.*### Battery Data Dashboard
![Dashboard](assets/Dashboard_animation.gif)
*Above GIF demonstrates the working of the Battery Data Dashboard.*### Battery Cell 5308
![Cell 5308](assets/5308_animation.gif)
*Above GIF demonstrates the working of the Battery 5308 Data Dashboard.*### Battery Cell 5329
![Cell 5329](assets/5329_animation.gif)
*Above GIF demonstrates the working of the Battery 5329 Data Dashboard.*## Technologies Used
- **Flask**: Backend framework for serving the REST API.
- **Streamlit**: Frontend framework for creating the interactive dashboard.
- **SQLite**: Database for storing battery data.
- **Plotly**: Library for creating interactive charts.
- **requests**: Library for making HTTP requests to the Flask API.
- **unittest**: Framework for writing and running tests.## Setup and Installation
1. **Clone the repository**:
```bash
git clone https://github.com/raghavendranhp/Battery-Data-Dashboard.git
cd battery-data-dashboard
```2. **Install system packages**:
```bash
sudo apt-get install -y libgl1 freeglut3-dev libgtk2.0-dev libgl1-mesa-glx
```3. **Set up a virtual environment and install Python dependencies**:
```bash
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
```## Running the Project
1. **Run the Flask API**:
```bash
python app.py
```2. **Run the Streamlit dashboard**:
```bash
streamlit run streamlit_app.py
```### Procfile
For deploying on platforms like Railway, include the following in your `Procfile`:
```
web: streamlit run streamlit_app.py --server.port $PORT
```## API Endpoints
- **GET /data/**: Get all data for a specific cell ID.
- **GET /soh/**: Get the State of Health for a specific cell ID.
- **GET /cells**: Get a list of all cell IDs.
- **GET /voltage/**: Get voltage vs. time data for a specific cell ID.
- **GET /current/**: Get current vs. time data for a specific cell ID.
- **GET /temperature/**: Get temperature vs. time data for a specific cell ID.
- **GET /capacity/**: Get capacity vs. time data for a specific cell ID.## Dashboard Pages
### Dashboard Overview
- **State of Health (SoH)**: Displays SoH for the first two cells using pie charts.
### Cell Details
- **Voltage vs. Time**: Line chart showing voltage over time.
- **Current vs. Time**: Line chart showing current over time.
- **Temperature vs. Time**: Line chart showing temperature over time.
- **Capacity vs. Time**: Line chart showing capacity over time.## Testing
To run the unit tests for the Flask API, use:
```bash
python test_app.py
```## Author
- **Name**: Raghavendran S.
- **Contact**: [[email protected]](mailto:[email protected])
- **Location**: Erode, Tamil NaduFeel free to reach out for any questions or collaboration opportunities!