Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Supabase 6 min read How-to mediumAdept

Building offline-first mobile apps with Supabase, Flutter and Brick

Brick is a Flutter data manager that keeps Supabase data in local SQLite and optional in-memory caches so apps behave the same with or without connectivity. Requests made offline are queued and retried until the device reconnects, and caching can be skipped per request for sensitive or must-be-fresh data. Setup walks through annotated Dart models with client-generated UUID keys (never auto-increment, so distributed clients avoid collisions) and build_runner code generation that produces adapters and SQLite migrations, which should still be reviewed. A single repository handles queries and upserts, and the guide also covers local reactive streams (not yet wired to Supabase realtime), associations, and a mock Supabase server for unit tests.

Assumes: Flutter and Dart basicsSupabase basicsSQLite basics

Related posts

  • Offline-first React Native Apps with Expo, WatermelonDB, and Supabase

    Supabase mediumAdept

    An offline-first React Native/Expo app can use WatermelonDB (SQLite-based, last-write-wins sync) as its local store and sync to Supabase Postgres through two RPC calls: a `push` function that applies client changesets and a `pull` function that returns all changes since the last sync timestamp. The walkthrough covers adding simdjson via expo-build-properties, defining WatermelonDB models, and writing the PL/pgSQL push/pull and epoch-conversion functions, with soft deletes tracked via deleted_at/last_modified_at. The main tradeoff is friction when changing the data model, since the Postgres schema, the local WatermelonDB schema and the sync functions must all be kept in step. That makes the approach best suited to apps with a stable schema where snappy interactions matter.

  • Mobile app prototyping with Quasar and SQLite

    Turso mediumAdept

    A recipe-book mobile prototype built with the Vue-based Quasar framework, backed by a local SQLite file accessed through a small Express server using the libSQL JavaScript client. Because libSQL is used for data access, the same server code can later point at Turso for production without source changes. The walkthrough covers creating the schema in the SQLite shell, writing GET/POST/DELETE routes (including json_group_array aggregation and batched inserts), and wiring Quasar pages to a Pinia store. A local SQLite file keeps development fully offline and makes the database easy to share or reuse in tests.

  • Supabase Flutter SDK 1.0 Developer Preview

    Supabase mediumAdept

    Supabase Flutter SDK 1.0 enters developer preview with a focus on developer experience. Auth state persistence and deep link handling now happen automatically on initialization, replacing the removed SupabaseAuthState and SupabaseAuthRequiredState classes. Errors are now thrown instead of returned, since Dart lacks destructuring, and `.execute()` is deprecated so queries resolve directly to data. Deep links now work on macOS and Windows through app_links, Multiplayer realtime support is planned for the stable release, and a new Supabase Auth UI package provides prebuilt email, magic link and social login widgets.

  • Flutter Tutorial: building a Flutter chat app

    Supabase mediumAdept

    A real-time single-room chat app can be built with Flutter on the frontend and Supabase as the entire backend, using the supabase_flutter SDK instead of a custom API. The walkthrough creates profiles and messages tables in Postgres with username validation constraints, adds the messages table to the supabase_realtime publication for live updates, initializes the Supabase client, routes users via a splash page based on auth session, and defines Dart data models plus a registration page. Authentication and row-level security are deferred to a second part.

  • Building Local-First Apps: The Complete Guide to Offline-First Database Sync

    Turso mediumAdept

    Turso Sync brings local-first behaviour to SQLite-based apps. Local changes are captured via change data capture and pushed as logical row-level mutations, while remote changes are pulled as physical pages so replicas converge byte-for-byte. Turso's benchmarks report up to 312x faster syncs and roughly 18x less traffic than the older Embedded Replicas approach. The guide covers TypeScript setup with background push/pull loops, Last-Push-Wins conflict resolution and a transform hook for custom merges such as turning sets into increments, scoped auth tokens and JWKS, sync-aware WAL checkpointing, and experimental partial sync. It also notes that there is no CRDT or peer-to-peer support, which makes the approach a poor fit for real-time collaborative document editing.

The quest for software engineering knowledge.

Look:
Layout: