This guide walks you through cloning the repository, installing dependencies, provisioning the MySQL database with seed data, and launching the Streamlit web interface. By the end you will have a fully functional petrol pump management dashboard running locally in your browser.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Adarsh275/PetrolPump-Management-System/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before you begin, make sure the following are available on your machine:- Python 3.8+ — the application is written in Python and uses f-string syntax and dataclass features that require 3.8 or later.
- MySQL 8.0+ — with root (or equivalent admin) access so you can create databases and run DDL scripts.
- pip — Python’s package installer, used to add the required libraries.
Setup
Install Python Dependencies
The application depends on three Python packages: the Streamlit UI framework, the MySQL connector, and Pandas for displaying query results. Install them all in one command:Once complete, verify the installations with
pip show streamlit mysql-connector-python pandas.Create the Database
The If your root account uses a password, edit the Alternatively, you can create the database manually inside the MySQL shell:
Project/Create_database.py script connects to your local MySQL server as root and issues a single CREATE DATABASE statement. Its full contents are:Create_database.py
password="" value before running the script. Then execute it:Seed the Schema and Data
With the empty database in place, apply the table definitions and seed data from the SQL files in the The first command creates all tables (PetrolPump, Owners, Employee, Customer, Invoice, Tanker, Sales, Owns, Contacts, Serves, Sales_Manage) and populates them with sample records.The second command applies foreign key constraints that enforce referential integrity between tables (for example, linking
Backend/ directory. Run these two commands from the repository root:Employee.Petrolpump_No back to PetrolPump.Registration_No).You will be prompted for your MySQL root password after each command.Configure the Database Connection
Open Change
Project/database.py and confirm — or update — the connection block at the top of the file so it matches your local MySQL setup:database.py
host, user, and password to reflect your environment. The database value must exactly match the name of the database you created in Step 3.What You’ll See
Once the app loads, the left sidebar contains two dropdown menus that drive the entire interface: Tables — the top-level dropdown lists every entity in the system:PetrolPumpOwnersEmployeeCustomerInvoiceTankerQuery
Employee table and displays them as an interactive DataFrame. Selecting Invoice → Add presents a form where you can fill in invoice details and commit the record to the database with a single button click.
The Query entry in the Tables dropdown unlocks two additional modes:
- Custom Query — type any SQL statement and click Run Query to see results in a DataFrame.
- Function — enter a Tanker ID and click RUN Function to invoke the
TOTAL_AMOUNTstored function and display the calculated fuel value.