Skip to content

HarK-github/Chemical-Equipment-Parameter-Visualizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

58 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Chemical-Equipment-Parameter-Visualizer



Project Overview

The Chemical Equipment Parameter Visualizer is a hybrid application that provides both web and desktop interfaces for analyzing and visualizing chemical equipment data. Users can upload CSV files and view summary statistics, charts, historical datasets, and optionally generate PDF reports.

The system includes:

  • Django REST API backend
  • React.js web frontend
  • PyQt5 desktop application

The dekstop and web application use the same backend server.

πŸ“File Structure

Backend Directory

backend/
β”œβ”€β”€ api/                           # Django app for API endpoints
β”‚   β”œβ”€β”€ admin.py                  
β”‚   β”œβ”€β”€ models.py                
β”‚   β”œβ”€β”€ serializers.py           
β”‚   β”œβ”€β”€ views.py                  
β”‚   └── migrations/              
β”œβ”€β”€ backend/                      
β”‚   β”œβ”€β”€ settings.py               
β”‚   β”œβ”€β”€ deployment_settings.py    # For deployment               
β”‚   β”œβ”€β”€ urls.py                   
β”‚   └── wsgi.py                   # WSGI configuration for production
β”œβ”€β”€ csv_files/                    # Directory for uploaded CSV files
β”œβ”€β”€ db.sqlite3                    # SQLite database file
β”œβ”€β”€ Dockerfile                    # Container configuration for backend
β”œβ”€β”€ manage.py                     
└── requirements.txt              # Python dependencies list

Frontend Directory

frontend/
β”œβ”€β”€ src/                          # Source code directory
β”‚   β”œβ”€β”€ api.tsx                   # API service functions
β”‚   β”œβ”€β”€ App.tsx                   # Main React application component
β”‚   β”œβ”€β”€ components/               # Reusable React components
β”‚   β”‚   β”œβ”€β”€ Charts.tsx            
β”‚   β”‚   β”œβ”€β”€ ExportPdf.tsx         
β”‚   β”‚   β”œβ”€β”€ navbar.tsx           
β”‚   β”‚   └── ProtectedRoute.tsx    # Route protection for authentication
β”‚   β”œβ”€β”€ pages/                    # Page components
β”‚   β”‚   β”œβ”€β”€ dashboard.tsx         
β”‚   β”‚   β”œβ”€β”€ home.tsx             
β”‚   β”‚   β”œβ”€β”€ login.tsx             
β”‚   β”‚   └── register.tsx          
β”‚   β”œβ”€β”€ store/                    # State management
β”‚   β”‚   β”œβ”€β”€ authSlice.ts          # Authentication state slice
β”‚   β”‚   └── store.ts              
β”‚   └── types/                    
β”‚       └── index.ts              # Main type definitions
β”œβ”€β”€ package.json                  
β”œβ”€β”€ Dockerfile                    
└── nginx.config                  # Nginx web server configuration

Desktop Directory

desktop/
β”œβ”€β”€ main.py                       # Main PyQt5 application entry point
└── requirements.txt              # Python dependencies for desktop app

Running application

This section describes how to run the complete application stack using Docker Compose on your local device.

Web frontend

1. Prerequisites

  • Docker
  • Docker Compose
  • Git

2. Clone the Repository

git clone https://github.com/HarK-github/Chemical-Equipment-Parameter-Visualizer.git
cd Chemical-Equipment-Parameter-Visualizer

3. Start the Application

From the project root:

docker compose up --build

Once all containers are running:

  • Backend API (direct): http://127.0.0.1:8000/

  • Frontend: http://localhost:5173/


Note : It might take time for containers to spin up.

4. Development Mode

Access the dev server at:

http://localhost:5173/

Desktop application

To run the dekstop application simply type in the root directory:

bash dekstop_script.sh

This will create a virtual environment,spin up the docker ocntainer, run the dekstop app.


---

πŸ›  Manual Setup

This section explains how to run the backend, web frontend, and desktop application directly on your local machine without using docker container


Backend: Django

1. Navigate to the backend directory

cd backend

2. Create a virtual environment

python -m venv venv
source venv/bin/activate       # macOS/Linux
venv\Scripts\activate          # Windows

3. Install dependencies

pip install -r requirements.txt

4. Apply migrations

python manage.py migrate

5. Start the backend server

python manage.py runserver

The backend will be available at:

http://127.0.0.1:8000/

Web Frontend: React.js

1. Navigate to the frontend directory

cd ./frontend

2. Install dependencies

npm install

3. Set API endpoint in .env

VITE_API_URL=http://127.0.0.1:8000/

4. Start the development server

npm run dev

Frontend available at:

http://localhost:5731/

Desktop Application: PyQt5

Ensure that the backend is runnign

1. Navigate to the desktop folder

cd ./desktop

2. Create and activate a virtual environment

python -m venv venv
source venv/bin/activate

3. Install dependencies

pip install -r requirements.txt

4. Run the desktop application

python main.py

Alternative:

Go to root directory of the project,create and activate a virtual environment

python -m venv venv
source venv/bin/activate

Features

  • CSV upload
  • Summary statistics generation
  • Visualization (Chart.js for web, Matplotlib for desktop)
  • Storage of last five uploaded datasets
  • PDF report generation
  • Basic user authentication

Project Structure

chemical-equipment-visualizer/
β”‚
β”œβ”€ backend/                    # Django backend
β”œβ”€ frontend/                   # React.js frontend
β”œβ”€ desktop/                    # PyQt5 desktop app
β”œβ”€ nginx/                      # Nginx config
└─ docker-compose.yml

Screenshots

Image 1 Β Β Β Β  Image 2

License

This project is licensed under the MIT License. Developed by Harshit Kandpal

About

A Chemical equipment visualiser built using django and react+PyQt.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors