Health & fitness

Build a habit tracker app with AI

We built this one for real: Streakly, a habit tracker made in Apirex for Android, iPhone and the web. See that build, then the full brief for your own version.

Apirex TeamUpdated AndroidiOS
On this page
  1. We built this one: Streakly
  2. The blueprint
  3. Screens
  4. Data model
  5. Native features
  6. Android notes (Kotlin and Jetpack Compose)
  7. iPhone notes (Swift and SwiftUI)
  8. Copy-paste prompt
  9. Acceptance test
  10. Frequently asked questions

Real build · 30 November 2026

We built this one: Streakly

On 30 November 2026 we turned this exact idea into Streakly, a working habit tracker, three times over: a Kotlin app, a SwiftUI app and a React website for it. Every run was on an Apple Silicon Mac. The timers and Rex Credits below were read off the builder, not estimated.

Projects
3
Building time, all three
22:17
Rex Credits, all three
15.18
Build this yourself The real prompt, 90 words · Android
Build "Streakly", a native Android habit tracker (Kotlin + Jetpack Compose, Material 3, data saved on the device).

Screens: Today (progress ring "3 of 5 done", habit cards with emoji and streak 🔥, tap to check), Add habit (name, emoji, days of the week), Habit detail (streak number + 12-week heatmap), Stats (weekly bar chart).

Style: clean and modern, white background, green accent #32C35A, big bold numbers, rounded cards, smooth check animation. Add 4 sample habits with a few weeks of history so the app looks alive on first launch.

Opens Apirex with this prompt in the box. Pick the Android · Kotlin tab before you send.

Streakly, a Kotlin habit tracker, running in the Apirex built-in Android emulator next to the chat that built it
Streakly in Kotlin, running in the built-in Android emulator (Apple Silicon Mac, macOS 13 or later).
9:24building time
6.94Rex Credits
Stack
Kotlin + Jetpack Compose, Room
Files
27 written, 1 edit
Gradle
BUILD SUCCESSFUL in 3m, first build
Lint
No errors, 32 warnings

The plan came first and waited for approval; the screens were designed as a board before any Kotlin was written. The built-in Android emulator needs an Apple Silicon Mac with macOS 13 or later. On Windows, Linux or an Intel Mac the same app builds in full, and you test it on your phone: over USB, by downloading the APK from the builder, or with a QR link on the same Wi-Fi (beta).

Read the Android build

The blueprint

Streakly kept its first version small: four screens, data on the device, no accounts. The brief below is the fuller plan for a habit tracker you would ship, with schedules, dated check-ins, reminders and tests on a real phone. Use it as is, or start from the Streakly prompt above and grow into it.

5screens
3data tables
190word prompt
2platforms: Android, iOS

This habit tracker brief is for people who want a dependable daily checklist rather than a punitive score. Streakly, the build above, proved the smallest loop: seeded habits, a tap to check, a streak that updates. Your first release should prove one more: create a daily reading habit, check in once, and confirm the correct local date and streak. Keep daily habits, dated check-ins, streaks and reminders tied to the same saved records before adding bigger integrations.

Screens

  • Today: Show only habits scheduled for the selected date
  • Add habit: Choose a name, repeat rule and optional reminder
  • Streaks: Explain consecutive scheduled completions and missed days
  • Statistics: Review check-ins over a selected period
  • Settings: Manage timezone policy and notification preferences

Data model

TableKey fieldsPurpose
habitsid (uuid), title (text), archived_at (timestamptz nullable)Habit definitions with reversible retirement
schedule_rulesid (uuid), habit_id (uuid), weekdays (text), timezone_id (text)The days on which completion is expected
check_insid (uuid), habit_id (uuid), local_date (date), completed_at (timestamptz)One completion per habit and effective date

Start with a single-device habit ledger if cross-device access is unnecessary. For account storage, attach habits to their authenticated owner and enforce server-side row-level security on schedules and check-ins through that relationship. The completion date uniqueness rule belongs in persistent storage as well as the interface. Another account must not be able to inspect a person’s routines by guessing a habit identifier.

Native features

Habit tracking needs a durable daily check-in record and user-chosen reminders tied to each habit's schedule. Room or SwiftData should save the habit's intended local date, not derive all past check-ins from the phone's current time zone. NotificationManager or UserNotifications can offer a prompt, but missing or dismissing it must not count as failure or completion. Allow quiet habits with no alert at all. A weekly schedule and a daily schedule require different due-day rules, so the reminder configuration must follow the habit rather than a single global daily alarm.

