A comprehensive, production-ready cafe management system with dual interfaces: a modern desktop POS application and a web-based ordering system accessible from any device on your network.
-
Dual Interface System
- Desktop POS application (PySide6/Qt)
- Web-based interface accessible from browsers
- Network-accessible from any device on the same network
-
Order Management
- Create and manage orders
- Table assignment
- Real-time order tracking
- Order status management (open, closed, cancelled)
- Kitchen display mode
-
User Management
- Role-based access control (Admin, Cashier, Kitchen)
- Secure JWT authentication
- User creation and management (admin only)
- Default admin user on first run
-
Product Management
- Category-based organization
- Product catalog with pricing
- Easy product selection interface
-
Reporting & Analytics
- Dashboard with key metrics
- Sales reports
- Order history
- Revenue tracking
-
Security
- Encrypted password storage (bcrypt)
- JWT token authentication for web API
- Role-based access control
- Session management
- Python 3.8 or higher
- Windows/Linux/macOS
- Network access (for multi-device usage)
-
Clone or download the repository
cd cafe-app -
Install dependencies
pip install -r requirements.txt
-
Run the application
python main.py
On the first run, the system will automatically:
- Initialize the database
- Create the default admin user
- Generate sample products
Default Admin Credentials:
- Username:
admin - Password:
admin123
- Modern POS interface
- Fast order entry
- Multiple themes (Blue, Dark, Orange, Coffee)
- Table management
- Real-time updates
- Kitchen display mode (dual monitor support)
- Receipt printing
- Backup and restore
F1-F9: Quick table selection (Table 1-9)Ctrl+N: New orderCtrl+S: Save/Submit orderEsc: Clear cart
- Open Desktop Application
- Click the 🌐 button in the header (Server Settings)
- Configure and Start the Server:
- Host:
0.0.0.0(for network access) or127.0.0.1(local only) - Port:
8080(or any available port) - Click "
▶️ راهاندازی سرور" to start
- Host:
From the same computer:
http://localhost:8080
From other devices on the network:
http://[YOUR-IP]:8080
(The exact URL is shown in the Server Settings dialog)
- Responsive design (works on mobile, tablet, desktop)
- Login/Authentication
- Dashboard with statistics
- Create new orders
- View and manage orders
- Admin panel for user management
- Real-time updates
-
Configure Firewall
Windows:
# Allow inbound traffic on port 8080 netsh advfirewall firewall add rule name="Cafe Server" dir=in action=allow protocol=TCP localport=8080
Linux:
# UFW sudo ufw allow 8080/tcp # iptables sudo iptables -A INPUT -p tcp --dport 8080 -j ACCEPT
-
Find Your IP Address
Windows:
ipconfig
Look for "IPv4 Address" under your active network adapter
Linux/macOS:
ifconfig # or ip addr show -
Access from Mobile/Other Devices
- Connect to the same Wi-Fi network
- Open browser
- Navigate to
http://[YOUR-IP]:8080 - Login with your credentials
cafe-app/
├── main.py # Application entry point
├── requirements.txt # Python dependencies
├── README.md # This file
│
├── application/ # Application services layer
│ ├── order_service.py
│ ├── menu_service.py
│ └── auth_service.py
│
├── domain/ # Domain models and business logic
│ ├── entities/
│ │ ├── order.py
│ │ ├── product.py
│ │ └── user.py
│ ├── repository/ # Repository interfaces
│ └── value_objects/
│
├── infrastructure/ # Infrastructure layer
│ ├── init_service.py # System initialization
│ ├── backup_service.py # Backup/restore functionality
│ ├── database/
│ │ ├── base.py
│ │ ├── session.py
│ │ ├── models/ # SQLAlchemy models
│ │ └── repositories/
│ └── printer/
│
├── ui/ # Desktop UI (PySide6)
│ ├── main_window.py # Main POS window
│ ├── login_dialog.py # Login dialog
│ ├── server_settings_dialog.py # Server configuration
│ ├── styles.py # Theme management
│ └── widgets/ # Custom widgets
│
└── web/ # Web interface
├── server.py # Uvicorn server management
├── api.py # FastAPI application & routes
├── auth.py # JWT authentication
├── config.py # Server configuration
├── static/
│ ├── style.css # Modern responsive CSS
│ └── app.js # Frontend JavaScript
└── templates/ # HTML templates
├── index.html
├── login.html
├── dashboard.html
├── new_order.html
├── orders.html
└── admin.html
- Python 3.8+
- FastAPI - Modern async web framework
- Uvicorn - ASGI server
- SQLAlchemy - Database ORM
- SQLite - Database
- Pydantic - Data validation
- python-jose - JWT tokens
- passlib[bcrypt] - Password hashing
- PySide6 (Qt 6) - Cross-platform GUI framework
- Vanilla JavaScript - No heavy frameworks
- Modern CSS - Responsive design
- HTML5
id,username,password_hash,full_name,role,is_active,created_at,last_login
id,name,price,category,is_active
id,table_number,status,discount,created_at
id,order_id,product_name,unit_price,quantity
-
Change Default Credentials
- Always change the default admin password after installation
-
Network Security
- Use firewall rules to restrict access if needed
- Consider using HTTPS (requires additional setup)
- Keep the system on a trusted network
-
User Management
- Create separate accounts for each employee
- Use appropriate roles (admin, cashier, kitchen)
- Regularly audit user accounts
-
Backups
- Regularly backup your database
- Store backups securely
- Test restore procedures
Server settings are stored in Config/server_config.json:
{
"host": "0.0.0.0",
"port": 8080,
"enabled": false,
"auto_start": false,
"secret_key": "[auto-generated]",
"token_expire_minutes": 480,
"allow_registration": false
}- Default location:
cafe.dbin the application directory - Can be backed up using the built-in backup feature
- Check if port is already in use
- Try a different port
- Check firewall settings
- Ensure all dependencies are installed
- Verify both devices are on the same network
- Check firewall settings
- Confirm the correct IP address
- Ensure server is running (
0.0.0.0not127.0.0.1)
- Verify credentials
- Check if user account is active
- Clear browser cache/cookies
- Check token expiration settings
- Restore from backup if available
- Delete
cafe.dbto reset (will lose all data) - Check file permissions
- Open Advanced Settings in desktop app
- Click "Backup Database"
- Backups are stored in
backups/directory
- Open Advanced Settings
- Select backup file
- Click "Restore"
- Application will restart
- Keep Python and dependencies updated
- Regularly backup your data
- Monitor system logs
- Clean up old orders periodically
- Use landscape mode for better layout on phones
- Add to home screen for quick access
- Bookmark the login page
- Enable "Stay logged in" on trusted devices
- Blue Modern (Default)
- Dark
- Orange
- Coffee Select from the theme dropdown in the header
- Customize colors in
web/static/style.css - Modify logo and branding in templates
- Regularly clean up old closed orders
- Keep product catalog organized
- Use categories effectively
- Monitor database size
- Restart server periodically
- Check this README
- Review code comments
- Test in a safe environment first
- CPU: Any modern processor (2+ cores recommended)
- RAM: 2GB minimum, 4GB recommended
- Storage: 500MB free space minimum
- Network: Wi-Fi or Ethernet for multi-device access
POST /api/auth/login- LoginGET /api/auth/me- Get current user
GET /api/products- List productsGET /api/products/categories- List categories
GET /api/orders- List ordersPOST /api/orders- Create orderGET /api/orders/{id}- Get order detailsPATCH /api/orders/{id}/status- Update order status
GET /api/admin/users- List users (admin only)POST /api/admin/users- Create user (admin only)PATCH /api/admin/users/{id}/toggle-active- Toggle user statusDELETE /api/admin/users/{id}- Delete user
GET /api/dashboard/stats- Get statistics
This is a custom-built application for cafe management. All rights reserved.
Version 2.0.0
- ✅ Complete rewrite with modern architecture
- ✅ Added web interface with responsive design
- ✅ Network accessibility for multi-device usage
- ✅ JWT authentication
- ✅ Role-based access control
- ✅ Automatic admin initialization
- ✅ Modern UI with multiple themes
- ✅ Kitchen display mode
- ✅ Comprehensive API
Built with ❤️ for Cafe Owners
For questions or support, refer to the code documentation and comments throughout the project.