Skip to content

Repository files navigation

Noorani Hotel POS

Offline-first point-of-sale for Noorani Hotel — a Windows desktop app for taking orders, printing kitchen tickets, billing, and tracking sales per shift. Built with Svelte 5 + TypeScript + Tailwind (Vite) and wrapped by Tauri into a native app that stores data in a crash-safe local file + SQLite and prints to an 80 mm thermal printer. Runs fully offline — no server, no internet.

Menu items and receipts support Urdu (Naskh) alongside English.

Features

  • Tables — floor view with live status (available / ordered / occupied / billing / reserved).
  • Order + KOT — build an order from the Urdu/English menu and print a kitchen ticket.
  • Billing — finalize with subtotal, discount, and payment method; print an 80 mm receipt.
  • Records — searchable, date-filtered bill history with one-click reprint (bill or KOT).
  • Shift management — open/close shifts with opening cash and an end-of-shift report.
  • Dashboard — at-a-glance sales, and expenses tracking.
  • Backup & restore — full data export/import from Settings.

Architecture

Single-device desktop app. The Svelte UI drives a central store; a persistence adapter switches between the Tauri Rust backend (native) and localStorage (browser dev). Money records (bills + expenses) live in a crash-safe SQLite file; receipts render to a hidden print area and go straight to the thermal printer.

v1 system architecture

Order-to-bill flow

order to bill flow

Project structure

src/
  pages/        Login, Tables, Order, Records, Dashboard, Settings, ShiftReport
  lib/
    store.ts        Svelte stores (appState, session) + persist()
    persistence.ts  native (Tauri) ↔ localStorage adapter
    records.ts      pure, testable bill filtering
    receipts.ts     bill + KOT HTML builders
    print.ts        thermal print pipeline
    DatePicker.svelte  reusable calendar input
    types.ts        domain model
src-tauri/        Rust backend: state file + pos.db SQLite commands
docs/             SPEC + architecture diagrams (source .mmd + .svg/.png/.excalidraw)

Develop

npm install
npm run dev        # Vite dev server in the browser → http://localhost:1420
npm run check      # svelte-check type-check
npm run test       # Vitest unit tests
npm run tauri dev  # native desktop dev window (Vite + Tauri)

Build the Windows app

Prerequisites on the Windows build machine:

  • Rust
  • Node.js (for the Tauri CLI)
  • WebView2 runtime — preinstalled on Windows 10/11; the installer bundles it otherwise
  • Microsoft C++ Build Tools (Desktop development with C++)
npm run tauri build   # builds the Svelte app, then the installer

Output: an .msi and an .exe (NSIS) installer under src-tauri/target/release/bundle/. Ship either — the user double-clicks and installs.

Cross-compiling from Linux is supported and set up (cargo-xwin + NSIS + osslsigncode) and produces a signed NSIS installer — see docs/windows-build.md for the one-command build. (MSI/WiX still needs a native Windows host; the Linux cross-build ships NSIS.)

Data & backups

  • Live data: %APPDATA%\com.noorani.pos\state.json (atomic writes — safe across power cuts) plus pos.db for bills/expenses.
  • Settings → Backup & Restore → Back Up Now saves a full copy anywhere you pick. Do this after each shift close. Restore… replaces all data from a backup file.

v2 — multi-device cloud (feature-complete)

Run the POS from the Windows desktop and an Android app, backed by a cloud server as the shared source of truth. Each device stays offline-capable and syncs when connected; the counter PC keeps hosting the thermal printer. v2 cloud + Android architecture

Built and working end-to-end:

  • Cloud backendDjango/DRF + Postgres in server/, env-pluggable via DATABASE_URL (local Postgres → managed cloud, no code change). Server-owned gapless order/bill numbers, immutable bills, and real auth with admin/operator roles.
  • Multi-device seam — a GET /state + per-action write path selected by VITE_API_URL, orthogonal to the native/browser path so the fully-offline desktop build is untouched. Writes are serialized per device, so dependent actions (order → KOT → bill) never race across terminals.
  • Android app — Tauri v2 Android build; the universal APK builds and installs.
  • One codebase — the same Svelte UI runs cloud-backed or fully local.

See docs/v2-backend.md for the full reference and server/README.md to run it.

Final polish before general rollout: a durable offline outbox (queue writes locally and replay on reconnect) and centralized print routing (all devices → the counter-PC print host).

Diagrams are editable — the .mmd sources and .excalidraw scenes live in docs/diagrams/.

About

Offline Windows point-of-sale for a local hotel i.e Noorani Hotel, Gambat

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages