The web application is now running at: http://localhost:5000
- Admin:
admin/admin123(Full access + User Management) - User:
user1/user123(Standard access) - Demo:
demo/demo123(Standard access)
- ✅ Professional green theme matching Sage X3
- ✅ Modern, responsive design
- ✅ Clean login interface
- ✅ Role-based access control (Admin, User, Viewer)
- ✅ User creation, editing, and deletion
- ✅ Access
/admin/usersas admin to manage users
- ✅ Multiple field support (Product Code, Name, Price, Batch, Expiry, Custom fields)
- ✅ Customizable layout (Font size, Barcode height, Text visibility)
- ✅ Real-time preview at actual size (3.5cm × 2.5cm)
- ✅ Product search functionality
- ✅ Template save/load system
- ✅ PDF Generation: Direct PDF download for regular printers
- ✅ ZPL Output: Optimized code for Zebra ZD220 thermal printer
- ✅ Copy-to-clipboard functionality
- ✅ Print preview with instructions
- ✅ 5 sample products for testing
- ✅ Search functionality works with sample data
- ✅ All features functional without database connection
To connect to your actual ERP database, follow these steps:
# Install Microsoft ODBC Driver 17 for SQL Server
# Download from: https://docs.microsoft.com/en-us/sql/connect/odbc/download-odbc-driver-for-sql-server
# Install pyodbc
pip install pyodbcEdit config.json:
{
"mssql_server": "your-server-name",
"mssql_database": "your-erp-database",
"mssql_username": "your-username",
"mssql_table": "your-product-table",
"label_width_cm": 3.5,
"label_height_cm": 2.5
}In app_simple.py, uncomment the MSSQL connection code and replace the sample data functions.
Your MSSQL table should have these columns (adjust field names as needed):
CREATE TABLE ProductLabels (
ProductCode NVARCHAR(50) PRIMARY KEY,
ProductName NVARCHAR(255),
Price NVARCHAR(50),
BatchNumber NVARCHAR(100),
ExpiryDate DATE,
Category NVARCHAR(100),
-- Add other fields as needed
);- Use the generated ZPL code from the application
- Send directly to printer via:
- USB connection
- Network (telnet to printer IP:9100)
- Zebra Setup Utilities
# Example: Send ZPL via telnet
telnet [printer-ip] 9100
# Paste the ZPL code and press Enter# Copy ZPL to file and send to printer
copy zpl_code.txt \\.\USB001- Change Default Passwords: Update all default user passwords
- Use HTTPS: Configure SSL/TLS certificates
- Database Security: Use encrypted connections to MSSQL
- Session Security: Configure secure session settings
- Access Control: Implement proper network access controls
Barcode-Project/
├── app_simple.py # Main Flask application
├── templates/ # HTML templates
│ ├── login.html # Sage X3-style login
│ ├── index.html # Main application
│ └── admin_users.html # User management
├── static/
│ └── app.js # Frontend JavaScript
├── config.json # Configuration file
├── requirements_basic.txt # Python dependencies
└── SETUP_GUIDE.md # This guide
- Login: Use any of the default credentials
- Search Products: Try searching for "PRD001" or "Sample"
- Generate Labels: Fill in product details and click "Generate Preview"
- Print PDF: Click "Print PDF" to download a label
- Print ZPL: Click "Print ZPL" to get thermal printer code
- User Management: Login as admin and visit
/admin/users
- Port 5000 in use: Change port in
app_simple.py - PDF generation fails: Check ReportLab installation
- Barcode not showing: Verify product code format
- MSSQL connection fails: Check driver installation and credentials
- Check browser console for JavaScript errors
- Check Flask console for server errors
- Verify all dependencies are installed
- Update the HTML form in
templates/index.html - Modify the PDF generation in
generate_pdf()function - Update ZPL generation in frontend JavaScript
- Update
LABEL_WIDTH_CMandLABEL_HEIGHT_CMin config - Adjust CSS dimensions in templates
- Modify ZPL dimensions in JavaScript
- Modify CSS in templates for different color schemes
- Update logo and branding elements
- Customize fonts and layouts
✅ Professional Sage X3-style interface
✅ Complete user management system
✅ Flexible label designer with live preview
✅ PDF and thermal printer support
✅ Ready for MSSQL integration
✅ Production-ready architecture
The application is now ready for use and can be easily integrated with your existing ERP system!