A robust inventory and staff management system built for Medhal Nigeria Limited.
The system allows role-based access (Admin, Store, Account), tracking of stock in/out,
history, and staff records with a clean, navigable sidebar interface.
Login System
Inventory Management
Staff Management
Database Integration
users, stock_in, stock_out, staff, historydb.pyRerun / State Handling
st.stop() used to trigger safe rerun on login/logoutPython 3.10+
Streamlit >= 1.22
psycopg2 / mysql-connector-python (depending on DB)
pandas
VSCode or any code editor
Optional: Git for cloning
Login Page

Dashboard / Stock Management

Report Generator

Staff Records

History Records

Clone the repository and set up virtual environemnt
git clone https://github.com/e-badawy/superstore_offline.git
python -m venv .venv
# Windows
.venv\Scripts\activate
# macOS/Linux
source .venv/bin/activate
pip install -r requirements.txt
Set up MySQL database
oms_dbdb_setup.sql in MySQL Workbench or VSCode SQL extension to create tablesUpdate database connection
db.pyhost='localhost'
user='root'
password='your_password'
database='oms_db'
Create initial users
INSERT INTO users (username, password, role) VALUES ('admin', '123', 'Admin');
INSERT INTO users (username, password, role) VALUES ('store', '123', 'Store');
INSERT INTO users (username, password, role) VALUES ('account', '123', 'Account');
Run the Streamlit app
streamlit run app.py
Access the app
http://localhost:8501🔹 Project Structure
superstore_offline/
│
├─ app.py # Main Streamlit app
├─ db.py # Database connection & queries
├─ requirements.txt # Python dependencies
├─ db_setup.sql # SQL tables creation
├─ images/ # Screenshots and GIFs
└─ other_modules/ # Optional helper scripts
Complete workflow including setup for MySQL, running in VSCode, creating users, and app workflow.