Skip to content

srush0/dataflask

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Chemical Equipment Parameter Visualizer

A hybrid Web + Desktop application for uploading, analyzing, and visualizing chemical equipment data from CSV files.

Python Django React PyQt5

πŸš€ Features

  • CSV Upload: Upload equipment data via Web or Desktop interface
  • Data Analysis: Automatic calculation of averages and distributions using Pandas
  • Visualizations: Interactive charts with Chart.js (Web) and Matplotlib (Desktop)
  • PDF Reports: Generate downloadable PDF reports with ReportLab
  • History Management: Stores last 5 uploaded datasets
  • Authentication: Token-based user authentication
  • Responsive UI: Modern dark-themed interfaces on both platforms

πŸ“ Project Structure

chemical-equipment-visualizer/
β”œβ”€β”€ backend/                    # Django REST API
β”‚   β”œβ”€β”€ equipment_visualizer/   # Django project settings
β”‚   β”œβ”€β”€ equipment_api/          # Main API app
β”‚   β”œβ”€β”€ manage.py
β”‚   └── requirements.txt
β”œβ”€β”€ frontend-web/               # React.js application
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/         # React components
β”‚   β”‚   β”œβ”€β”€ App.jsx
β”‚   β”‚   β”œβ”€β”€ api.js
β”‚   β”‚   └── index.css
β”‚   β”œβ”€β”€ package.json
β”‚   └── vite.config.js
β”œβ”€β”€ frontend-desktop/           # PyQt5 application
β”‚   β”œβ”€β”€ main.py                 # Desktop app entry point
β”‚   β”œβ”€β”€ api_client.py           # API client
β”‚   └── requirements.txt
β”œβ”€β”€ sample_equipment_data.csv   # Sample test data
└── README.md

πŸ› οΈ Tech Stack

Layer Technology Purpose
Backend Django + DRF REST API
Web Frontend React + Chart.js Web visualization
Desktop Frontend PyQt5 + Matplotlib Desktop visualization
Data Processing Pandas CSV parsing & analytics
PDF Generation ReportLab PDF reports
Database SQLite Data storage

πŸ“‹ Prerequisites

  • Python 3.9+
  • Node.js 18+
  • pip (Python package manager)
  • npm (Node package manager)

βš™οΈ Setup Instructions

1. Clone the Repository

git clone https://github.com/yourusername/chemical-equipment-visualizer.git
cd chemical-equipment-visualizer

2. Backend Setup (Django)

# Navigate to backend directory
cd backend

# Create virtual environment
python -m venv venv

# Activate virtual environment
# Windows:
venv\Scripts\activate
# Linux/Mac:
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Run migrations
python manage.py migrate

# Create superuser (optional)
python manage.py createsuperuser

# Start server
python manage.py runserver

The API will be available at http://localhost:8000/api/

3. Web Frontend Setup (React)

# Open new terminal, navigate to frontend-web
cd frontend-web

# Install dependencies
npm install

# Start development server
npm run dev

The web app will be available at http://localhost:5173/

4. Desktop Frontend Setup (PyQt5)

# Open new terminal, navigate to frontend-desktop
cd frontend-desktop

# Create virtual environment (optional but recommended)
python -m venv venv
venv\Scripts\activate  # Windows

# Install dependencies
pip install -r requirements.txt

# Run the desktop application
python main.py

πŸ“Š Sample Data

A sample CSV file (sample_equipment_data.csv) is provided with the following format:

Equipment Name Type Flowrate Pressure Temperature
Reactor R-101 Reactor 150.5 25.0 180.0
Heat Exchanger HX-201 Heat Exchanger 320.0 15.5 95.0
... ... ... ... ...

πŸ”Œ API Endpoints

Endpoint Method Description
/api/upload/ POST Upload CSV file
/api/datasets/ GET List last 5 datasets
/api/datasets/<id>/ GET Dataset details
/api/datasets/<id>/summary/ GET Statistics summary
/api/datasets/<id>/report/ GET Download PDF report
/api/auth/register/ POST User registration
/api/auth/login/ POST User login
/api/auth/logout/ POST User logout

πŸ–ΌοΈ Screenshots

Web Application

  • Dashboard with CSV upload
  • Interactive data tables
  • Chart.js visualizations (Bar, Pie, Line charts)
  • Upload history view

Desktop Application

  • PyQt5 dark-themed interface
  • Matplotlib charts
  • PDF report generation
  • Dataset history management

πŸ§ͺ Testing

Backend Tests

cd backend
python manage.py test

Manual Testing

  1. Start the Django backend
  2. Launch either web or desktop frontend
  3. Upload the sample_equipment_data.csv file
  4. Verify data table and charts display correctly
  5. Test PDF report download

πŸ“ Usage Guide

  1. Start the Backend: Run Django server on port 8000
  2. Launch Frontend: Open web app or desktop app
  3. Upload CSV: Drag-drop or browse for CSV file
  4. View Analysis: See statistics and visualizations
  5. Download Report: Generate PDF summary
  6. View History: Access last 5 uploaded datasets

πŸ” Authentication

  • Register a new account via web or desktop
  • Login to track your uploads
  • Guest mode available (uploads not linked to user)

πŸ“„ License

MIT License - feel free to use and modify.

πŸ‘€ Author

Created as an intern screening task for demonstrating full-stack development skills.


Happy Visualizing! πŸ”¬πŸ“Š

About

A hybrid Web + Desktop application for uploading, analyzing, and visualizing chemical equipment data from CSV files.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors