A Python-based queue management system with database persistence, featuring a command-line interface, a desktop GUI, and a REST API. Perfect for managing customer queues in retail, healthcare, service centers, and more.
- Multiple Interfaces: Choose between CLI, GUI, or REST API based on your needs
- Real-time Queue Management: Join, call, and complete queue entries instantly
- Persistent Storage: SQLite database ensures data survives system restarts
- Full History Tracking: View complete records of all queue activities
- Statistics Dashboard: Monitor queue performance and customer flow
- Record Management: Delete individual records or clear entire history
- Network Access: API server accessible from any device on your network
- Zero Configuration: Works out of the box with no database setup required
Queue System/
├── main.py # CLI entry point
├── requirements.txt # Python dependencies
├── queue_system.db # SQLite database file (created on first run)
├── README.md # Project documentation
├── core/ # Shared business logic & data layer
│ ├── database.py # SQLite connection and table setup
│ └── queue_logic.py # All queue operations (join, call, done, …)
├── api/ # Flask REST API
│ └── server.py # HTTP endpoints consumed by mobile / web clients
├── ui/ # Tkinter desktop GUI
│ └── ui_admin.py # Admin GUI (join, call next, history, stats, …)
└── tests/ # Unit tests
└── test_fixes.py # Test suite
core/database.py— Manages SQLite connection and creates tables on first run. The database file (queue_system.db) is stored at the project root.core/queue_logic.py— Pure business-logic functions that return data (no printing). Shared by CLI, API, and GUI to eliminate code duplication.api/server.py— Flask REST server exposing the queue system over HTTP on port 5000.ui/ui_admin.py— Tkinter admin GUI with live queue view, history, and statistics tabs.main.py— Interactive command-line interface with emoji-enhanced menu system.
- Python 3.7 or higher
- Flask 2.3.3+ (for the API server only)
- Tkinter (usually included with Python installations)
- SQLite3 (included with Python)
- Clone the repository:
git clone https://github.com/daylighttg/Queue_Sytem.git
cd Queue_Sytem- Create a virtual environment (recommended):
python -m venv venv
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate- Install dependencies:
pip install -r requirements.txtThe database will be automatically created on first run. No additional setup needed!
The CLI provides an interactive menu with the following options:
python main.pyFeatures:
- 🎫 Join Queue - Add customers with automatic ticket generation
- 📢 Call Next Customer - Move the next person from waiting to serving
- ✅ Mark Customer as Done - Complete service for current customer
- 📋 View Waiting Queue - See all customers currently waiting
- 📊 View Full History - Browse complete queue records
- 🗑️ Delete Record - Remove specific entries
- 🧹 Clear All Records - Reset the entire system
A user-friendly graphical interface with multiple tabs:
python -m ui.ui_adminFeatures:
- Live queue display with auto-refresh
- One-click queue operations
- History browser with search/filter
- Real-time statistics dashboard
- Visual queue status indicators
Expose the queue system over HTTP for integration with mobile apps, web dashboards, or other services:
python -m api.serverThe server listens on http://0.0.0.0:5000. Other devices on the same network can access it at http://<YOUR-PC-IP>:5000.
| Method | Path | Description | Request Body |
|---|---|---|---|
| POST | /join |
Add a customer to the queue | {"name": "John Doe"} |
| GET | /queue |
List all waiting customers | - |
| GET | /status |
Who is being served / waiting count | - |
| POST | /next |
Call the next waiting customer | - |
| POST | /done |
Mark the serving customer as done | - |
| GET | /history |
Full record history | - |
Add a customer to the queue:
curl -X POST http://localhost:5000/join \
-H "Content-Type: application/json" \
-d '{"name": "John Doe"}'Get queue status:
curl http://localhost:5000/statusCall next customer:
curl -X POST http://localhost:5000/nextView waiting queue:
curl http://localhost:5000/queueIf you encounter "database is locked" errors when running multiple interfaces simultaneously, ensure you're not accessing the database from incompatible applications.
If the API server reports port 5000 is already in use:
# Find and stop the process using port 5000, or change the port in api/server.pyIf the GUI doesn't launch and you see "tkinter is not available":
- Windows/macOS: Tkinter is usually included with Python
- Linux: Install with
sudo apt-get install python3-tk(Ubuntu/Debian)
Ensure you've activated your virtual environment and installed all dependencies:
pip install -r requirements.txtContributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Please ensure your code follows the existing style and includes appropriate tests.
This project is open source. Please check the repository for license information.
For questions, issues, or feature requests:
- Open an issue in the GitHub repository
- Check existing issues before creating a new one
Made with ❤️ for better queue management