Listoca

Native app

How the Expo app is put together.

Providers

apps/native/src/app/_layout.tsx wraps the app in this order: i18n, theme, SessionProvider (who is signed in, from the secure store), DataProvider (the local database and sync), analytics, then the screens.

The DataProvider opens the database before any network call; the native splash screen stays only until then. The animated splash (src/modules/launch/splash.tsx) then takes over: its first frame is the native one (the icon alone, 112pt, centered; app.json), the icon rises above the app's name, and after about two seconds, or a tap, it fades into the first screen. It plays once per launch. The DataProvider follows the session: on sign-in it connects (lists shared by others arrive); on sign-out it keeps the account's own lists on the device or removes them, as the user chose. useFollowPlan() moves the device's lists into sync once the Sync plan is confirmed, and pauses sync when it ends (Lists and tasks).

Screens

One stack with Home at its root; sheets for forms and the task.

PathScreen
indexHome: greeting, search, smart lists, lists
introfour slides on first launch
sign-in, auth/callbackApple, Google, the development email link
list/new, list/[id]/edit, list/[id]/share, task/[id]sheets
list/[id], smart/[view]a list's tasks, a smart view's
join/[token]accepting an invitation
choose-plan, first-syncwhat Sync is; the first sync
settings/*settings, account, plan, sync, delete account

Home sends a new device to the intro once, and a signed-in device to the first sync until its profile arrives.

The look

The screens follow the design project's Lists Mobile v2: warm paper, white cards with hairlines between rows, one color per list. The list screen sits on its list's tint, with the composer floating over the bottom. Icons are the design's own line drawings (components/glyph.tsx, drawn with react-native-svg, most of them Lucide's paths; THIRD_PARTY_NOTICES.md); a row's option shows as a 30pt tile (IconTile) in its color while it is on. The colors are packages/lists/src/palette.ts, whose test measures every text and background pair, so a few grays sit a step darker than the design's to reach 4.5:1. A list picks one of twelve colors, all drawn with the same lightness. Most share one chroma; sage, clay and slate keep less of it. The test keeps every two at least as far apart as the design's rose and terracotta, which leaves little room for more. A new color needs its key in the lists_color_check constraint (a migration) and a name in list.colors. The shared pieces (IconTile, Toggle, the task row, the composer's chips) are on /dev/components in a development build.

Sign-in

Email and password, a 6-digit email code, Apple and Google. Apple and Google use the system's sign-in sheet and hand the id token to Supabase (signInWithIdToken), so there is no browser round trip. Google's button shows once EXPO_PUBLIC_GOOGLE_WEB_CLIENT_ID is set. Offline, a signed-in user stays signed in; only a refresh the server rejects signs them out.

Building

bun run ios        # or: bun run android

A local Release build without SENTRY_AUTH_TOKEN needs SENTRY_DISABLE_AUTO_UPLOAD=true.

On EAS

Builds for testers and the stores are made on EAS, one command per stage (from the repo root, scripts/eas.ts; needs the EAS CLI, bun add -g eas-cli, and eas init once):

StageCommandWhat
developmentbun run eas:build:developmenta development build for registered devices, JS from Metro
previewbun run eas:build:previewan internal build for testers, against the preview server
productionbun run eas:build:productiona store build; EAS counts the build number up

Without a platform, a build is made for iOS and Android; bun run eas:build:preview ios makes one. Flags after it go to eas build as they are (--local, --auto-submit).

A stage has the same name three times in apps/native/eas.json: the build profile, its EAS environment (whose variables, such as EXPO_PUBLIC_SUPABASE_URL, go into the build) and its update channel. Set each environment's variables on expo.dev or with eas env:create; The app on EAS lists them per stage.

Updates without a store release

Changes to the app's JavaScript, styles and images reach installed apps through EAS Update (expo-updates). The app looks for an update when it starts and when it comes back to the foreground (at most every ten minutes), and downloads it in the background. The update runs from the next start, or when the user comes back after five minutes or more away: the app then restarts into it, which looks like the app opening. A return through a link never restarts the app, so the link's screen opens. The rules are in apps/native/src/lib/app-updates.ts, the two times in src/config.ts (updates).

A build gets the updates of its channel and its runtime version:

  • The channel is the build profile's in apps/native/eas.json: production, preview or development.
  • The runtime version is the app's version in app.json (runtimeVersion: { policy: "appVersion" }).

Raise version whenever the native side changes: a library with native code added or upgraded, an Expo SDK upgrade, a change to app.json or a config plugin. That change ships as a store build. Under the old version, installed apps would get JavaScript that calls native code they don't have.

The update URL is made from extra.eas.projectId (apps/native/app.config.ts), so updates are on in builds made after eas init. A build without a project id has them off.

Publish from the repo root:

bun run eas:update:preview "Fix the task sheet's note field"
bun run eas:update:production "Fix the task sheet's note field"

Each publishes to the stage's channel with the stage's EAS environment, the one its builds were made with. Without a message, the update takes the last commit's subject. Development builds ignore updates, so there is no development update. The bundle is built on your machine, so a variable the EAS environment doesn't set takes its value from your local .env.

To try an update, install a preview build, publish to preview, then close the app and open it twice. Settings shows the version and, once an update runs, the start of its id. Development builds load their JavaScript from Metro and ignore updates. eas update:rollback takes an update back.

Not every user gets an update on the same day, so the server still has to work for the versions before it (Changes installed apps survive).

With Sentry, upload the update's source maps after publishing (Monitoring):

bunx sentry-expo-upload-sourcemaps dist

On this page