<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Examples on backd</title><link>https://fernandezvara.github.io/backd/docs/examples/</link><description>Recent content in Examples on backd</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://fernandezvara.github.io/backd/docs/examples/index.xml" rel="self" type="application/rss+xml"/><item><title>Blog</title><link>https://fernandezvara.github.io/backd/docs/examples/blog/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://fernandezvara.github.io/backd/docs/examples/blog/</guid><description>&lt;p&gt;A small blog. Anyone can read published posts. Signed-in users write posts, keep drafts, and edit, publish, unpublish and delete their own. Each post shows when and by whom it was written, and its category. Clicking an author or a category lists only those posts, and both filters combine.&lt;/p&gt;
&lt;p&gt;It shows the everyday use of backd: public and private documents in one collection, ownership, and posts signed with the writer&amp;rsquo;s own identity, all decided on the server by &lt;a href="../../auth/rules/"&gt;access rules&lt;/a&gt;. Unlike the &lt;a href="../expenses/"&gt;expenses example&lt;/a&gt;, it doesn&amp;rsquo;t share documents between users, so rules cover everything it needs: it has no known holes, only the &lt;a href="#limits"&gt;limits&lt;/a&gt; below. One page, above the post list, does need a &lt;a href="#a-server-side-function-stats"&gt;server-side function&lt;/a&gt;: a count of every published post, and of the caller&amp;rsquo;s own, neither computable from what a reader may list.&lt;/p&gt;</description></item><item><title>Expenses without functions</title><link>https://fernandezvara.github.io/backd/docs/examples/expenses/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://fernandezvara.github.io/backd/docs/examples/expenses/</guid><description>&lt;p&gt;A small group-expenses tracker in the style of Tricount or Splitwise. People create a group, invite others by email, record what they paid, and see who owes whom.&lt;/p&gt;
&lt;p&gt;Unlike the &lt;a href="../blog/"&gt;blog&lt;/a&gt;, where each post belongs to its writer, here documents are shared between users, and some of the checks it needs involve more than one document. It is also a lesson in the limits of access rules. Its &lt;a href="../../auth/rules/"&gt;rules&lt;/a&gt; are as strict as rules can be today, and they still leave holes, because some checks need data from another document or logic on the server. Those holes are documented here on purpose: this is deliberately the &amp;ldquo;before&amp;rdquo; half of a pair. &lt;strong&gt;&lt;a href="../expenses-with-functions/"&gt;Expenses with functions&lt;/a&gt;&lt;/strong&gt; is the &amp;ldquo;after&amp;rdquo; — the same app, same layout, with holes 1–4 closed by &lt;a href="../../functions/"&gt;server-side functions&lt;/a&gt;, compared side by side with what changed and why. Hole 5 is closed by &lt;a href="../../auth/sessions/#email-verification"&gt;email verification&lt;/a&gt; in both: access here is by email address, so the address has to be the user&amp;rsquo;s own.&lt;/p&gt;</description></item><item><title>Expenses with functions</title><link>https://fernandezvara.github.io/backd/docs/examples/expenses-with-functions/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://fernandezvara.github.io/backd/docs/examples/expenses-with-functions/</guid><description>&lt;p&gt;The same group-expenses tracker as &lt;a href="../expenses/"&gt;expenses without functions&lt;/a&gt;, with the same layout, the same data model&amp;rsquo;s spirit, and the same rules where nothing needed to change — but holes 1 through 4 are closed, by five small &lt;a href="../../functions/"&gt;functions&lt;/a&gt; instead of client-trusted copies. Hole 5 (signing up with someone else&amp;rsquo;s email) is closed too, but by &lt;a href="../../auth/sessions/#email-verification"&gt;email verification&lt;/a&gt;, not by functions: the realm requires a verified address, and rules and functions check &lt;code&gt;user.email_verified&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Read &lt;a href="../expenses/"&gt;expenses without functions&lt;/a&gt; first if you haven&amp;rsquo;t: this page assumes you know the five holes it documents, and spends its time on what&amp;rsquo;s different here and why.&lt;/p&gt;</description></item><item><title>Workshop tour</title><link>https://fernandezvara.github.io/backd/docs/examples/workshop-tour/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://fernandezvara.github.io/backd/docs/examples/workshop-tour/</guid><description>&lt;p&gt;The &lt;a href="../../functions/cookbook/"&gt;functions cookbook&lt;/a&gt; explains each function of the &lt;code&gt;workshop&lt;/code&gt; realm. The &lt;strong&gt;workshop tour&lt;/strong&gt; lets you use them: one page, one panel per feature, and an &lt;strong&gt;inspector&lt;/strong&gt; beside it that shows every call the page makes, so you see what the browser sent and what &lt;code&gt;backd&lt;/code&gt; answered.&lt;/p&gt;



&lt;p&gt;It is part of the local stack (&lt;code&gt;make example&lt;/code&gt;, then &lt;a href="https://localhost:8443/example/workshop/"&gt;https://localhost:8443/example/workshop/&lt;/a&gt;). The page is plain JavaScript on &lt;a href="../../clients/js/"&gt;&lt;code&gt;backd-js&lt;/code&gt;&lt;/a&gt;, with no build step, in &lt;code&gt;clients/js/examples/workshop&lt;/code&gt;; the realm is &lt;code&gt;examples/config/workshop&lt;/code&gt;.&lt;/p&gt;</description></item></channel></rss>