// DaveBuilds

Rota

A shift-scheduling mobile app for small teams like cafés, clinics and shops, with role-based permissions, shift swaps, offline schedules and server-prorated per-seat billing.

Live APIAndroid buildAI-assisted
Android build Code and docs Demo video
Rota mobile app Team screen for Dave's Cafe listing three active members with Owner and Staff roles
Team roster showing Owner and Staff roles

Overview

Rota is a shift-scheduling mobile app for small teams like cafés, clinics and shops. An owner publishes shifts, staff see their week, request swaps and get notified, and the team pays a monthly per-seat subscription that our own server prorates.

I designed it in Figma and built it end to end in about four weeks as my graduation project for the Dev and Design HQ Product Design and Engineering Bootcamp, working with AI coding agents driven by one shared rules file and reviewing every slice before it shipped.

RoleProduct designer and developer (design, mobile app, API, infrastructure, docs)
TimelineOctober to November 2026, about 4 weeks
AppReact Native + Expo, TypeScript, TanStack Query
ServerNode.js + Express, Prisma, Zod, BullMQ
DataPostgreSQL on two Neon shards with read replicas, Valkey
ServicesStripe (test mode), Resend, Expo push, Sentry, Northflank

Problem & constraints

Small teams still run their week from a group chat and a spreadsheet, and the cracks show at the edges: a swap agreed in a message that the manager never saw, a new hire who joins without the latest schedule, a shift changed the night before that nobody noticed.

Rota's job is to make the schedule the single place the truth lives, for three roles:

  • Owner: runs the team and its billing, with full control.
  • Manager: creates and edits shifts, approves swaps.
  • Staff: sees their own week, requests swaps, sets their own notification preferences.

The hard part is not the screens. It is making sure each person only ever sees and changes what their role allows, that money is always right, and that nothing silently goes missing when a phone is offline or a server restarts.

Before writing any code, I wrote six hard rules every agent and every pull request had to follow:

  1. Free infrastructure only. Every service on a free plan, with spending blocked rather than just alerted.
  2. No money logic in the app. The phone never calculates a price, a credit or a total. Every figure it shows comes from the server.
  3. Every permission decision on the server. Never trust a user, role, team or amount sent by the client.
  4. Money as whole cents, never floating point, and billing records that can never be edited, only added to.
  5. The database first, then the queue. Any work that must happen (emails, renewals, payment processing) is recorded in Postgres before it is queued, so a lost queue job can always be recovered.
  6. Stripe in test mode only. This integration uses Stripe test mode only. Live-payment eligibility has not been verified.

Key decisions

Each of these is recorded as a decision record in the repo, with the options I rejected and the trade-off I accepted. The three hardest were proration, Postgres before the queue, and sharding with read-your-own-writes: each one had a wrong answer that would have looked correct in testing.

The app only ever talks to the API. Stripe's webhooks land at the API too, and the slow work (payment processing, emails, push) runs on the worker through the queue.

  1. We calculate proration, not Stripe. Teams change plans and seats mid-month, so a charge has to be prorated. Instead of handing that to Stripe Subscriptions, our server holds the plan, seats and billing period, works out the exact amount in whole cents, and Stripe only collects what we already calculated. The trade-off is more code to own, in exchange for billing logic I can test case by case and explain line by line.
  2. Only a verified webhook decides a payment. The app never decides that a payment succeeded. Stripe's signed webhook is checked against the raw request, recorded once in Postgres (duplicates are ignored by event ID), and only then processed by a background job. Billing records are append-only: the database itself refuses edits and deletes, so a correction is always a new row.
  3. Postgres is the source of truth, the queue is just delivery. Background work runs on BullMQ, but every job starts as a row in Postgres. A sweep inside the worker checks for unfinished rows and puts any missing jobs back in the queue. I proved this on the live deploy by deleting a job from the queue and watching the sweep restore it without a restart.
  4. Two database shards, read replicas, and read-your-own-writes. Teams are split across two Postgres databases by team ID. Three read-heavy screens (calendar, activity feed, roster) read from replicas, while every login, permission and billing check stays on the primary, because an old answer there could let a removed user back in. After someone writes, their own reads go to the primary for 5 seconds so they never see stale data.
  5. Setting up credentials after a security warning. Days before I deployed, Northflank emailed customers to say that secrets stored on the platform should be rotated. I hadn't created mine yet, so rather than rotating after the fact I set them up assuming the platform could be compromised: every deployed key is new and used nowhere else, each carries only the permissions its code needs (the Stripe key has four, the email key can only send, the queue user cannot wipe or reconfigure the database), and all of them get rotated again after submission. I stayed with the host. You cannot control a provider's security; you can control how much a breach would cost you.

