Offline-First Web Apps: Selling Without Internet With a PWA
What a PWA is and how to keep selling without internet: offline queues, sync, conflict handling, Add to Home Screen, safe updates and when to ship a store app.
A customer is waiting at the till, the basket is ready, and just as you are about to take payment the internet drops. A spinning loader on the screen, a growing queue behind. Most web-based point-of-sale and field apps stop at this moment, because every action has to reach the server.
In this article we look at offline-first web apps: software that keeps working without an internet connection. What is a PWA, how can you sell safely without internet, how is data synced when the connection returns, and when do you need a store app? The examples come from our own projects.
Why a dropped connection is not a small problem
An outage usually lasts a few minutes, but its impact is bigger than those minutes:
- Lost sales: Customers do not like to wait. Every minute at the till can mean a basket left unpaid.
- Back to paper: Staff write sales in a notebook and type them in later. That costs time and invites mistakes.
- Lost data in the field: A team working in a basement, a warehouse or out of town cannot fill in a form, or the form they filled in is lost before it is sent.
- Lost trust: An employee who has lived through "the system is down" once stops trusting the software and starts keeping parallel records.
Mobile data, shop Wi-Fi or a router: whatever you use, an outage is not a possibility but a matter of time. The right question is not "will the internet go down?" but "when it does, does the work stop?"
What is a PWA?
A PWA (Progressive Web App) is a web application that runs in the browser but can behave like an app. Three things stand out:
- Installable: It is added to the home screen of a phone or tablet and opens with its own icon. On Android, use the Chrome menu and choose "Install app" or "Add to Home screen"; on iPhone, use Safari's Share menu and choose "Add to Home Screen".
- Opens offline: A background component called a service worker caches the app shell (screens, code, icons) on the device, so the app opens even without internet.
- One codebase: The same app runs in a desktop browser, on phones and on tablets. You do not need separate iOS and Android apps.
But note: being a PWA does not mean an app can do work offline. Opening the shell is the easy part. The real question is where an action taken without internet is stored, and how it later reaches the server safely.
How offline queueing and sync work
Teknoself is the business panel we built for a self-service car wash and its shop. Its sales screen keeps working without internet. Conceptually, it works like this:
- Write to the device first: Every sale is first written to a persistent queue on the device and then sent to the server. This rule applies when online too, so there is a single code path and fewer "works online, breaks offline" surprises.
- Survives restarts: The queue stays in place even if the tab or the device is closed and reopened. If a staff member tries to log out with pending sales, they get a warning, and the queue is not deleted.
- Visible status: The top bar shows "Online / Offline / Syncing" together with the number of pending sales. The cashier can list their pending sales.
- Automatic sending: When the connection returns, the queue is sent in order. On errors it retries at increasing intervals, and there is also a manual "Sync now" button.
- Temporary number: The receipt for an offline sale shows a temporary number and a note that it will be recorded once the connection is back. The permanent sale number is always issued by the server.
A short technical section: how duplicates are prevented
The sneakiest sync bug is the duplicate record. If the connection drops mid-upload, the device cannot know whether the server received the sale, so it tries again. The answer is an idempotent endpoint, one that gives the same result no matter how many times it is called:
- The device generates a unique ID (GUID) for every sale.
- If a sale with the same ID arrives a second time, the server does not create a new one; it returns the first result.
- In a batch upload each record gets its own result; one failure does not affect the others.
Pending sales and the product catalog are stored in IndexedDB, the browser's persistent database. The product list is refreshed regularly while online, and the time of the last refresh is shown on the sales screen.
Conflicts: the world does not stop while you are offline
While a device is offline, life goes on at the server. A price can change, another till can sell the same last item. There are two bad options here: reject the sale, or accept it silently. In Teknoself we chose record and flag:
| Situation | What happens | |---|---| | Price changed while offline | The sale is recorded at the price the customer paid; the mismatch is flagged | | Not enough stock | The sale is not rejected; stock goes negative and is flagged, then corrected with a stock count | | Product deactivated | The sale is still recorded and flagged | | Device clock far off | The record is accepted and the time is flagged as suspect |
Flagged records appear to the manager as "sync warnings"; the manager reviews them and marks them as seen. The logic is simple: the customer paid and took the goods. The software's job is not to lose that fact but to make the inconsistency visible.
Not every screen needs to work offline either. Screens such as returns, stock editing and reports need a connection; without internet they show a clear "No connection" state instead of throwing errors. Deciding up front, by business rule, what must work offline is one of the most important steps of the project.
Security: offline does not mean unprotected
How is a login verified without internet? In Teknoself the device stores only a salted PIN hash for staff who have previously logged in online on that same device; the PIN itself is never stored. Repeated wrong attempts trigger a local lock, and offline sessions have a time limit. Sensitive data such as card details is not kept on the device.
One more note for till software: the receipt Teknoself shows on screen is for information only; the fiscal receipt comes from the certified cash register. When you design offline sales, think about your fiscal process with this distinction in mind.
Updates should not interrupt work
A big advantage of web apps is that updates reach everyone quickly. But a screen that reloads itself in the middle of a sale is unacceptable. In Teknoself, when a new version is ready a "New version ready" notice appears at the top; the app does not switch versions by itself in the middle of a sale. The cache is also refreshed safely, so an old version does not get stuck on the device.
PWA or store app?
A PWA is enough for most internal uses such as tills, warehouses and field forms. In some cases, though, the app needs to be on the App Store and Google Play:
- Your users are used to finding apps in the store,
- You need device-specific capabilities such as home-screen widgets,
- Your company's device management requires distribution through the store.
You do not have to rewrite everything at this point. With tools such as Capacitor, the same web codebase can be packaged as an Android and iOS app. For Teknoself we built Android and iOS shells from the same React codebase with Capacitor. The store version brings differences, such as network requests going through the device's own layer and a share sheet instead of file downloads, and these need to be planned from the start.
If most of the content is static, a native offline-first architecture is also an option. In our Nur app, the Qur'an text and translation live in a SQLite database bundled with the app; it works fully without internet, and the server is only used for accounts and reading-progress (khatm) sync.
Questions to ask before you decide
- Which actions must continue without internet, and which can wait?
- When an offline action conflicts with server data, who decides, and how?
- If a device is lost or stolen, what data will be on it?
- Will the app be installed from the browser or distributed through the stores?
- How long can an outage last, and should the session stay valid during that time?
The answers directly shape the scope and the cost of the project.
Conclusion
Working offline is not a feature you bolt on later; it is an architectural decision made at the start. Done right, the till keeps selling when the connection drops, the field team loses no data, and the manager can see what was synced and how.
If you are considering an app for your till, shop or field team that keeps working without internet, take a look at our services or send us a short note about what you need. We will work out together which actions need to work offline.