LIBRARY drew the strip from the catalogue and the catalogue from a `getAll` of the `photos` store: every row and every thumbnail in it, read back on a clock to learn what a scan of its own had just stored. On a catalogue of 150,000 frames one read measured 2036ms and sixty megabytes of rows; under a scan in the same window, with four lanes of RAW bytes and a LibRaw of a quarter of a gigabyte beside it, that read is the read that gives way — and a read that gave way answered `[]`, so the screen threw away the frames it was showing. That is the strip that loses its count and its thumbnails under a scan, and the frames the reader cannot pick while the roll is being read. The reading now hands its frames over as it stores them. `scanFolder` keeps the rows it met for the first time in the batch they landed in, and `flush` gives them to `watchRows` the moment the transaction closes; the screen appends them, so the strip is the roll arriving and not the roll found again. A batch is fifty frames, so this is fifty rows over a callback where it used to be a hundred and fifty thousand rows over IndexedDB. A frame the catalogue already held is not handed over — it is on the strip already, and it takes its place again when the reading is through. Which is why the read on the clock is now done for none of them. It stands for the reading another window holds, whose frames never come through this one: a reading of this window's hands over every frame it stores, and the counter that says so is what decides. The scan's own tail read went with it — the screen watching a reading reads the catalogue back once the reading ends, and that is the whole catalogue read once per scan instead of twice at the end of every one. `readPhotos` answers null where `listPhotos` answered an empty list. A read that came back with nothing is a read that failed, not a catalogue that emptied, and the frames it would have cleared are the frames the reader is working their way through. The strip keeps them. And the strip starts on what the last screen read. STUDIO and LIBRARY are two screens of one page, not two pages: the reader who goes to develop a frame and comes back was reading a hundred thousand rows again to see the strip they had just left. The folder is walked on the way in only when the last reading of it never finished. A reading that reaches its end clears its position, so "is there a position" is "was this roll cut off", answered by one small file opened and shut. Before this, every visit to the library paid a walk of the folder the reader was opening — a hundred thousand names off the disk, on the folder they had just asked to browse — and the reader who came to choose a frame paid for a scan they never asked for. A folder the reader wants looked at again says so itself, from the menu on its row. Checked on the running bundle: a 3000-frame scan reads the catalogue back twice, one of the two the screen coming up on a catalogue that is still empty — against three for the commit before this one and thirteen for the one before that, and nothing read back for the whole of the scan. The peak heap is 116-138MB with no long tasks, and 3001 rows went in. A reading stopped at 59 of 4000 still leaves `walk/ROLL.json` at 113,626 characters with no local storage key beside it, and the visit after a reload carries on with the strip filling under it — 162 rows, 312, 463, 612, 762, 913, 1062, 1212 as the scan went on. LIBRARY on 150,000 frames shows no "No folder yet" at any point and settles on "150000 photos" in 4.9s against the 8.1s it took. The wall, the strip, the grid, the deep link and the phone's recipes all pass their checks.
RecipesCam
RecipesCam is a camera and photo-editing app built around recipes — reusable
looks that carry a film simulation plus a full set of adjustments. You shoot or
open a photo, dial in a look, and keep it as a recipe you can apply again, share
as a .recipe file, or save to your account.
It ships twice from one repository: a React Native (Expo) app for iOS and
Android, and a self-contained web build under docker/ that runs the same
render pipeline in the browser.
What it does
- Shoot with a recipe applied. Live viewfinder, GPS-tagged captures, and the recipe baked into the saved file.
- Film simulations. Built-in looks — PROVIPES, VELVIPES, CLASSIC CHRIPES, CLASSIC NEGIPES, ASTIPES, ETERNIPES, ACRIPES, B&W HIGH CONTRAST and the LC STREETLIFE pair — each with its own grain and tone curve.
- The full adjustment set. Exposure, contrast, highlights and shadows, saturation, colour temperature, clarity, grain, and an HSL mixer with a colour picker that samples straight off the photo.
- Geometry. Crop to a fixed ratio or free-form, quarter turns, and a straighten ruler, plus printed frames (classic border, retro instant, wall frame portrait/landscape).
- Finishing. Watermark and GPS stamp, EXIF carried through the export, JPEG written with a proper 300 DPI JFIF header.
- On-device upscaling. A Real-ESRGAN pass runs locally when an export asks for more pixels than the source has — no server sees the photo.
- Recipes. Save, favourite, export and import
.recipefiles; the web build keeps them in your account, the phone build also keeps them on device.
The two builds
| Build | Where | Stack |
|---|---|---|
| iOS / Android | repo root | Expo + React Native, @shopify/react-native-skia for the render pipeline, NativeWind for styling |
| Web | docker/ |
Vite + React, CanvasKit (canvaskit-wasm) for the same pipeline, Fastify + SQLite API for accounts and recipes |
The render engine is shared by design: the web build compiles the app's own
src/utils/* and type definitions unchanged, with @shopify/react-native-skia
aliased to a CanvasKit shim (docker/frontend/src/engine/skiaShim.ts). A look
looks the same on both because it is the same code.
Running the web build
cd docker
cp .env.example .env
docker compose up -d --build
# → http://localhost:8090
Photos never leave the browser: grading, framing, watermarking and JPEG
encoding all run in the visitor's tab; the API only stores accounts and recipe
JSON. See docker/README.md for the layout and the proxy setup.
Running the app
npm install
npx expo start # Expo Go / dev client
npx expo run:android # or run:ios for a native build
Repository layout
App.tsx, src/ the Expo app: screens, tool rail, viewfinder, shaders
docker/ the web build (frontend + API + compose file)
frontend/shared/ vendored copies of the app's types and utils
frontend/src/engine/ CanvasKit shim, export engine, super-resolution
docs/ privacy policy
THIRD_PARTY_NOTICES.md licences of the bundled fonts, models and libraries
Licence
See LICENSE and THIRD_PARTY_NOTICES.md.