Example: Task Management App

A complete team task app on web pages: a board with columns, cards that move in place, assignments, due dates, an activity log and a daily digest.

The task document drives the board

Task Document
{
  "_meta": {
    "cms": 1782166695910,
    "created": 1782166695,
    "entity": 1,
    "expiry": -1,
    "guid": "f7802a394c5f48da8694374577160bc974cf563deb37a02d3bf085ca420b4325",
    "removed": 0,
    "ums": 1782253095327,
    "update_hash": "a4f8172be5093d6c47ba209fe83c15d074e2b6a9",
    "updated": 1782253095
  },
  "assignee_guid": "b9ee6a631b24e78d1aa48aef0dc067fff7bfbacd24a56ef4ed1f08e537d48b6bd02",
  "assignee_name": "sami b",
  "board": "engineering",
  "column": "in-progress",
  "created_by": "sami b",
  "due": 1782432000,
  "labels": [
    "ux",
    "onboarding"
  ],
  "priority": "high",
  "title": "review q3 onboarding flow"
}
  • column drives the board view (todo, in-progress, review, done); board separates teams.
  • The assignee is denormalized, so the board renders names without joins (see Storages).
  • Everything searchable (title, labels) is lowercase at write time.

The views are a board, my tasks, and a detail page

The board

  1. Add the page

    web_page (new web page) with event board/:board and scope *loggedin or a team scope.

  2. Search per column

    One function_search (search) per column, with a term on board and column, sorted by priority then due with query_sort_field (sorting). Or one search grouped in the flow with array blocks. It is the dashboard pattern from Dashboards.

  3. Render the cards

    One web_foreach (web for each) per column with the stored card template, so a move can render the same card. Set empty for an empty column.

  4. Render the page

    web_render (web render) with custom pins todo, in_progress, review and overdue.

Stored template: task-card
<li>
  <a href="/tasks/{{_meta.guid}}"><strong>{{title | capitalize}}</strong></a>
  <span>{{assignee_name}}, due {{due | date "DD-MM"}}</span>
  <button type="button" data-action="move" data-param-column="todo">To do</button>
  <button type="button" data-action="move" data-param-column="in-progress">Start</button>
  <button type="button" data-action="move" data-param-column="review">Review</button>
  <button type="button" data-action="move" data-param-column="done">Done</button>
</li>
Page template
<main class="board">
  <h1>{{title}}</h1>
  <section class="overdue">
    <h2>Overdue</h2>
    <ul>{{{overdue}}}</ul>
  </section>
  <section><h2>To do</h2><ul id="col-todo">{{{todo}}}</ul></section>
  <section><h2>In progress</h2><ul id="col-in-progress">{{{in_progress}}}</ul></section>
  <section><h2>Review</h2><ul id="col-review">{{{review}}}</ul></section>
</main>
ViewQuery
Overdue strip, at the top of every boardquery_bool_must_not (must not) on column = done, and due before now with query_bool_range_date_field (date) and query_bool_range_date_lt (field < {value}).
My tasks, a page of its ownuser_current (current user) through user_get_guid (get guid) into a term on assignee_guid, excluding done, sorted by due ascending.
Detail, tasks/:guidThe task with function_get_document (get document), plus its activity log with a term on task_guid, on one page.

A move changes two columns and nothing else

  1. Catch the click

    web_action (on web action) move. Its key pin is the task's guid, because web_foreach keyed the card; form holds column from data-param-column.

  2. Update the task

    function_update_document_mutations (update document) sets column.

  3. Log it

    Write an activity entry (moved to review by sami b) with a second function_create_document_from_mutations (create document) in the same flow.

  4. Take the card out

    web_remove (web remove) with that key.

  5. Put it back

    Unless the column is done: web_template (web template) with {{> task-card}}, the updated object as data and the guid as key, then web_insert (web insert) with a target of #col- plus the column from value_concatenate (concatenate values).

  • Create: a form with data-action="add-task"; function_create_document_from_mutations, then web_insert into the first column.
  • Assign: update assignee_guid and assignee_name together (never one without the other), answer with web_replace (web replace), then notify the new assignee with the email pattern.
  • Daily digest: schedule_repeating_event (repeating event) finds tasks due tomorrow per assignee and sends one mail each, with reminder_sent markers to stay idempotent.
  • Close: column to done with a timestamp. Boards filter it out, stats keep counting it.

Boards are read-heavy, so cache them

  • Board queries get a cache_key: boards are read-heavy and tolerate seconds of staleness (see caching patterns).
  • Invalidate the board cache on every task write with a storage_event (trigger event) flow and function_redis_cache_delete_key (delete).
  • Past a few thousand open tasks per board, split counters per column onto a stats document instead of counting live.
  • Want cards to appear without a reload? Put data-action and data-trigger="every 30s" on a column and answer with web_update (web update). See Markup Reference.

Next steps

Actions Replacing, inserting and removing rows from a flow. First CRUD App The tutorial this example extends. User Management System The people side of assignments. Dashboard with Charts Aggregate the board into metrics.

Frequently asked

How do I build a kanban board in RUAL?

Run one function_search per column with a term on board and column, sorted by priority then due, or one search grouped in the flow with array blocks. The column field on the task document drives the board view.

How do I show a user only their own tasks in RUAL?

Take the caller from user_current and query with a term on assignee_guid plus column != done, sorted by due ascending.

How do I keep a busy RUAL task board fast?

Give board queries a cache_key, because boards are read-heavy and tolerate seconds of staleness, and invalidate that cache on every task write with a storage-event to Redis delete flow. Past a few thousand open tasks per board, keep per-column counters on a stats document instead of counting live.