Co-authored-by: Cursor <cursoragent@cursor.com> Reviewed-on: #12 Co-authored-by: diaco <dyaco8464@yahoo.com> Co-committed-by: diaco <dyaco8464@yahoo.com>
Lithium | Print Label
A self-hosted web application for tracking production orders and generating pixel-perfect labels for canisters and boxes.
Features
- Fast Data Entry: Instantly calculate the required number of canister and box labels based on total order weight.
- Dynamic Print Layouts: Automatically generate print-ready A4 pages correctly formatted for pre-printed sticker sheets.
- Print Queue: Manage and track pending label batches with real-time updates.
- Bilingual Interface: Seamlessly switch between English and Persian (LTR).
🚀 Installation & Deployment
The application is fully containerized using Docker, meaning it can be deployed on any machine with Docker installed.
Prerequisites
- Install Docker Desktop (Windows/Mac) or Docker Engine (Linux).
- Ensure you have the project source code downloaded and extracted.
Starting the Server
- Open a terminal or command prompt and navigate to the project directory:
cd path/to/product-slip - Start the application stack using Docker Compose:
docker compose up -d --build - The server is now running! You can access the application from any device on the same local network:
- If you are on the same machine: Open your browser and go to
http://localhost - If you are on a different machine on the same network: Find the host computer's local IP address (e.g.,
192.168.1.15) and go tohttp://192.168.1.15
- If you are on the same machine: Open your browser and go to
Stopping the Server
To safely stop the application without losing data:
docker compose down
(Note: Your database is stored safely in the ./data folder and will persist between restarts).
🖨️ Printer Calibration Guide
Because the application prints dynamic text directly over your physical, pre-printed A4 label sheets, the printer's alignment must be exact. Different browsers and physical printers feed paper with slight millimeter variances.
Follow these steps to calibrate the alignment for your specific printer:
1. Print the Calibration Sheet
- Open the application and navigate to the Calibrate tab in the top menu.
- Load a blank piece of A4 paper into your printer.
- Click the "Print Calibration Sheet" button to print it out.
2. Check the Alignment
- Take your printed blank calibration sheet.
- Place it perfectly behind one of your actual pre-printed label sheets.
- Hold them both up to a light source (like a window or lamp).
- Look for the crosshairs (
┼). They should align perfectly inside the target boxes (Batch, Date, Next Control, and Weight).
3. Adjusting the Millimeters (If Necessary)
If the text is printing slightly too high, too low, or too far to a side, you can adjust the CSS margins in the codebase to shift the text.
- Open the file:
slips/templates/slips/print_page.html - Scroll to the
<style>block at the top, and find the.var-fieldCSS section. - You will see absolute positioning values in millimeters (
mm), for example:.val-batch { top: 15mm; left: 40mm; } - Adjust the numbers:
- To move text DOWN: Increase the
topvalue (e.g.,15mm->17mm). - To move text RIGHT: Increase the
leftvalue (e.g.,40mm->42mm).
- To move text DOWN: Increase the
- Save the file.
- Restart the Docker container so the changes take effect:
docker compose restart app - Print a new calibration sheet and test again until perfect!