Store_model

🛍️ Store Management System

📋 Overview

Store Management System is a comprehensive Python-based retail management application that provides multiple user interfaces for complete store operations. It connects to a SQLite database and offers functionalities such as:

It includes SQL triggers to automatically update inventory after sales, making it a reliable and efficient tool for small to medium-sized retail businesses.

You can see MVP in there : https://huggingface.co/spaces/sepehr21ar/Store

✨ Features

🛠️ Prerequisites

Ensure the following are installed on your system:

🧱 Database Setup

1. Initialize Database

Run the initialization script to create the SQLite database:

python init_db.py

This creates store.db with the following structure:

Database Schema:

2. Sample Data

The initialization includes sample products:

📦 Installation

1. Clone the Repository

git clone https://github.com/sepehr21ar/Store_model
cd Store_model

2. Install Dependencies

pip install gradio pandas pyTelegramBotAPI

3. Initialize Database

python init_db.py

4. Run Your Preferred Interface

CLI Interface:

python store.py

Web Interface (Gradio):

python gradio_app.py
# Navigate to http://localhost:7860

Telegram Bot:

# Configure your bot token in telegram_bot.py first
python telegram_bot.py

🎯 Usage

CLI Interface Menu

You will see an interactive menu with options:

  1. Add New Product
  2. Add Product to Inventory
  3. Delete Product
  4. Record Store Sale
  5. Record Online Sale
  6. Show Current Inventory
  7. Show Sales Report
  8. Exit

Web Interface Features

Telegram Bot Commands

📁 Project Structure

Store_model/
├── store.py              # Core business logic and CLI interface
├── store_schema.sql      # Database schema and initial data
├── init_db.py           # Database initialization script
├── gradio_app.py        # Web UI using Gradio framework
├── telegram_bot.py      # Persian Telegram bot interface
├── store.db             # SQLite database (created after init)
├── action_flag.txt      # Operations log file
└── README.md            # Project documentation

🔧 Configuration

Telegram Bot Setup

  1. Create a bot via @BotFather
  2. Replace TOKEN in telegram_bot.py:
    TOKEN = "YOUR_BOT_TOKEN_HERE"
    
  3. Run: python telegram_bot.py

Database Configuration

Default database path: store.db Configurable in all interface files if needed.

🛡️ Error Handling

📊 Key Operations

🔍 Technical Details

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature-name
  3. Test all interfaces thoroughly
  4. Commit changes: git commit -m 'Add feature-name'
  5. Push to branch: git push origin feature-name
  6. Submit a Pull Request

🎯 Roadmap

🐛 Known Issues

📝 License

This project is open-source under the MIT License. Use it freely for learning or commercial purposes. Contributions are encouraged!

📞 Support

For questions, bug reports, or feature requests:


Ready to efficiently manage your store operations with multiple interfaces!