Android notes (Kotlin and Jetpack Compose)

Use a LazyColumn keyed by habit ID and Material 3 day chips that include selected-state semantics for screen readers. A ViewModel should request a repository operation that inserts or removes one check-in for a habit and date; enforce that pair's uniqueness in Room. DataStore can remember the preferred week start, while historical check-ins remain in the database. Use rememberLauncherForActivityResult when notification permission is needed and keep the reminder toggle honest after denial. On Android hardware, mark yesterday complete, rotate during today's check-in, then change the device time zone. Neither action should produce an extra completion or rewrite yesterday's date.

iPhone notes (Swift and SwiftUI)

A NavigationStack can lead from the habit List to a date-based history view. Persist explicit completion dates with SwiftData and calculate streaks from the habit's scheduled days, not a stored number incremented by every tap. Present schedule editing in a sheet with medium and large detents, explaining whether a change applies only to future due dates. Reschedule UserNotifications when the user changes reminder time or archives a habit. On an iPhone, create a weekday-only habit on Friday, complete it, and inspect the next due day. Archive it before the next alert and confirm both the list state and pending reminder reflect that decision.

Copy-paste prompt

Build this yourself 188 words · Android
Build a habit tracker app for Android using native screens and a deliberately small first release. The core scope is daily habits, dated check-ins, streaks and reminders. Include these destinations: Today, Add habit, Streaks, Statistics, Settings. Use these persisted entities: habits, schedule_rules, check_ins; retain stable identifiers and explicit relationships rather than maintaining independent screen totals.
Ask me these owner decisions before implementing ambiguous behavior: which timezone defines a day, whether backdating is allowed, and whether skipped scheduled days break a streak. Do not invent a policy or add an unrequested external integration. Start local-only unless I explicitly choose account storage; if I choose a backend, enforce ownership on the server with row-level security.
Show loading, empty and recoverable error states, plus permission-denied handling wherever a native capability requests access. Keep incomplete input recoverable and distinguish it from saved data. For acceptance, create a daily reading habit, check in once, and verify the correct local date and streak. Also exercise the invalid-input or denied-permission path and reopen the app to inspect the persisted result. Explain any remaining device-only checks rather than equating a successful build with a passing journey.

Opens Apirex with this prompt in the box. Pick the Android · Kotlin tab before you send.

Acceptance test

  1. Create Read ten pages as a daily habit and explicitly choose the timezone used for check-ins.
  2. Mark today complete twice; verify there is one dated check-in and only one increment.
  3. Navigate to Statistics and confirm its count agrees with Today for that habit.
  4. Reopen the app and check the completion remains associated with the same local date.
  5. Deny reminders, change the schedule to weekdays, and confirm manual completion still works without stale reminders.

Test a weekday habit across Friday, Saturday and Monday using controlled dates. Saturday should not be treated as a missed scheduled occurrence, while an uncompleted Monday should follow the owner’s explicit missed-day rule. Undo Friday’s check-in and recompute the chain from dated records rather than subtracting one from a cached streak counter.

The first Today screen should explain that no routines exist and offer Add habit. A day with existing but unscheduled habits is different: show that nothing is due, not that all habits were deleted. Keep archived routine history until the user deliberately deletes it, and make clear whether changing a schedule changes only future expectations or also historical streak calculations.

Frequently asked questions

Did Apirex really build a habit tracker from this idea?

Yes. On 30 November 2026 we built Streakly as a Kotlin app, then as a SwiftUI iPhone app, then as a React website for it. The Android run took 9 minutes 24 seconds of building for 6.94 Rex Credits; the iPhone run took 8 minutes 17 seconds for 3.83 Rex Credits.

How should travel affect a streak?

Choose a fixed home timezone or a device-local policy before implementing streaks. Explain that policy in Settings and test a date boundary rather than silently rewriting previous check-ins.

Do skipped weekends break the chain?

Not when the habit is defined for weekdays only. Compute the chain over expected occurrences, and ask separately whether an explicitly skipped scheduled occurrence counts as a miss.

Is a home-screen widget part of this scope?

A widget is not included in the initial checklist. Request it separately with the necessary platform targets, shared storage design and update-behavior tests.

Build this blueprint

The blueprint prompt, ready for your platform. Edit anything before you send it.

AndroidKotlin · Jetpack ComposeReal source on your computer

Opens Apirex with this prompt. Pick the Android · Kotlin tab before you send. The Free plan includes 5 Rex Credits a day.