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
{
"_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"
}columndrives the board view (todo, in-progress, review, done);boardseparates 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
Add the page
web_page(new web page) witheventboard/:boardand scope*loggedinor a team scope.Search per column
One
function_search(search) per column, with a term onboardandcolumn, sorted byprioritythenduewithquery_sort_field(sorting). Or one search grouped in the flow with array blocks. It is the dashboard pattern from Dashboards.Render the cards
One
web_foreach(web for each) per column with the stored card template, so a move can render the same card. Setemptyfor an empty column.Render the page
web_render(web render) with custom pinstodo,in_progress,reviewandoverdue.
<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><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>| View | Query |
|---|---|
| Overdue strip, at the top of every board | query_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 own | user_current (current user) through user_get_guid (get guid) into a term on assignee_guid, excluding done, sorted by due ascending. |
Detail, tasks/:guid | The 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
Catch the click
web_action(on web action)move. Itskeypin is the task's guid, becauseweb_foreachkeyed the card;formholdscolumnfromdata-param-column.Update the task
function_update_document_mutations(update document) setscolumn.Log it
Write an activity entry (
moved to review by sami b) with a secondfunction_create_document_from_mutations(create document) in the same flow.Take the card out
web_remove(web remove) with thatkey.Put it back
Unless the column is
done:web_template(web template) with{{> task-card}}, the updatedobjectasdataand the guid askey, thenweb_insert(web insert) with atargetof#col-plus the column fromvalue_concatenate(concatenate values).
- Create: a form with
data-action="add-task";function_create_document_from_mutations, thenweb_insertinto the first column. - Assign: update
assignee_guidandassignee_nametogether (never one without the other), answer withweb_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, withreminder_sentmarkers to stay idempotent. - Close:
columntodonewith 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 andfunction_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-actionanddata-trigger="every 30s"on a column and answer withweb_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.