Dev

3weeks Dev Log #2 — The 21-Day Rule: Consecutive, Reset, Complete

2026-02-08·2min read
3weeks Dev Log #2 — The 21-Day Rule: Consecutive, Reset, Complete

One Core Rule

The first thing I defined in planning 3weeks was the rule.

21 consecutive days. Miss one day, reset to zero.

No loose exceptions. No "5 days out of 7 is fine" or "missing one doesn't count." The moment you allow exceptions, the psychological tension that makes the habit stick disappears.

The whole point of the 21-day framework is that the count is only meaningful if it's unbroken.


Defining "One Day"

The first design question: what counts as "today"?

Midnight? Rolling 24 hours?

If someone exercises at 2 AM after working late — does that count for the day before or the current calendar date?

I chose calendar date as the standard. Midnight is the boundary. It keeps the app aligned with how people naturally think about days, even if it's technically unfair to night owls.


Notification Design

Forgetting to check in is the most common failure mode. Notifications were therefore central to the design.

Each habit has an independently configurable reminder time. The notification content shows the habit name and the current day count:

"Exercise — Day 12 in progress. Ready to check in?"

Seeing the number makes skipping it feel more costly.


The 21-Day Completion Screen

This was a small but deliberate touch.

Reaching day 21 and getting a generic "Complete" message feels flat. Three weeks of daily effort deserves a better moment than that.

The completion screen has a celebration animation. A small acknowledgment that something real was accomplished.

That experience is what motivates starting the next habit.


Multiple Simultaneous Habits

I initially considered allowing only one habit at a time.

In practice, people want to build multiple habits concurrently — exercise, reading, studying — and the app should support that. Each habit track is independently managed: its own notification, its own counter, its own check history.

The risk of adding too many at once is user-imposed. The app doesn't limit it.


Local Data Only

This app doesn't need a server. All data lives on device.

Realm Swift handles persistence: habit records, daily check history, notification preferences. One habit entry holds the name, start date, notification time, and the date-by-date check log. That's the entire data model.