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

Releases

Packages

Contributors

Languages