PatternsBuild A Daily Content App

Build A Daily Content App

Build an app that shows a new unit each time the last one is finished, and checks in when it is.

Build Your First App made a counter. This guide makes the other kind of app: one that walks through content. Each time the person finishes a unit, the next one unlocks, and finishing also checks in to their Action. It is the idea behind Make Your App Repeatable, written with only the bridge so you can see every part.

The Rule To Build Around

The app moves to the next unit when a unit is finished, not when the app is opened. If it moved on every open, a person could skip ahead by opening the app twice, and a unit they never read would count as done.

Step 1: The Manifest

manifest.json
{
  "manifestVersion": 1,
  "id": "daily-reminder",
  "name": "Daily Reminder",
  "version": "1.0.0",
  "author": "Your Name",
  "description": "One short reminder at a time. Finish it to unlock the next.",
  "category": "mind",
  "entry": "index.html",
  "icon": "icon.svg",
  "ageRating": 4,
  "url": "https://apps.aksaspace.com/app/daily-reminder",
  "bridge": {
    "version": 1,
    "scopes": ["actions.checkin"],
    "methods": ["actions.checkIn", "context.get", "storage.get", "storage.set"]
  },
  "action": { "title": "Read today's reminder", "minMinutes": 1, "proof": "mini_app" },
  "data": { "network": "none" }
}

This app uses storage.get, storage.set, context.get and actions.checkIn.

Step 2: The Page

The content is an array. The state is one number, the count of finished units, saved as one value. The unit to show is that number, wrapping around at the end.

index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Daily Reminder</title>
<style>
  body { font-family: system-ui, sans-serif; margin: 0; padding: 24px; background: #fefefe; color: #111; }
  .card { border: 1px solid #e5e5e5; border-radius: 18px; padding: 18px; margin: 14px 0; }
  .chip { display: inline-block; padding: 4px 10px; border-radius: 999px; background: #f4f4f5; font-size: 12px; }
  button { font: inherit; padding: 12px 20px; border-radius: 999px; border: 1px solid #ddd; background: #111; color: #fff; }
</style>
</head>
<body>
<h1>Daily Reminder</h1>
<div class="card"><span class="chip" id="level">Level 1</span> <span id="round"></span></div>
<div class="card"><p id="unit"></p><button id="finish">Finish, Next Reminder</button></div>
<script>
  var REMINDERS = [
    "Drink a glass of water before you start.",
    "Put your phone out of reach for ten minutes.",
    "Write down the one thing that matters today.",
    "Stand up and stretch your shoulders.",
    "Message someone you have not talked to in a while.",
    "Tidy one small corner of your desk.",
    "Take three slow breaths before you reply."
  ];
  var LEVELS = [[0, "Seed"], [3, "Sprout"], [7, "Steady"], [14, "Rooted"], [30, "Grounded"]];
  var KEY = "rounds";
  var rounds = 0;

  function call(method, params) {
    return window.aksa.request({ method: method, params: params || {} });
  }
  function levelFor(n) {
    var level = 1, name = LEVELS[0][1];
    for (var i = 0; i  LEVELS.length; i++) {
      if (n >= LEVELS[i][0]) { level = i + 1; name = LEVELS[i][1]; }
    }
    return "Level " + level + " " + name;
  }
  function show() {
    document.getElementById("unit").textContent = REMINDERS[rounds % REMINDERS.length];
    document.getElementById("level").textContent = levelFor(rounds);
    document.getElementById("round").textContent = "Reminder " + (rounds + 1);
  }

  call("storage.get", { key: KEY }).then(function (r) {
    rounds = Number(r.value) || 0;
    show();
  });

  document.getElementById("finish").addEventListener("click", function () {
    var finished = REMINDERS[rounds % REMINDERS.length];
    rounds += 1;
    show();
    call("storage.set", { key: KEY, value: String(rounds) });
    call("context.get").then(function (ctx) {
      return call("actions.checkIn", { actionId: ctx.actionId, summary: finished });
    }).catch(function () {});
  });
</script>
</body>
</html>

Step 3: What To Notice

  • Opening does not advance. rounds is read once and only changes in the click handler.
  • One value, one save. The whole state is a single number under one key, so a save cannot be half written.
  • A failed check-in does not undo the unit. The check-in is sent after the state is saved, and a failure is ignored on purpose. The person still finished.
  • Outside an Action, the check-in has nowhere to go. context.get returns no actionId, and the call still returns ok: true without posting. See actions.checkIn.

Step 4: Make It Yours

  • Replace the reminders with your own. If the text is scripture or comes from a source, fetch it from that source and name it on the page. Never type it from memory.
  • Make people with history keep their level: see "Do Not Lose People With History" in Make Your App Repeatable.
  • Check the page at 390 pixels wide, then run the checks and the simulator.

Next Steps

See how the starter apps do it in the Examples, and read Production Readiness before you submit.

Ready To Build Or Ship?

Check your files, preview on an iPhone frame, and submit in the Developer Studio.