3.8 KiB
Lithium Labels
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 - (Optional) Copy
.env.exampleto.envand adjust settings:cp .env.example .envHTTP_PORT— host port for the app (default80)APT_MIRROR— Debian apt mirror host used during image buildPIP_INDEX_URL/PIP_TRUSTED_HOST— PyPI mirror used by uv during image build (PIP_TRUSTED_HOSTallows insecure/HTTP hosts)
- 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(orhttp://localhost:$HTTP_PORTif you changed the port) - 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(add:$HTTP_PORTif not using port 80)
- 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. Open the Calibrate tab
- Open the application and navigate to Calibrate in the top menu.
- You will see a live A4 preview (2×2 slips) and a control panel with millimeter positions.
2. Print and check the alignment
- Load a blank piece of A4 paper into your printer.
- Click Print on the calibrate page.
- Place the printed sheet perfectly behind one of your actual pre-printed label sheets.
- Hold them both up to a light source (window or lamp).
- The crosshairs (
┼) should sit inside the target boxes (Batch, Date, Next Control, and Weight).
3. Adjust positions in the UI
If text is too high, low, or off to the side, nudge it in the panel — no code edits or Docker restart needed.
- Use +/− (or type a value) for each field’s
top/left(and font if needed).- Move DOWN: increase
top. - Move RIGHT: increase
left.
- Move DOWN: increase
- Click a crosshair on the preview to jump to that field’s controls; arrow keys also nudge the selection.
- Click Save when it looks right. Values are stored in
data/calibration.json(same persistent data volume as the database). - Print a new calibration sheet and overlay again until perfect.
- Reset defaults restores the built-in starting positions.
Order print pages load the latest saved calibration automatically when you open Print (no hard refresh required).