TaskFlow Mobile: A React Native Client With an Offline Write Queue

An Android app for my TaskFlow Kanban API. It works with no server in demo mode, or against a real Laravel instance, and it keeps working when the connection drops: boards are cached and task changes made offline are queued and replayed in order when the server is back.

Open sourceReact Native
Illustration of the TaskFlow Mobile project
66
automated tests, all passing
5
phases, each a pull request with CI
12/12
shared API contract checks pass against the real Laravel API
0
backend needed to try it (demo mode)
TaskFlow Mobile project list in demo mode
Projects in demo mode
Kanban board with To do, In progress and Done tabs and task cards
Board: tabs, priority, due dates, Up, Down and Move to
Task form with title, description, priority, column and due date
Task form
Offline banner with two changes waiting to sync and Waiting to sync badges on cards
Offline: banner and Waiting to sync badges

The challenge

TaskFlow already had a tested Laravel API and a React web app. I wanted to prove I could add a native-feeling mobile client on top of the same contract: reachable by anyone with no server, honest about connectivity, and tested against the real API rather than only against mocks.

The interesting part was the unglamorous middle: what happens to a change made on a train with no signal, and what the app does when the server later disagrees.

How I approached it

  1. 01

    One interface, three backends

    Screens only see an Api interface. A demo backend inside the app, an HTTP adapter and an offline wrapper all implement it, so the same contract suite proves each of them and no screen knows which one it uses.

  2. 02

    Proved against the real API in CI

    A CI job starts Laravel on SQLite and runs the shared contract through the mobile HTTP adapter, so drift between the API and the app fails the build.

  3. 03

    Offline as a decorator

    Reads fall back to a cache. Task create, update, move and delete are applied locally, queued and replayed in order. A change the server rejects is dropped (the server wins); a lost connection or a 5xx keeps it queued.

  4. 04

    Reordering without drag and drop

    Up, Down and a Move to dialog with 44 dp targets and screen-reader labels. Moves are optimistic and roll back from a snapshot if the server refuses.

  5. 05

    Secure by default

    The bearer token lives in the Android keystore through expo-secure-store. Plain HTTP is allowed only so a local server works, and the Connect screen warns when the address is not HTTPS.

  6. 06

    Delivered in reviewed phases

    Five phases, each a branch and pull request with a plan, tests and CI, plus a decisions log that records why each choice was made.

Deliberate trade-offs

  • Offline covers task changes only. Project changes and sign in need the network.
  • Conflicts are last-write-wins. There is no merge screen.
  • Replaying the queue after reconnecting is covered by unit tests but I did not watch it against a live server on a device.
  • Android only so far, and reordering is button based rather than drag and drop.

What I built

  • Planned the app in phases with a written scope, decisions log and risks before writing code.
  • Built session handling, server URL validation with a connection test, sign in and register, and project and task screens.
  • Wrote the HTTP adapter, the demo backend and the offline cache and write queue, with 66 unit tests.
  • Added a CI job that runs the contract suite against the real Laravel API.
  • Fixed a release-only bug (Android blocks plain HTTP in built apps) and a queue bug (a server error must not discard queued changes) before publishing.
  • Built, signed and published an Android APK with a published checksum.
Download the signed Android APK from the GitHub release (screenshots show sample data from the release build in an emulator). Demo mode needs no server.

What this project demonstrates

  • Shipping a second client for an existing API with a shared, tested contract
  • Offline-first design with a queue, ordering and conflict rules
  • React Native, Expo and strict TypeScript
  • Testing against the real backend in CI, not only mocks
  • Finding and fixing bugs that only appear in release builds

Related case studies

React Native / Expo / TypeScript / SQLiteOpen Source

Jamaat Tracker: An Offline-First React Native App for Daily Prayers

A private, offline-first mobile app I built to track the five daily prayers, with a focus on praying in congregation. It keeps a personal record, shows streaks and statistics, fetches prayer times for your city and reminds you at prayer time. It has no account and no server: everything stays on the phone.

Have a project like this in mind?

Tell me what you're building. I'll reply by email with questions or a suggested approach.