Joshua Argent
HomeProjectsAboutBlogResumeContact
Joshua Argent

Joshua Argent is a Surrey based full stack developer building TypeScript and Next.js applications, including CathoScroll, and learning application security.

Navigate

  • Home
  • Projects
  • About
  • Blog
  • Resume
  • Contact

Featured

  • CathoScroll
  • Portfolio

Connect

  • Email
  • GitHub
  • LinkedIn
  • YouTube
  • Instagram
  • Facebook
  • TikTok
  • RSS Feed

© 2026 Joshua Argent. All rights reserved.

Back to Blog
writeups

Building Offline First Native Apps: Bringing CathoScroll Beyond the Browser

Taking CathoScroll beyond the browser meant solving a different engineering problem: making content and user activity available offline, then synchronising changes reliably when connectivity returns. Here is how I approached local storage, incremental updates, and native data synchronisation.

November 14, 20268 min read
Building Offline First Native Apps: Bringing CathoScroll Beyond the Browser

Most applications are built around the assumption that an internet connection is available. Data is requested from a server, displayed to the user, and updated when another request is made. This works perfectly well until the connection disappears.

As I started developing native versions of CathoScroll, I wanted the experience to be more resilient. Users should be able to open the app, browse published content, search the catalogue, and access previously stored personal data without needing to make a network request every time.

That meant moving beyond simply wrapping the existing website in a native application. I needed a local data layer, a reliable way to update it, and a synchronisation system that could handle interrupted connections without losing user activity.

The result is an offline capable architecture shared by the Android and Electron desktop applications, with Supabase remaining the online source of truth.

Moving beyond the browser

The website and native applications have different requirements. The website remains server rendered and relies on Supabase for its content and account operations. Native applications, however, can maintain local databases and use them as the primary source for supported offline features.

I used Capacitor for the native application layer, with Android and Electron as the initial targets. Both applications use the same exported content catalogue and account synchronisation approach.

The important architectural decision was to separate public content from private account data. They have different security requirements, update patterns, and failure cases, so treating them as one database would have made the system harder to maintain.

Building a local catalogue

The first part was making the published content available locally. Instead of depending on a remote request for every feed or topic screen, the native applications bundle a local SQLite catalogue. This allows users to browse topics, categories, and the feed without an active connection.

I also added local substring search across the saved catalogue. When connected, the application can use the website's ranked Supabase search. When offline, it can still search the content already stored on the device. The two approaches are deliberately different: local search provides availability, while online search provides the more sophisticated ranking.

Getting the initial catalogue onto a device safely was just as important as reading it. The native build process exports the published content using the public Supabase configuration. Before accepting the export, it checks the server side counts and revision. The resulting database is also checked using its checksum and SQLite integrity validation.

This prevents an incomplete or inconsistent export from silently becoming the catalogue packaged into a native build.

Keeping the catalogue up to date

Bundling a catalogue solves the initial offline problem, but it introduces another one: how do you keep local content up to date without repeatedly downloading everything?

I implemented incremental catalogue updates. Rather than replacing the entire database whenever content changes, the application can retrieve the changes since its previous update and apply them locally.

These updates are staged before being published to the active catalogue. This matters because an interrupted update should not leave the application with half of the old catalogue and half of the new one. If the update history has expired, or a reset is required, the application can fall back to a checked full snapshot.

The previous catalogue remains available until the replacement has been prepared successfully. This makes catalogue updates considerably safer when connections are unreliable.

Separating and protecting user data

Public content is only one part of the application. Users also have personal data such as bookmarks, completed topics, notes, and other activity that needs to remain available across sessions.

I implemented a separate encrypted account activity database for this information. This keeps private user data separate from the public content catalogue and gives it its own synchronisation lifecycle.

Native authentication also needed to account for platform security. Android uses secure storage backed by Android Keystore, while the Electron application uses operating system secure storage. Encryption keys are device specific and are not included in Android backups.

This is an important distinction: storing data locally is not enough. Private data needs appropriate protection, and the application must account for what happens when a device is upgraded, restored, or replaced.

Synchronising activity reliably

The more difficult problem was synchronisation. A user might complete a topic while offline, close the application, reopen it later, and expect that activity to appear in their account once they reconnect. Simply sending a request whenever an action happens is not reliable enough.

Instead, activity is stored locally and synchronised when a connection is available. The system supports bootstrapping account activity, transferring pending changes, and processing server acknowledgements.

Receipts and device sequence acknowledgements are particularly important. They allow the client to identify which changes the server has accepted and safely discard older acknowledged work. Without this, a client could repeatedly send already-processed activity or lose track of which changes still need to be uploaded.

I also had to account for rejected changes. For example, a topic might no longer be available when an offline action is eventually synchronised. That rejection is retained and reported rather than being allowed to block every subsequent activity update.

Network timeouts and interrupted requests are another part of the problem. The client needs to be able to retry later without treating an uncertain network response as proof that an operation failed permanently.

Offline does not mean every feature works offline

One important part of building this properly was being explicit about the boundaries. Offline support is not a single switch that makes every feature available without a connection.

The published catalogue, feed browsing, category browsing, and local search are available offline. Previously fetched discussions and comment counts can also be read, although that information may be incomplete or stale.

Account operations have different requirements. Signing in, signing up, and changing profile details require connectivity. Comment creation and other comment writes remain online only. Notes can be read offline after being cached, but editing them requires the latest note to have been loaded online.

Notifications have their own local behaviour too. The latest notifications and unread count are stored locally, and read state changes made offline can be queued for synchronisation later.

Being clear about these limitations is important. A reliable offline application should communicate what is available, what is waiting to synchronise, and what still requires a connection.

Building for reliability, not just connectivity

A lot of the work was not in making the happy path function. It was in handling the situations where something goes wrong: incomplete catalogue exports, expired update history, interrupted synchronisation, rejected activity, database initialisation failures, and existing data that must survive an application upgrade.

I expanded the automated tests around database initialisation, migrations, catalogue handling, and synchronisation behaviour. These are particularly important areas because a bug in local persistence can be much more damaging than a normal failed network request.

I also updated the native build and packaging workflows so that Android and Electron receive a fresh catalogue when required. This is an important distinction from the website deployment: publishing a new website version does not automatically update the interface and bundled data inside an already installed native application.

What comes next?

This work has given CathoScroll a much stronger foundation for native applications. The goal is no longer simply to make the website accessible through Android and desktop packaging. The native applications now have their own local data layer and synchronisation behaviour.

There is still more to verify, particularly around real device upgrades, reconnection behaviour, and packaged desktop releases across different operating systems. Offline systems need to be tested in the conditions they are designed to handle, not just in a development environment with a reliable connection.

The biggest lesson from this work is that offline capability is fundamentally a data consistency problem. Caching content is relatively straightforward. Making local data trustworthy, protecting private information, and reconciling changes safely when connectivity returns is where most of the engineering complexity lies.

CathoScroll is continuing to evolve, and this offline architecture is an important step towards making its native applications more reliable and independent of a constant internet connection.

The project is available on GitHub.

#typescript#react#capacitor#sqlite#supabase#offline-first#electron#android

Related Posts

writeups

Building CathoScroll

How an idea I had one evening grew into a Catholic learning platform with profiles, comments, bookmarks, and progress tracking.

Nov 2, 2026 · 4 min read