# Feasibility and complexity assessment > **Status:** MVP (v0.1.0) **implemented** — Rust + egui, USB-serial printing, 20 unit tests. This document retains the original feasibility analysis; see [ARCHITECTURE.md](ARCHITECTURE.md) for what is built today. ## Executive summary | Question | Answer | |----------|--------| | Is it feasible? | **Yes** — all required capabilities exist in mature libraries or documented protocols | | Overall complexity | **Medium–high** for a complete v1; **medium** if Bluetooth is deferred | | Biggest risk | Cross-platform raw printer I/O (USB class, serial, Bluetooth SPP) | | Recommended MVP scope | USB-serial printers first (**done**); USB-printer-class and Bluetooth later | A focused MVP is realistic for one developer in roughly **6–10 weeks**. A polished v1 with broad printer compatibility is closer to **3–4 months**. --- ## Requirements breakdown ### 1. Cross-platform desktop app (Windows + Linux) | Aspect | Feasibility | Complexity | |--------|-------------|------------| | Single codebase, native binaries | High | Low–medium | | Packaged installers (.msi/.exe, .deb/AppImage) | High | Medium | Modern cross-platform desktop frameworks (Tauri, egui, Avalonia, Qt) all support Windows and Linux. Packaging is routine but needs CI and per-OS testing. ### 2. Markdown-like document syntax + live preview | Aspect | Feasibility | Complexity | |--------|-------------|------------| | Custom lightweight DSL | High | Medium | | Live preview pane | High | Medium | | Width modes (auto-scale / fixed mm) | High | Low–medium | The DSL does not need full CommonMark — a small, POS-oriented grammar keeps the parser simple. Preview renders to a monospace layout matching printer dot width (e.g. 384 dots @ 58 mm, 576 dots @ 80 mm). Matching exact printer fonts is approximate in preview; exact fidelity is only guaranteed at print time. ### 3. Save / load `.pos` files | Aspect | Feasibility | Complexity | |--------|-------------|------------| | JSON or TOML envelope + body text | High | Low | Trivial with serde (Rust) or equivalent. Version field supports forward-compatible evolution. ### 4. Parameter tokens (`${Name}`) | Aspect | Feasibility | Complexity | |--------|-------------|------------| | Parse and collect unique names | High | Low | | Print-time modal with last-used values | High | Low | | Deduplicate same name across document | High | Low | | Use in text, barcodes, QR, images | High | Low–medium | Straightforward string substitution after validation. Image parameters might reference file paths or base64 — define clearly in DSL spec. ### 5. Barcodes, QR codes, images | Aspect | Feasibility | Complexity | |--------|-------------|------------| | Generate ESC/POS barcode commands | High | Low | | Generate ESC/POS QR commands | High | Low | | Rasterize images to printer width | High | Medium | ESC/POS barcode, QR, and raster image commands are implemented in `src/escpos.rs` (in-tree). Preview uses text placeholders for barcodes/QR/images. ### 6. Direct USB / Bluetooth printing (raw bytes, no spooler) | Aspect | Feasibility | Complexity | |--------|-------------|------------| | USB serial (CDC-ACM, CH340, FTDI) | **High** | Medium | | USB printer class (bulk OUT) | Medium | **High** | | Bluetooth Classic SPP | Medium | **High** | | Enumerate devices in UI | Medium | Medium | | Printer-specific quirks | Ongoing | **High** | This is the **primary technical risk**. #### How POS printers actually connect Most consumer thermal printers expose one of: 1. **Virtual COM port (USB-serial)** — very common; appears as `COM3` (Windows) or `/dev/ttyUSB0` / `/dev/ttyACM0` (Linux). Raw ESC/POS bytes are written to the serial port. **Easiest path.** 2. **USB printer class (interface 7)** — bulk transfers; **not implemented**. Would need `nusb` or Windows `usbprint.sys`. 3. **Bluetooth Classic SPP** — **not implemented**; deferred. 4. **Network (TCP 9100)** — common in production but **out of scope** unless added later. “No drivers” in practice means **no Windows print spooler / CUPS job** — the app opens the device directly and writes bytes. USB-serial devices often need only the generic CDC driver already present. USB-printer-class devices on Windows may still use `usbprint.sys`, which is a kernel driver but not a vendor-specific print driver. #### Compatibility reality - **MVP (done):** Epson-compatible ESC/POS over USB-serial at 9600 baud. - **Future:** USB printer class, Bluetooth SPP. Expect **per-printer testing**; some devices need init sequences, code pages, or cut commands that differ slightly. --- ## Complexity by subsystem ``` Effort (relative) Editor UI ████████░░ Medium Preview renderer ███████░░░ Medium DSL parser ██████░░░░ Medium File I/O ██░░░░░░░░ Low Parameters ███░░░░░░░ Low Barcode/QR/image █████░░░░░ Low–medium Printer discovery ███████░░░ Medium Raw print I/O █████████░ High Integration/polish ██████░░░░ Medium ``` --- ## Effort estimate (one experienced developer) | Phase | Scope | Duration | |-------|-------|----------| | **0 — Design** | Specs, DSL, file format | 1 week | | **1 — Core** | Parser, ESC/POS builder, preview, `.pos` I/O | 2–3 weeks | | **2 — UI** | Editor, preview split, settings, parameters dialog | 2 weeks | | **3 — Print MVP** | USB-serial enumeration + print | 1–2 weeks | | **4 — Hardening** | USB class, BT, edge cases, packaging | 2–4 weeks | **MVP (serial USB only):** ~6–8 weeks **Full v1 (USB + BT, packaged):** ~10–14 weeks Add 30–50% if the developer is new to Rust or ESC/POS. --- ## Risks and mitigations | Risk | Impact | Mitigation | |------|--------|------------| | Printer hardware diversity | Prints garbled or not at all | ESC/POS subset doc; test matrix; user-selectable code page | | Linux permissions (`dialout`) | Cannot open serial port | Document group membership; clear error UI | | Windows USB access | Admin / driver conflicts | Prefer serial-first; use `usbprint` where applicable | | Bluetooth pairing UX | Users cannot find printer | Defer BT; link to OS pairing instructions | | Preview ≠ print | User confusion | Label preview as approximate; same backend for print | | Image size on narrow paper | Slow print or clipped | Auto-scale to page width; warn in UI | --- ## Out of scope (current release) - Bluetooth printing - USB printer class (non-serial) - Network printers (TCP 9100) - Non-ESC/POS protocols (Star Line, ZPL) - Multi-column layout engines - Collaborative editing / cloud sync - macOS (feasible later with same stack) --- ## Recommendation **MVP delivered.** Next increments: USB printer class, baud settings, persisted parameters, hardware test matrix. Bluetooth only if explicitly needed. See [LANGUAGE-CHOICE.md](LANGUAGE-CHOICE.md) and [ARCHITECTURE.md](ARCHITECTURE.md).