Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/hxmz-axfn07/qr-printing-sfw/llms.txt

Use this file to discover all available pages before exploring further.

QR Print Station uses a dual-source configuration system. config.yml acts as the file-level fallback and is always read first. The MySQL settings table then acts as a runtime override layer — any key present in the database takes precedence over the corresponding value from config.yml. This lets you update shop details, upload limits, and theme colors through direct SQL queries without touching the file system or restarting the server.

Settings table schema

The settings table is created automatically on first startup. Its structure is intentionally simple: a plain key/value store where each row holds one named setting.
CREATE TABLE IF NOT EXISTS settings (
  setting_key VARCHAR(100) PRIMARY KEY,
  setting_value TEXT
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
Default rows are seeded from config.yml on startup using INSERT IGNORE, so they are only written once and are safe to modify afterward.

Available setting keys

The following keys are recognized by apply_db_settings() in server/app.py. Any key not in this list is silently ignored.
KeyTypeDescription
shop_namestringOverrides shop.name from config.yml. Displayed as the page title and home page heading.
shop_addressstringOverrides shop.address from config.yml. Shown as the eyebrow/subtitle on the home page.
shop_phonestringOverrides shop.phone from config.yml. Shown in the shop info section.
max_upload_mbinteger stringOverrides shop.max_upload_mb. Controls the per-file upload size limit enforced during order submission. Store as a quoted integer (e.g. '25').
currency_symbolstringCurrency prefix displayed next to prices throughout the customer UI (default: Rs).
theme_accenthex color stringOverrides theme.accent from config.yml. Sets the primary action color used on buttons and links.

Reading and updating settings

Use the following SQL patterns to inspect and change settings at runtime.
-- View all current settings
SELECT * FROM settings;

-- Update shop name
UPDATE settings SET setting_value = 'My Print Shop' WHERE setting_key = 'shop_name';

-- Update currency symbol
UPDATE settings SET setting_value = '$' WHERE setting_key = 'currency_symbol';

-- Change theme accent color
UPDATE settings SET setting_value = '#1a73e8' WHERE setting_key = 'theme_accent';
If a key does not yet exist in the table (for example, theme_accent is not seeded by default), insert it:
INSERT INTO settings (setting_key, setting_value)
VALUES ('theme_accent', '#1a73e8');

Pricing table

Pricing is stored in its own pricing table, separate from settings. The server loads active pricing via load_db_pricing() using the following query:
SELECT paper_size, color_mode, print_style, price_per_page
FROM pricing
WHERE deleted_at IS NULL
ORDER BY paper_size, color_mode, print_style;

Soft-delete pattern

Pricing rows are never hard-deleted. Setting deleted_at to a non-null timestamp marks a row as inactive — it will no longer appear in the pricing lookup or be presented to customers. Rows where deleted_at IS NULL are considered active.

Managing pricing rows

-- Add a new pricing combination
INSERT INTO pricing (paper_size, color_mode, print_style, price_per_page)
VALUES ('A3', 'bw', 'single', 4.00);

-- Update an existing price
UPDATE pricing SET price_per_page = 2.50
WHERE paper_size = 'A4' AND color_mode = 'bw' AND print_style = 'single';

-- Soft-delete a pricing option (hides it from customers)
UPDATE pricing SET deleted_at = NOW()
WHERE paper_size = 'A3' AND color_mode = 'color' AND print_style = 'double';
The pricing table has a UNIQUE KEY uq_pricing (paper_size, color_mode, print_style) constraint, so each combination of paper size, color mode, and print style can only have one active row. Attempting to INSERT a duplicate will raise an error — use UPDATE to change the price for an existing combination instead. To restore a soft-deleted row, set deleted_at back to NULL:
UPDATE pricing SET deleted_at = NULL
WHERE paper_size = 'A3' AND color_mode = 'color' AND print_style = 'double';

All settings and pricing changes take effect on the very next HTTP request — no server restart is needed. The configuration is reloaded fresh on every request.

Build docs developers (and LLMs) love