Design & UX

I designed the screens in Figma first, then built against them, so most UX decisions were made where they are cheapest to change. A few that shaped how Rota feels:

  • Push notifications that say nothing private. A lock screen reads "You have a new shift", never the time, place or person. Tapping it, even with the app fully closed, opens the exact shift.
  • Invite links that open the app, not a web page. A new staff member taps the email link and lands on the join screen in Rota (Android App Links), with the team and role already shown.
  • Offline that never lies. With no signal, staff still see their next six weeks of shifts, always labelled with a "Last updated" time and read-only. If the server says the person no longer has access, the saved copy is never shown.
  • Swaps that are honest about state. A swap request shows straight away, and the original shift still applies until a manager approves, so nobody turns up to the wrong shift.
  • Instant feedback, safe rollback. Settings and swap requests update on screen immediately and roll back if the server refuses, with controls disabled while a change is in flight.
  • Light and dark themes that repaint instantly in the release build.

Results

Rota runs live on Northflank, and the Android release build was tested on a real phone against the live API.

Load test. 200 virtual users on the activity feed, on the same 0.2 vCPU / 512 MB instance, once without caching and once with it:

MeasureCache offCache onChange
Median response2.19 s1.60 s27% faster
95th percentile3.11 s2.68 s14% faster
Throughput47.9 req/s56.2 req/s17% higher
Error rate0.08%0.03%both under the 1% target

The cache answered 93 to 97% of reads, yet the gain was modest. That is because every request still checks the session and the user's role on the database, and I chose not to cache those checks. Across both shards, 200 users were served over 1 to 2 real database connections, with zero wait at the connection pooler.

Deployment checks, all proven on the live servers: a real Stripe test payment through the deployed webhook and worker; a deploy that stops the old server before starting the new one; a worker paused and resumed without losing an email; a job deleted from the queue and restored; an email sent by the deployed worker.

On a real phone (release build): sign-in, push notifications with the app closed, a notification tap opening the right shift, an invite link opening the app, and a keyboard bug from development confirmed gone.

What went wrong, and what I learned

  • My free database fell asleep and broke login. Neon pauses idle databases, and the first query after a pause took longer than Prisma's default wait. I raised the wait for that case and documented the cold start, instead of hiding it.
  • A test payment landed in the wrong database. An early billing proof ran against the real shards instead of the test ones. Because billing records are append-only, those rows stay forever, by design. I added separate proof scripts and a rule that proofs run on test databases by default.
  • Screens that hung forever offline. TanStack Query pauses requests with no network by default, so cold starts in airplane mode never finished loading. One global setting and a test fixed every screen at once.
  • Tests that left rows behind. Deleted test teams left subscriptions that the worker then tried to renew. A guard now fails any test that leaves work behind, and the worker skips subscriptions with no team.
  • What I learned most: writing the rules down first is what made AI agents useful. One shared rules file, one slice at a time, and evidence in every pull request kept two different agents consistent and kept me in charge of every decision.

What I'd do next

  • Measure the rest of the request. Split database time from connection-pool wait inside the API, the one load-test measure still open.
  • Prevent cache stampedes. About 20 requests miss together each time the feed cache expires; a single refill per key would remove that.
  • Member removal and role changes as their own screens, beyond the seat-reduction flow.
  • App store billing. A store release would need Apple and Google in-app purchase, or a qualifying exception, in place of test-mode Stripe.
  • iOS, once the Android build has had real users.
Back to selected work