<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Revercue </title>
    <description>The latest articles on DEV Community by Revercue  (@revercue).</description>
    <link>https://dev.to/revercue</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4264565%2F5dcbcbef-e485-45de-9412-e0a47cf5c695.png</url>
      <title>DEV Community: Revercue </title>
      <link>https://dev.to/revercue</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/revercue"/>
    <language>en</language>
    <item>
      <title>The data model behind a freelancer's client thread</title>
      <dc:creator>Revercue </dc:creator>
      <pubDate>Fri, 27 Nov 2026 12:59:33 +0000</pubDate>
      <link>https://dev.to/revercue/the-data-model-behind-a-freelancers-client-thread-5g93</link>
      <guid>https://dev.to/revercue/the-data-model-behind-a-freelancers-client-thread-5g93</guid>
      <description>&lt;p&gt;Every freelancer I know runs the same five tools badly: a doc for the proposal, a PDF for the contract, a form for requirements, an invoicing app, and a spreadsheet that is allegedly the CRM. Each one is fine alone. Together they produce the specific frustration of not being able to answer "what did we agree, and what is still unpaid?" without opening five tabs.&lt;/p&gt;

&lt;p&gt;The fix is not a better spreadsheet. It is a data model where the client is the centre and the documents hang off it. This post is that model: the tables, the status machines, the money handling, and the parts that are easy to get wrong. It is the schema I wish I had started with.&lt;/p&gt;

&lt;h2&gt;
  
  
  The four entities (and the two that look like entities but are not)
&lt;/h2&gt;

&lt;p&gt;A client thread needs exactly four things:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Client&lt;/strong&gt; — the business relationship. The thing you would call "Acme Co".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Person&lt;/strong&gt; — a human at that client. Might be one, might be four (the approver, the payer, the one who replies).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Document&lt;/strong&gt; — proposal, contract, requirement form, invoice. Same lifecycle, different payload.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Event&lt;/strong&gt; — something that happened: opened, section reached, approved, paid, note added.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The two impostors are &lt;strong&gt;project&lt;/strong&gt; and &lt;strong&gt;task&lt;/strong&gt;. They feel essential, and for a solo freelancer they are usually a document with a date on it. Adding them early gives you three places to keep status in sync and no extra clarity. Add them when a client genuinely has parallel workstreams, not before.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;clients&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;id&lt;/span&gt;          &lt;span class="kt"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;owner_id&lt;/span&gt;    &lt;span class="kt"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;name&lt;/span&gt;        &lt;span class="kt"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;currency&lt;/span&gt;    &lt;span class="kt"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="s1"&gt;'USD'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;archived_at&lt;/span&gt; &lt;span class="kt"&gt;INTEGER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;created_at&lt;/span&gt;  &lt;span class="kt"&gt;INTEGER&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;people&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;id&lt;/span&gt;         &lt;span class="kt"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;client_id&lt;/span&gt;  &lt;span class="kt"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt; &lt;span class="k"&gt;REFERENCES&lt;/span&gt; &lt;span class="nf"&gt;clients&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;name&lt;/span&gt;       &lt;span class="kt"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;email&lt;/span&gt;      &lt;span class="kt"&gt;TEXT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;role&lt;/span&gt;       &lt;span class="kt"&gt;TEXT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;           &lt;span class="c1"&gt;-- approver | billing | day-to-day&lt;/span&gt;
  &lt;span class="n"&gt;created_at&lt;/span&gt; &lt;span class="kt"&gt;INTEGER&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;role&lt;/code&gt; column is doing more work than it looks. Most "difficult client" stories are really "we never established who approves". Storing it explicitly means the invoice goes to billing and the approval request goes to the approver, and you stop guessing from an email thread.&lt;/p&gt;

&lt;h2&gt;
  
  
  One documents table, or five?
&lt;/h2&gt;

&lt;p&gt;This is the first real decision, and both answers are defensible.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Five tables&lt;/strong&gt; (&lt;code&gt;proposals&lt;/code&gt;, &lt;code&gt;contracts&lt;/code&gt;, &lt;code&gt;forms&lt;/code&gt;, &lt;code&gt;invoices&lt;/code&gt;) give you tight types and simple queries per kind. The cost is that every cross-kind feature — a client timeline, a dashboard count, a "recent activity" list — becomes a &lt;code&gt;UNION ALL&lt;/code&gt; that grows with every new document type.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One table plus a typed payload&lt;/strong&gt; keeps the cross-kind features trivial and the schema small. The cost is that kind-specific fields either live in JSON or get promoted to columns.&lt;/p&gt;

&lt;p&gt;The hybrid that has held up for me:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;documents&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;id&lt;/span&gt;            &lt;span class="kt"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;owner_id&lt;/span&gt;      &lt;span class="kt"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;client_id&lt;/span&gt;     &lt;span class="kt"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt; &lt;span class="k"&gt;REFERENCES&lt;/span&gt; &lt;span class="nf"&gt;clients&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;kind&lt;/span&gt;          &lt;span class="kt"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;              &lt;span class="c1"&gt;-- proposal | contract | form | invoice&lt;/span&gt;
  &lt;span class="n"&gt;title&lt;/span&gt;         &lt;span class="kt"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;status&lt;/span&gt;        &lt;span class="kt"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;              &lt;span class="c1"&gt;-- per-kind machine, see below&lt;/span&gt;
  &lt;span class="n"&gt;slug&lt;/span&gt;          &lt;span class="kt"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;UNIQUE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;                &lt;span class="c1"&gt;-- public capability URL&lt;/span&gt;
  &lt;span class="n"&gt;payload&lt;/span&gt;       &lt;span class="kt"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;              &lt;span class="c1"&gt;-- JSON, validated at the app layer&lt;/span&gt;
  &lt;span class="c1"&gt;-- promoted columns: the handful you filter, sort or sum on&lt;/span&gt;
  &lt;span class="n"&gt;amount_minor&lt;/span&gt;  &lt;span class="kt"&gt;INTEGER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;currency&lt;/span&gt;      &lt;span class="kt"&gt;TEXT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;due_at&lt;/span&gt;        &lt;span class="kt"&gt;INTEGER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;source_id&lt;/span&gt;     &lt;span class="kt"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;REFERENCES&lt;/span&gt; &lt;span class="nf"&gt;documents&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="c1"&gt;-- the proposal a contract came from&lt;/span&gt;
  &lt;span class="n"&gt;accepted_at&lt;/span&gt;   &lt;span class="kt"&gt;INTEGER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;expires_at&lt;/span&gt;    &lt;span class="kt"&gt;INTEGER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;created_at&lt;/span&gt;    &lt;span class="kt"&gt;INTEGER&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;updated_at&lt;/span&gt;    &lt;span class="kt"&gt;INTEGER&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;INDEX&lt;/span&gt; &lt;span class="n"&gt;documents_client&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;documents&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;client_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt; &lt;span class="k"&gt;DESC&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;INDEX&lt;/span&gt; &lt;span class="n"&gt;documents_owner_status&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;documents&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;owner_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;status&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;JSON for the body, columns for anything a query touches. The rule I use: if a field appears in a &lt;code&gt;WHERE&lt;/code&gt;, &lt;code&gt;ORDER BY&lt;/code&gt;, or a dashboard number, it gets a column. Everything else can stay in the payload. Adding a new block type to a proposal should never require a migration.&lt;/p&gt;

&lt;h2&gt;
  
  
  Status is per kind, not global
&lt;/h2&gt;

&lt;p&gt;A single &lt;code&gt;status&lt;/code&gt; enum across all documents is the mistake that forces five boolean columns later. Proposals and invoices move through completely different states:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;proposal: draft → sent → viewed → selected → accepted | declined | expired
contract: draft → sent → approved | declined | questions → signed
form:     draft → sent → partial → submitted
invoice:  draft → sent → viewed → paid | overdue | void
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keep one &lt;code&gt;status&lt;/code&gt; column, but validate it against a per-kind allowlist. Then write the transition rules down in code as a map, not as scattered &lt;code&gt;if&lt;/code&gt; statements:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="no"&gt;TRANSITIONS&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;proposal&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;draft&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'sent'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;sent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'viewed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'selected'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'declined'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'expired'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;viewed&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'selected'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'declined'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'expired'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;selected&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'accepted'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'declined'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;accepted&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;declined&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;expired&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'sent'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two rules that save arguments later: &lt;strong&gt;a declined document is not deleted&lt;/strong&gt; (declines are the most useful history you have), and &lt;strong&gt;&lt;code&gt;accepted&lt;/code&gt; is terminal for the content&lt;/strong&gt;. If the client accepted a proposal, the proposal's text must stop changing — which leads to the next section.&lt;/p&gt;

&lt;h2&gt;
  
  
  Snapshots, because accepted means frozen
&lt;/h2&gt;

&lt;p&gt;The moment a proposal is accepted, it becomes evidence. If the user can still edit it afterwards, every later dispute is unresolvable: you cannot prove what was agreed.&lt;/p&gt;

&lt;p&gt;The cheap version is a version table:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;document_versions&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;id&lt;/span&gt;          &lt;span class="kt"&gt;INTEGER&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt; &lt;span class="no"&gt;AUTOINCREMENT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;document_id&lt;/span&gt; &lt;span class="kt"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt; &lt;span class="k"&gt;REFERENCES&lt;/span&gt; &lt;span class="nf"&gt;documents&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;payload&lt;/span&gt;     &lt;span class="kt"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;created_at&lt;/span&gt;  &lt;span class="kt"&gt;INTEGER&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;created_by&lt;/span&gt;  &lt;span class="kt"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On accept, write a version and set &lt;code&gt;accepted_version_id&lt;/code&gt;. The contract's payload then references the accepted proposal version, not "the proposal". When someone asks in month four why the price is what it is, the answer is a row, not a memory.&lt;/p&gt;

&lt;p&gt;Snapshots also give you a safe way to allow editing after sending: edit freely, because the client is looking at the last published version, not your live draft. That is the difference between a document editor and a document you sent.&lt;/p&gt;

&lt;h2&gt;
  
  
  Money in integers, one currency per document
&lt;/h2&gt;

&lt;p&gt;Two rules and a small table:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Store amounts in minor units&lt;/strong&gt; (&lt;code&gt;amount_minor&lt;/code&gt;, integer cents/pence). Floating point money is a bug that shows up in month three.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Currency lives on the document&lt;/strong&gt;, not on the client, because a client can be billed in two currencies and each document must be internally consistent.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;invoice_lines&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;id&lt;/span&gt;             &lt;span class="kt"&gt;INTEGER&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt; &lt;span class="no"&gt;AUTOINCREMENT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;document_id&lt;/span&gt;    &lt;span class="kt"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt; &lt;span class="k"&gt;REFERENCES&lt;/span&gt; &lt;span class="nf"&gt;documents&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;description&lt;/span&gt;    &lt;span class="kt"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;quantity&lt;/span&gt;       &lt;span class="kt"&gt;INTEGER&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="c1"&gt;-- thousandths if fractional&lt;/span&gt;
  &lt;span class="n"&gt;unit_minor&lt;/span&gt;     &lt;span class="kt"&gt;INTEGER&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;tax_rate_bp&lt;/span&gt;    &lt;span class="kt"&gt;INTEGER&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt; &lt;span class="k"&gt;DEFAULT&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;   &lt;span class="c1"&gt;-- basis points, 2000 = 20%&lt;/span&gt;
  &lt;span class="n"&gt;position&lt;/span&gt;       &lt;span class="kt"&gt;INTEGER&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tax as basis points avoids the classic &lt;code&gt;0.2 * 100&lt;/code&gt; rounding drift, and it keeps the calculation auditable. Round once, at the line-total boundary, with an explicit policy (&lt;code&gt;round half up&lt;/code&gt;, or bankers rounding — pick one and write it in a comment, because the difference will appear in an invoice one day).&lt;/p&gt;

&lt;p&gt;Payment, importantly, is &lt;strong&gt;not&lt;/strong&gt; card processing. An invoice can record "paid" with a reference and a proof-of-payment upload from the client. That keeps you out of PCI scope entirely and works for bank transfers, which is how most freelance invoices are actually settled.&lt;/p&gt;

&lt;h2&gt;
  
  
  Events as the spine of the record
&lt;/h2&gt;

&lt;p&gt;A CRM built on a &lt;code&gt;last_contacted&lt;/code&gt; column is dead within a month. The record should be derived from events instead:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;events&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;id&lt;/span&gt;          &lt;span class="kt"&gt;INTEGER&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt; &lt;span class="no"&gt;AUTOINCREMENT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;owner_id&lt;/span&gt;    &lt;span class="kt"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;client_id&lt;/span&gt;   &lt;span class="kt"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;REFERENCES&lt;/span&gt; &lt;span class="nf"&gt;clients&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;document_id&lt;/span&gt; &lt;span class="kt"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;REFERENCES&lt;/span&gt; &lt;span class="nf"&gt;documents&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;kind&lt;/span&gt;        &lt;span class="kt"&gt;TEXT&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;           &lt;span class="c1"&gt;-- opened | section | note | sent | paid | call&lt;/span&gt;
  &lt;span class="n"&gt;body&lt;/span&gt;        &lt;span class="kt"&gt;TEXT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;                    &lt;span class="c1"&gt;-- note text, not log spam&lt;/span&gt;
  &lt;span class="n"&gt;created_at&lt;/span&gt;  &lt;span class="kt"&gt;INTEGER&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With that, the client timeline is one query, and every number on the dashboard is a &lt;code&gt;COUNT&lt;/code&gt; or a &lt;code&gt;SUM&lt;/code&gt; rather than a field someone has to remember to update:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- The client record, in the order it happened&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;kind&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="nb"&gt;COALESCE&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;title&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;documents&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;events&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;document_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;label&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;events&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;client_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;
&lt;span class="k"&gt;ORDER&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt; &lt;span class="k"&gt;DESC&lt;/span&gt;
&lt;span class="k"&gt;LIMIT&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- Money that is still owed&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;SUM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;amount_minor&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;owed_minor&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;currency&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;documents&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="k"&gt;JOIN&lt;/span&gt; &lt;span class="n"&gt;clients&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;client_id&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;kind&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'invoice'&lt;/span&gt; &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;status&lt;/span&gt; &lt;span class="k"&gt;IN&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'sent'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'viewed'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'overdue'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;GROUP&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;client_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;currency&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice what is missing: no &lt;code&gt;interest_score&lt;/code&gt; column, no &lt;code&gt;last_activity&lt;/code&gt; denormalisation. Both are derived. An interest indicator computed as arithmetic over events (opens, sections, decisions, recency) can change its formula next month without a migration, and nobody has to trust a stale field.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tenancy in every query, not after it
&lt;/h2&gt;

&lt;p&gt;If the app has accounts, every row needs an owner and every query needs a filter. The failure mode is subtle and common: you fetch a document by id, then check ownership in application code, and one forgotten &lt;code&gt;if&lt;/code&gt; exposes a client's contract.&lt;/p&gt;

&lt;p&gt;Bake it into the query:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;doc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;prepare&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="s1"&gt;'SELECT * FROM documents WHERE id = ?1 AND owner_id = ?2'&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;bind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;first&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And on the public side, look up by &lt;code&gt;slug&lt;/code&gt; only — never by id — with &lt;code&gt;status&lt;/code&gt;, &lt;code&gt;expires_at&lt;/code&gt; and &lt;code&gt;revoked_at&lt;/code&gt; checked in the same statement. Two different access paths, two different queries, no shared "find by id" helper that can be pointed at the wrong caller.&lt;/p&gt;

&lt;h2&gt;
  
  
  Retention, deletion, and the part nobody models
&lt;/h2&gt;

&lt;p&gt;The bit every schema blog skips: what happens when a plan downgrades or a document ages out.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Archive is a state, not a delete.&lt;/strong&gt; &lt;code&gt;archived_at&lt;/code&gt; keeps the row queryable for retention and removes it from the active count.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Expiry is checked at read time.&lt;/strong&gt; &lt;code&gt;expires_at&lt;/code&gt; in the public route means an expired link shows a clear page even if the cleanup job has not run yet.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deletion cascades documents and events, but not the client.&lt;/strong&gt; The client row is the relationship; the documents were rented. Keep the relationship and the notes that describe it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;An export exists before any deletion.&lt;/strong&gt; The PDF or JSON goes out first, with a date. "Your data is yours" is a schema feature, not a marketing line.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Order matters inside the cascade: snapshot, notify, wait, delete. Deleting first and emailing later is how a product earns a support ticket it cannot resolve.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fixture that tests the whole thing
&lt;/h2&gt;

&lt;p&gt;A schema is only as good as the ugliest realistic case it can hold. I keep one seed that builds a two-month project end to end:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A client with two people: an approver and a billing contact.&lt;/li&gt;
&lt;li&gt;A proposal with three packages, one selected, then accepted.&lt;/li&gt;
&lt;li&gt;A contract generated from the accepted proposal version, approved, then questioned about a clause, then approved again.&lt;/li&gt;
&lt;li&gt;A requirements form submitted partially, then completed after a reminder.&lt;/li&gt;
&lt;li&gt;A deposit invoice paid with a proof upload, and a final invoice overdue by nine days.&lt;/li&gt;
&lt;li&gt;A change request that added 6 hours and moved the total by 480 in minor units.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If a query on the dashboard, the client timeline, or the invoice list breaks on that seed, something in the model is wrong. If it holds, you have a product, not a set of tables.&lt;/p&gt;

&lt;h2&gt;
  
  
  The honest limits
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;An approval record is not a qualified electronic signature.&lt;/strong&gt; If a contract needs legal e-signature in your jurisdiction, this model records consent but does not replace an e-signature provider. Say that in the UI.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No card processing.&lt;/strong&gt; Recording a payment is not charging one. Keeping that boundary is a feature, not a gap.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A JSON payload is not free.&lt;/strong&gt; You lose database-level constraints on body fields; validate on write, and version the payload shape so old documents keep rendering after a block type changes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One workspace per user is a simplification.&lt;/strong&gt; The moment a second person needs access, you need roles and an audit log, and that is a different post.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What to take away
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The client is the centre; documents hang off it; events are the spine.&lt;/li&gt;
&lt;li&gt;One documents table with a typed payload and a few promoted columns gets you both flexibility and query speed.&lt;/li&gt;
&lt;li&gt;Status machines are per kind, terminal states are real, and accepted content gets snapshotted.&lt;/li&gt;
&lt;li&gt;Money in integers, currency on the document, tax in basis points.&lt;/li&gt;
&lt;li&gt;Derive the numbers, filter by owner in the same query, and design deletion before you need it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A thread is not a feature you add later. It is a schema decision you make on day one, and it is the difference between five apps and one record.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;I build &lt;a href="https://revercue.co.uk/?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=client_thread_schema" rel="noopener noreferrer"&gt;Revercue&lt;/a&gt;, which keeps proposals, contracts, requirement forms, invoices and the client record on one thread, with a free plan that covers five active documents. If you have modelled this differently — especially the version/snapshot part — I would like to hear what broke for you.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>database</category>
      <category>architecture</category>
      <category>productivity</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Tracked document links without an analytics stack</title>
      <dc:creator>Revercue </dc:creator>
      <pubDate>Fri, 27 Nov 2026 12:53:12 +0000</pubDate>
      <link>https://dev.to/revercue/tracked-document-links-without-an-analytics-stack-3cbg</link>
      <guid>https://dev.to/revercue/tracked-document-links-without-an-analytics-stack-3cbg</guid>
      <description>&lt;p&gt;You do not need an analytics platform to know whether a client read the proposal you sent. You need four events, one table, and about 150 lines of code. That is the whole system, and it is worth building because the alternative — installing a general-purpose tracker on a client-facing document — gives you a hundred numbers and none of the answers you wanted.&lt;/p&gt;

&lt;p&gt;This is a walkthrough of how I built tracked document links: unguessable URLs, optional password gates, event capture that cannot be trusted blindly, and the aggregations that turn raw rows into "they read the pricing twice and stopped before the timeline".&lt;/p&gt;

&lt;p&gt;It is a small-system design piece, so it applies to a proposal tool, a contract, an invoice, a shared report, or any page where "did they look at it" is the question.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start from the four events
&lt;/h2&gt;

&lt;p&gt;Most tracking implementations fail by over-collecting. If you can answer these four questions, you have everything a follow-up needs:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Was the document opened at all?&lt;/li&gt;
&lt;li&gt;When was it last opened, and how many distinct sessions?&lt;/li&gt;
&lt;li&gt;How far into the document did the reader get?&lt;/li&gt;
&lt;li&gt;Did they make a decision (select a package, approve, decline, ask a question)?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That maps to one append-only table:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;doc_events&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;id&lt;/span&gt;          &lt;span class="kt"&gt;INTEGER&lt;/span&gt; &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt; &lt;span class="no"&gt;AUTOINCREMENT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;doc_id&lt;/span&gt;      &lt;span class="kt"&gt;TEXT&lt;/span&gt;    &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;event&lt;/span&gt;       &lt;span class="kt"&gt;TEXT&lt;/span&gt;    &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;          &lt;span class="c1"&gt;-- open | section | decision | question&lt;/span&gt;
  &lt;span class="n"&gt;target&lt;/span&gt;      &lt;span class="kt"&gt;TEXT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;                      &lt;span class="c1"&gt;-- section key, package id, question id&lt;/span&gt;
  &lt;span class="n"&gt;visitor_id&lt;/span&gt;  &lt;span class="kt"&gt;TEXT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;                      &lt;span class="c1"&gt;-- random, per browser, per document&lt;/span&gt;
  &lt;span class="n"&gt;created_at&lt;/span&gt;  &lt;span class="kt"&gt;INTEGER&lt;/span&gt; &lt;span class="k"&gt;NOT&lt;/span&gt; &lt;span class="kc"&gt;NULL&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;          &lt;span class="c1"&gt;-- server unix ms, never the client's&lt;/span&gt;
  &lt;span class="n"&gt;idem_key&lt;/span&gt;    &lt;span class="kt"&gt;TEXT&lt;/span&gt;    &lt;span class="k"&gt;UNIQUE&lt;/span&gt;              &lt;span class="c1"&gt;-- dedupes retries&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;INDEX&lt;/span&gt; &lt;span class="n"&gt;doc_events_doc_time&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;doc_events&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;doc_id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Five columns of payload, one of them a foreign key you enforce in application code. No user agent, no full IP, no referrer, no screen size. You will not use them, and they turn a small feature into a compliance question.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;UNIQUE&lt;/code&gt; on &lt;code&gt;idem_key&lt;/code&gt; is the piece people skip, and it is the reason their dashboards report 41 opens for one client. More on that below.&lt;/p&gt;

&lt;h2&gt;
  
  
  Unguessable URLs are a design problem, not a random call
&lt;/h2&gt;

&lt;p&gt;A public document link is a capability URL: whoever holds it can read the document. That has three consequences.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The slug must be unguessable.&lt;/strong&gt; Not &lt;code&gt;proposals/142&lt;/code&gt;, not &lt;code&gt;proposal-acme&lt;/code&gt;, not a hash of the client's email. A 128-bit random value encoded compactly is plenty:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;slug&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bytes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;buf&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getRandomValues&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Uint8Array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;bytes&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="c1"&gt;// URL-safe base32-ish alphabet, no vowels, no ambiguous chars&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="no"&gt;A&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'23456789abcdefghjkmnpqrstuvwxyz'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;''&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="n"&gt;buf&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="no"&gt;A&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="no"&gt;A&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;out&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using a restricted alphabet is a small courtesy: slugs get read aloud on phone calls and typed from screenshots. Dropping &lt;code&gt;0/o/1/l/i&lt;/code&gt; costs you a few bits and saves support time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It must not be enumerable through error behaviour.&lt;/strong&gt; A wrong slug and an archived slug should both return the same 404 page, with the same timing. Otherwise you have built an oracle for "does this client exist on this platform".&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It must be revocable without deleting the document.&lt;/strong&gt; A &lt;code&gt;revoked_at&lt;/code&gt; column that the public route checks is cheaper than teaching users to delete and re-create, and it gives you a clean "this link has been replaced" page.&lt;/p&gt;

&lt;p&gt;One more decision: make the slug case-insensitive on lookup (store lowercase, normalise input) because clients will re-type it from a printed page in caps.&lt;/p&gt;

&lt;h2&gt;
  
  
  Optional passwords, hashed properly
&lt;/h2&gt;

&lt;p&gt;Some documents should not be readable by anyone who finds the link in a forwarded email. Password protection is one checkbox and a fair amount of care:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Store a &lt;strong&gt;hash&lt;/strong&gt;, never the password, and hash with a slow KDF. In a Worker, &lt;code&gt;crypto.subtle.deriveBits&lt;/code&gt; with PBKDF2-SHA256 at a few hundred thousand iterations is available without dependencies.&lt;/li&gt;
&lt;li&gt;Compare in constant time. &lt;code&gt;crypto.subtle.timingSafeEqual&lt;/code&gt; exists in modern runtimes; if it does not, compare HMACs of both values rather than raw strings.&lt;/li&gt;
&lt;li&gt;Rate-limit attempts per document and per IP, and count failures in the same counter you use for everything else.&lt;/li&gt;
&lt;li&gt;Put the unlocked state in a short-lived signed cookie scoped to that document path — not in &lt;code&gt;localStorage&lt;/code&gt;, which every script on the page can read.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;bits&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;subtle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;deriveBits&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'PBKDF2'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;salt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;iterations&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;210_000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;hash&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'SHA-256'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;subtle&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;importKey&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'raw'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;enc&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;encode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;password&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'PBKDF2'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'deriveBits'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="mi"&gt;256&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And a warning that belongs in the product, not just the docs: a password protects against casual forwarding, not against a determined reader who can screenshot. Say so in the UI.&lt;/p&gt;

&lt;h2&gt;
  
  
  Capturing events without slowing the page
&lt;/h2&gt;

&lt;p&gt;The most common mistake is a blocking &lt;code&gt;fetch&lt;/code&gt; on every scroll event. The second most common is capturing nothing on the way out, because the browser is closing the tab.&lt;/p&gt;

&lt;p&gt;Two browser APIs do most of the work:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Beacon on unload-ish moments. Fires even if the page is closing.&lt;/span&gt;
&lt;span class="n"&gt;navigator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sendBeacon&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/api/t/d'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Blob&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;batch&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'application/json'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Same idea with fetch, where sendBeacon is unavailable.&lt;/span&gt;
&lt;span class="nb"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'/api/t/d'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'POST'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;keepalive&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="s1"&gt;'content-type'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'application/json'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;batch&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Batch events in memory and flush on a 10-second timer, on &lt;code&gt;visibilitychange&lt;/code&gt; to hidden, and on &lt;code&gt;pagehide&lt;/code&gt;. A batch is a handful of small objects, so one request covers a whole reading session.&lt;/p&gt;

&lt;p&gt;On the server, treat the payload as hostile:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Ignore any timestamp the client sends.&lt;/strong&gt; Stamp &lt;code&gt;created_at&lt;/code&gt; server-side. Client clocks are wrong, and a wrong clock will silently break every "last opened" query.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Validate the event name and target against an allowlist.&lt;/strong&gt; Otherwise your table becomes a free-form message board.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Derive &lt;code&gt;doc_id&lt;/code&gt; from the slug in the URL, not from the body.&lt;/strong&gt; A client-supplied document id is an invitation to write events into someone else's document.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rate-limit per document and per visitor id.&lt;/strong&gt; A public endpoint that writes rows is a target.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Deduplication, because networks lie
&lt;/h2&gt;

&lt;p&gt;Mobile networks retry. Beacons get sent twice. Users open the same link in three tabs. Without deduplication, your "opened 6 times" is really "opened twice and retried four times".&lt;/p&gt;

&lt;p&gt;Give every event a client-generated idempotency key — a random string per event, not per batch — and let the unique constraint do the work:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;prepare&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="sb"&gt;`INSERT OR IGNORE INTO doc_events (doc_id, event, target, visitor_id, created_at, idem_key)
   VALUES (?, ?, ?, ?, ?, ?)`&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;bind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;docId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ev&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ev&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;target&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;visitorId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;ev&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A session is then a derived concept, not a stored one: events grouped by &lt;code&gt;visitor_id&lt;/code&gt; with gaps over 30 minutes split into separate sessions. You can change that threshold later without migrating anything.&lt;/p&gt;

&lt;h2&gt;
  
  
  Section reach, cheaply
&lt;/h2&gt;

&lt;p&gt;"How far did they read" sounds like it needs scroll-depth tracking and a heatmap. It needs one &lt;code&gt;IntersectionObserver&lt;/code&gt; on the section headings:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;reached&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Set&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;seen&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Map&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;number&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;io&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;IntersectionObserver&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;entries&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="n"&gt;entries&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;isIntersecting&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;continue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;target&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nc"&gt;HTMLElement&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dataset&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;section&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;reached&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;seen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;seen&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nf"&gt;queue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'section'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;target&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;randomUUID&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;rootMargin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'0px 0px -40% 0px'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;el&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;querySelectorAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'[data-section]'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;io&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;observe&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;el&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The negative bottom margin is the important detail: a section counts as reached when the reader is genuinely in it, not when it first touches the bottom of the viewport. Without it, fast scrolling marks everything as read and the data becomes useless.&lt;/p&gt;

&lt;p&gt;This also gives you the two most actionable signals in the whole product:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Where reading stops.&lt;/strong&gt; If most readers never reach the timeline, the timeline is not the problem — the section before it is.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What gets expanded.&lt;/strong&gt; If three readers open the same FAQ, that answer should move out of the FAQ and into the body of the document.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Turning rows into something a human reads
&lt;/h2&gt;

&lt;p&gt;Raw events are not a dashboard. One aggregate query per document is enough:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;
  &lt;span class="nb"&gt;COUNT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;DISTINCT&lt;/span&gt; &lt;span class="n"&gt;visitor_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;                                &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;visitors&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nb"&gt;SUM&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;CASE&lt;/span&gt; &lt;span class="k"&gt;WHEN&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'open'&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;ELSE&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="k"&gt;END&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;           &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;opens&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nb"&gt;MAX&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;created_at&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;                                           &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;last_seen&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="no"&gt;GROUP_CONCAT&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;DISTINCT&lt;/span&gt; &lt;span class="k"&gt;CASE&lt;/span&gt; &lt;span class="k"&gt;WHEN&lt;/span&gt; &lt;span class="n"&gt;event&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'decision'&lt;/span&gt; &lt;span class="k"&gt;THEN&lt;/span&gt; &lt;span class="n"&gt;target&lt;/span&gt; &lt;span class="k"&gt;END&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;AS&lt;/span&gt; &lt;span class="n"&gt;decisions&lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;doc_events&lt;/span&gt;
&lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;doc_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="k"&gt;AND&lt;/span&gt; &lt;span class="n"&gt;created_at&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then two derived numbers worth showing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Section depth&lt;/strong&gt;: the furthest section key, mapped to its index in the document's own section order. "Reached Pricing" is meaningful to the freelancer; "scrollTop 1840" is not.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Time on the document&lt;/strong&gt;: sum of session durations, capped. A tab left open overnight is not engagement, and showing "4h 12m" makes the whole feature look broken.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;What &lt;em&gt;not&lt;/em&gt; to show: a live feed of every click, a "hot lead" score, or a notification when the client opens the page. That last one is the fastest way to make a client feel watched. If you must notify, notify once, with a delay, and never with a timestamp the client could correlate to their own session.&lt;/p&gt;

&lt;h2&gt;
  
  
  Retention is part of the schema
&lt;/h2&gt;

&lt;p&gt;The trap with hosted documents is assuming they live forever. They do not: plans change, storage costs money, and a document that was true in March is a liability in December.&lt;/p&gt;

&lt;p&gt;The design that has held up:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The document is rented; the client record is owned.&lt;/strong&gt; The CRM row survives when the document expires, because the relationship is not the file.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Expiry is a column, not a cron-only concept.&lt;/strong&gt; &lt;code&gt;expires_at&lt;/code&gt; drives the public route, so an expired link returns a clear page rather than a 500 when the cleanup job has not run.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A PDF is sent before deletion.&lt;/strong&gt; Not as a courtesy — as the escape hatch that makes deletion acceptable in the first place.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deletion cascades&lt;/strong&gt;, including events. Orphaned analytics on a deleted document is the kind of data you do not want to explain later.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In a Worker, the cleanup is a cron trigger running one statement per table; the interesting part is the email that goes out a week before, not the code that deletes.&lt;/p&gt;

&lt;h2&gt;
  
  
  The pitfalls that eat a weekend
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Symptom&lt;/th&gt;
&lt;th&gt;Cause&lt;/th&gt;
&lt;th&gt;Fix&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Opens far higher than real readers&lt;/td&gt;
&lt;td&gt;Email security scanners and chat link previews fetch URLs&lt;/td&gt;
&lt;td&gt;Treat a request without a JS beacon follow-up (or with a known scanner agent) as not a reader&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Every event has the same timestamp&lt;/td&gt;
&lt;td&gt;Client clock used instead of server time&lt;/td&gt;
&lt;td&gt;Stamp server-side, always&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Duplicates on flaky networks&lt;/td&gt;
&lt;td&gt;No idempotency key&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;UNIQUE&lt;/code&gt; on a client-generated key&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Mobile sessions look 4 seconds long&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;sendBeacon&lt;/code&gt; fired on &lt;code&gt;beforeunload&lt;/code&gt;, which iOS may skip&lt;/td&gt;
&lt;td&gt;Flush on &lt;code&gt;visibilitychange&lt;/code&gt; to hidden as well&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Events attributed to the wrong document&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;doc_id&lt;/code&gt; read from the payload&lt;/td&gt;
&lt;td&gt;Derive it from the slug&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;"4h 12m on the document"&lt;/td&gt;
&lt;td&gt;Background tab counted as reading&lt;/td&gt;
&lt;td&gt;Cap session duration; split on 30-minute gaps&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;That first row is the one that surprises people. A large share of "opens" on any link sent by email are machines pre-fetching it. If you do not separate a fetch from a reader, your most-engaged client is a spam filter.&lt;/p&gt;

&lt;h2&gt;
  
  
  What this costs to run
&lt;/h2&gt;

&lt;p&gt;Four events per session, a few sessions per document, a handful of documents per client. This is a rounding error next to the static assets it serves, and it fits comfortably in a single SQLite-backed edge database with an index on &lt;code&gt;(doc_id, created_at)&lt;/code&gt;. The public document route can be cached at the edge; the tracking endpoint cannot, and should be the only uncached thing in the system.&lt;/p&gt;

&lt;h2&gt;
  
  
  The honest limits
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;You cannot tell who is reading, only that someone is.&lt;/strong&gt; A forwarded link looks identical to the client reading it. Do not pretend otherwise in the UI.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reading time is a proxy, not attention.&lt;/strong&gt; Someone reading on a train with the page open and their phone in their pocket will beat your best client on every metric.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tracking is not a substitute for a decision.&lt;/strong&gt; The useful output is a better sentence in your next message, not a score.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Privacy rules still apply.&lt;/strong&gt; Event data on a client document is personal data in most jurisdictions. Know your retention window before you collect the first row.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The takeaway
&lt;/h2&gt;

&lt;p&gt;You need four events, a unique key, server timestamps, and a slug nobody can guess. Everything else is presentation. If you keep the schema small and honest, the tracking becomes a feature clients never notice — which is exactly what you want from it.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;I build &lt;a href="https://revercue.co.uk/?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=tracked_links" rel="noopener noreferrer"&gt;Revercue&lt;/a&gt;, which treats proposals, contracts, forms and invoices as tracked links on one client thread, with a free plan you can try on a real client without a card. The tracking is deliberately boring: four events, a section depth, and a decision. If you have built something similar differently, I would like to compare notes on the dedupe strategy.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>architecture</category>
      <category>saas</category>
    </item>
    <item>
      <title>Designing a proposal page your client will actually read</title>
      <dc:creator>Revercue </dc:creator>
      <pubDate>Fri, 27 Nov 2026 12:52:15 +0000</pubDate>
      <link>https://dev.to/revercue/designing-a-proposal-page-your-client-will-actually-read-33ig</link>
      <guid>https://dev.to/revercue/designing-a-proposal-page-your-client-will-actually-read-33ig</guid>
      <description>&lt;p&gt;Most proposals are sent as a PDF, and most PDFs get opened once, scrolled to the price, and closed. That is not a client being rude. It is a client doing exactly what a dead file invites: reading in a hurry, with no way to ask anything without composing an email.&lt;/p&gt;

&lt;p&gt;I have spent the last year building a proposal tool whose entire premise is that the client-facing document should be &lt;strong&gt;a page&lt;/strong&gt;, not a file. Not because pages are fashionable, but because four specific things become possible on a page that are impossible in a PDF:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You can see what was read.&lt;/li&gt;
&lt;li&gt;The client can ask a question from inside the document.&lt;/li&gt;
&lt;li&gt;You can fix a typo after sending.&lt;/li&gt;
&lt;li&gt;The document can carry state (which package was selected, which answers were given).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This post is about the design of that page: the reading order, the block structure, the places clients get stuck, and what to measure. It is mostly product-design advice with a bit of markup, so it applies whether you build it yourself, use a tool, or just improve the proposal template you already have.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start from the client's four questions
&lt;/h2&gt;

&lt;p&gt;A client reading a proposal is not evaluating your prose. They are trying to answer four questions, roughly in this order:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Can I trust this person to not waste my money?&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What exactly do I get, and what do I not get?&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What does it cost, and what happens if it changes?&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What do I have to do next, and by when?&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Most proposals answer these in the order &lt;em&gt;you&lt;/em&gt; find natural: about me, my process, my philosophy, then scope, then price buried on page six. That order fights the reader.&lt;/p&gt;

&lt;p&gt;The fix is not to delete your context. It is to make the four answers reachable in the first screen and a half, then let the reader go deeper if they want. Concretely, the top of the document should contain:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One sentence naming the client's problem in their own words.&lt;/li&gt;
&lt;li&gt;One sentence naming the outcome you are buying them.&lt;/li&gt;
&lt;li&gt;A one-line price anchor ("from 2,500, three options below").&lt;/li&gt;
&lt;li&gt;A single primary action ("Choose a package", "Approve", "Book the kickoff").&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everything else — the story of your studio, the case studies, the detailed terms — is supporting material for a reader who is already interested. Put it after.&lt;/p&gt;

&lt;h2&gt;
  
  
  The block model does the heavy lifting
&lt;/h2&gt;

&lt;p&gt;If you are building this yourself, resist the urge to make the proposal a rich-text blob. A blob is easy to write and impossible to restructure, restyle, or measure.&lt;/p&gt;

&lt;p&gt;A block model is barely more work and pays for itself immediately:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nc"&gt;Block&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;
  &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'heading'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;level&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'paragraph'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'list'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;ordered&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;boolean&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'callout'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;tone&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'info'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="s1"&gt;'warn'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'packages'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;currency&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;options&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Package&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'faq'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;q&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'questions'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;items&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nc"&gt;Question&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'nextStep'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;label&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;href&lt;/span&gt;&lt;span class="o"&gt;?:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nc"&gt;Package&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;price&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;number&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;summary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;excludes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="n"&gt;recommended&lt;/span&gt;&lt;span class="o"&gt;?:&lt;/span&gt; &lt;span class="kt"&gt;boolean&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With that shape you get four things for free. You can render the same document as a page, as a print stylesheet, and as a summary email. You can reorder sections with a drag handle instead of rewriting text. You can diff two versions. And you can attach behaviour to a block type — the packages block is selectable, the faq block is expandable — without parsing prose.&lt;/p&gt;

&lt;p&gt;One rule I would keep: &lt;strong&gt;the proposal's visual design belongs to the template, not the block&lt;/strong&gt;. The block says "this is a heading"; the template decides the font, size, spacing and colour. Otherwise every proposal looks like a different product.&lt;/p&gt;

&lt;h2&gt;
  
  
  Packages: the table that decides the deal
&lt;/h2&gt;

&lt;p&gt;If there is one screen in the whole document that earns its keep, it is the package comparison. Three things make it work, and all three are honesty, not persuasion.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Anchor with a real number.&lt;/strong&gt; "From 2,500" is a fact the reader can hold. "Flexible pricing" is a reason to close the tab.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Write the excludes column.&lt;/strong&gt; Every freelancer I know has had the conversation where the client assumed hosting, copywriting, or a second language was included. That conversation costs more than the package design. An explicit "not included" list is the cheapest scope protection you will ever write:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'std'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Standard'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;price&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;4200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;summary&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Design, build and launch a five-page site.'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;includes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'Design system'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'5 pages'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'CMS setup'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'2 rounds of revisions'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;excludes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'Copywriting'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Photography'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Hosting fees'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Ongoing maintenance'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Do not fake the middle option.&lt;/strong&gt; The "most popular" badge is the oldest trick in pricing pages and clients recognise it instantly. If you genuinely recommend one option, say why in one sentence ("best fit if you want the launch handled end to end"). If you do not, leave it off.&lt;/p&gt;

&lt;p&gt;When a package is chosen, the selection should be a real event, not a mailto link. The client clicks Standard, you get "Standard selected, 14:32, 41 seconds on this section" — and the follow-up writes itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQs are objection handling, dressed as help
&lt;/h2&gt;

&lt;p&gt;Every proposal gets the same six questions. What if the project runs late? Who owns the design files? What happens if I need changes after launch? Can I pay in two instalments? Do you work with our CMS? What do you need from me?&lt;/p&gt;

&lt;p&gt;Answering them in the document does two things at once: it removes your fastest repeat work, and it removes the client's reason to go quiet. A client with an unanswered question is not deciding — they are procrastinating on writing an email.&lt;/p&gt;

&lt;p&gt;Two implementation details matter:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Collapsed by default, with the question visible.&lt;/strong&gt; The client should scan six questions in two seconds. Expanding is a signal, and it is worth recording: if three people open "What if the project runs late?", your timeline section is the thing to fix.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Answer in plain sentences, not legal clauses.&lt;/strong&gt; Save the clause for the contract. The FAQ is there to make the reader comfortable enough to buy.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Embedded questions: stop guessing
&lt;/h2&gt;

&lt;p&gt;A PDF cannot ask anything. A form asks everything at once and feels like homework. A page can ask three questions, in context, at the moment they matter:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"Which of these is closest to your deadline?" with real options.&lt;/li&gt;
&lt;li&gt;"Who signs off on the final design?" — the question that prevents the three-reviewer problem.&lt;/li&gt;
&lt;li&gt;"Anything we should know before we start?" — optional, long text, usually the most useful answer in the document.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Three rules keep this from becoming friction:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Optional unless it blocks the work.&lt;/strong&gt; Required fields are for the contract, not the proposal.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Answers land in the same record as the document.&lt;/strong&gt; If the answer arrives in an email, you have re-created the problem you were solving.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ask once.&lt;/strong&gt; The document, the contract, and the requirements form should share one client record so the client is never asked the same thing twice.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The reading order problem on mobile
&lt;/h2&gt;

&lt;p&gt;Half of your clients will open the link on a phone, in a queue, with one thumb. That single fact should change the layout:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Packages stack vertically as cards, not as a horizontally scrolling table. Sideways scrolling on a comparison is where decisions go to die.&lt;/li&gt;
&lt;li&gt;The primary action is reachable without scrolling to the bottom: one sticky footer button on mobile is legitimate, not pushy.&lt;/li&gt;
&lt;li&gt;Minimum 16px body text and 44px touch targets. A proposal read at 13px looks like a newsletter.&lt;/li&gt;
&lt;li&gt;No hover-only affordances. Every tooltip needs a tap equivalent, or it does not exist on the device where the decision happens.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Typography choices that make it read as a document
&lt;/h2&gt;

&lt;p&gt;Three small decisions separate "a page someone made" from "a document I should take seriously":&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;One measure.&lt;/strong&gt; Body text between 60 and 75 characters per line. Full-width paragraphs on a 27-inch monitor are unreadable and look careless.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A real hierarchy.&lt;/strong&gt; If your headings and body text are two shades of the same weight, the reader cannot skim, and skimming is how proposals get read.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Restraint in the accent colour.&lt;/strong&gt; One accent, used for the action and the price. If everything is highlighted, nothing is.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Keep the print view
&lt;/h2&gt;

&lt;p&gt;A page is better than a PDF, but clients still forward PDFs to finance, legal, or a boss who wants it in an email thread. Ship the print stylesheet on day one:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="k"&gt;@media&lt;/span&gt; &lt;span class="nt"&gt;print&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nc"&gt;.no-print&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nc"&gt;.document&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;max-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;none&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;11pt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nl"&gt;a&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="n"&gt;after&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;" ("&lt;/span&gt; &lt;span class="nf"&gt;attr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;href&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="s2"&gt;")"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;9pt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nc"&gt;.package&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;break-inside&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;avoid&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="n"&gt;h2&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;break-after&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;avoid&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two lines are doing most of the work there: &lt;code&gt;break-inside: avoid&lt;/code&gt; on the packages, and printing the URL after each link, because a printed page loses its links. A ten-line print stylesheet has saved more client relationships than most redesigns.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to measure, and what not to
&lt;/h2&gt;

&lt;p&gt;Once you own the page, you get activity data. The temptation is to instrument everything, build a dashboard, and start optimising. Do not. Three events are enough to change how you follow up:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Event&lt;/th&gt;
&lt;th&gt;What it tells you&lt;/th&gt;
&lt;th&gt;What to do with it&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Opened&lt;/td&gt;
&lt;td&gt;The document arrived and was not filtered to spam&lt;/td&gt;
&lt;td&gt;Nothing on the first open. Something if there is no second open after three days&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Section reached&lt;/td&gt;
&lt;td&gt;Where reading stopped&lt;/td&gt;
&lt;td&gt;If everyone stops before the timeline, the timeline is the problem&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Package selected&lt;/td&gt;
&lt;td&gt;A decision happened, with or without a reply&lt;/td&gt;
&lt;td&gt;Follow up about the selected package specifically, not "checking in"&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;And two things not to do: do not show the client a "seen 14:32" receipt like a messaging app, and do not turn reading time into a leaderboard of who is "hot". The point of the data is to make your next message specific. "You spent a while on Standard — want me to trim Premium so the comparison is simpler?" is a good follow-up. "I see you have opened this five times" is surveillance.&lt;/p&gt;

&lt;h2&gt;
  
  
  The honest limits
&lt;/h2&gt;

&lt;p&gt;A page does not fix a bad offer, and it does not make a client decide faster than they can. It also introduces its own costs: links can expire, clients can lose them, and a hosted page needs to stay up for as long as the deal is live. If your document lives on a platform, you are renting that permanence, and you should know the retention terms before you send anything.&lt;/p&gt;

&lt;p&gt;Some clients will still ask for a PDF. Send it — and send the link too, because the PDF cannot collect the answer.&lt;/p&gt;

&lt;h2&gt;
  
  
  The short version
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Lead with the client's four questions, not your biography.&lt;/li&gt;
&lt;li&gt;Model the document as blocks so it can be rendered, restyled, and measured.&lt;/li&gt;
&lt;li&gt;Three packages, real numbers, an explicit exclusions column, no fake badge.&lt;/li&gt;
&lt;li&gt;FAQs collapsed and countable; they are objection handling.&lt;/li&gt;
&lt;li&gt;Ask three questions in context instead of guessing.&lt;/li&gt;
&lt;li&gt;Stack packages on mobile and keep one sticky action.&lt;/li&gt;
&lt;li&gt;Ship the print stylesheet.&lt;/li&gt;
&lt;li&gt;Track opened, section reached, package selected — nothing more.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The page is not a gimmick. It is the smallest change that turns a document you send into a conversation you can follow.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;I build &lt;a href="https://revercue.co.uk/?utm_source=devto&amp;amp;utm_medium=article&amp;amp;utm_campaign=proposal_page_design" rel="noopener noreferrer"&gt;Revercue&lt;/a&gt;, which renders proposals, contracts, forms and invoices as tracked links on one client thread. The Free plan is available now — 5 active documents, no card required — so you can see the client view without committing to anything. If your setup differs, I would rather hear where this breaks than get a signup.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>design</category>
      <category>freelance</category>
      <category>productivity</category>
    </item>
    <item>
      <title>The freelance paper trail: keeping a project from proposal to payment without losing the thread</title>
      <dc:creator>Revercue </dc:creator>
      <pubDate>Wed, 25 Nov 2026 11:38:27 +0000</pubDate>
      <link>https://dev.to/revercue/the-freelance-paper-trail-keeping-a-project-from-proposal-to-payment-without-losing-the-thread-274d</link>
      <guid>https://dev.to/revercue/the-freelance-paper-trail-keeping-a-project-from-proposal-to-payment-without-losing-the-thread-274d</guid>
      <description>&lt;p&gt;A freelance project rarely dies loudly. It dies in the gap between &lt;em&gt;"sounds good, send it over"&lt;/em&gt; and the money arriving. The proposal lives in a DM, the scope was agreed on a call, the contract is a PDF nobody opened, and the invoice is in a different app with a different client name on it.&lt;/p&gt;

&lt;p&gt;I have been on both sides of that gap, and I have watched perfectly good projects stall for reasons that had nothing to do with the work. So here is the workflow I would hand to any developer going freelance, plus the parts most people skip.&lt;/p&gt;

&lt;h2&gt;
  
  
  The gap is not a communication problem
&lt;/h2&gt;

&lt;p&gt;When a project stalls after the proposal, it is tempting to blame the client. Usually the client is just busy, and busy people do not chase documents. The failure is structural:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The proposal was a file, so you cannot tell whether it was opened, or which package they were looking at when they went quiet.&lt;/li&gt;
&lt;li&gt;The scope was agreed verbally, so two people remember two different projects.&lt;/li&gt;
&lt;li&gt;The requirements arrived across fourteen messages, three of which you cannot find now.&lt;/li&gt;
&lt;li&gt;The invoice went to your contact, not to whoever actually pays invoices.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of those are dramatic. Together they turn a four-week project into a six-week one, or into one you quietly stop chasing.&lt;/p&gt;

&lt;h2&gt;
  
  
  The six artefacts every project actually needs
&lt;/h2&gt;

&lt;p&gt;Not six tools. Six artefacts. They can live in one place, but each one has a job, and if any is missing you will feel it later.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Artefact&lt;/th&gt;
&lt;th&gt;Its one job&lt;/th&gt;
&lt;th&gt;What people forget&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Proposal&lt;/td&gt;
&lt;td&gt;Get a decision&lt;/td&gt;
&lt;td&gt;An expiry date, and what is &lt;em&gt;not&lt;/em&gt; included&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Contract&lt;/td&gt;
&lt;td&gt;Make the deal enforceable&lt;/td&gt;
&lt;td&gt;Payment schedule, revision limit, who owns the work before final payment&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Requirements form&lt;/td&gt;
&lt;td&gt;Collect the inputs once&lt;/td&gt;
&lt;td&gt;Naming the person who approves, and the person who pays&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Change request&lt;/td&gt;
&lt;td&gt;Price the extra work before doing it&lt;/td&gt;
&lt;td&gt;Your own signature line — the client is not the only one who can be vague&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Invoice&lt;/td&gt;
&lt;td&gt;Get paid without a chase&lt;/td&gt;
&lt;td&gt;A reference the client's finance team recognises&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Client record&lt;/td&gt;
&lt;td&gt;Answer "what did we agree?" in under a minute&lt;/td&gt;
&lt;td&gt;Writing it down at all&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;That last row is the one people skip, and it is the one you will want in month six.&lt;/p&gt;

&lt;h2&gt;
  
  
  A link is not a PDF
&lt;/h2&gt;

&lt;p&gt;This is the smallest change with the largest effect.&lt;/p&gt;

&lt;p&gt;A PDF is a dead file. You send it, you wait, and you learn nothing until the client replies. A link is a page you control. You can see whether it was opened, you can fix a typo without resending anything, and the client can answer a question without composing an email.&lt;/p&gt;

&lt;p&gt;That difference matters most at the exact moment projects go quiet — the day after you send the proposal. With a PDF your only move is "just checking in". With a link you can say something specific: &lt;em&gt;"I saw you spent a while on the Standard package — want me to trim the Premium option so the comparison is simpler?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;You do not need a product for this. A Notion page or a Google Doc with link sharing gets you halfway. What you lose is the record of who opened what, and the ability to collect an answer in the same place.&lt;/p&gt;

&lt;h2&gt;
  
  
  The follow-up cadence that does not read as nagging
&lt;/h2&gt;

&lt;p&gt;Most freelancers follow up zero times or five times. Neither works. Four touches, each with a different job:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;When&lt;/th&gt;
&lt;th&gt;Job of the message&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Day 0&lt;/td&gt;
&lt;td&gt;Set the reading time&lt;/td&gt;
&lt;td&gt;"Link below. It's about a six-minute read, and the packages are on one page so you can compare them."&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Day 2&lt;/td&gt;
&lt;td&gt;Remove a blocker&lt;/td&gt;
&lt;td&gt;"One thing that trips people up: the timeline starts from the deposit, not from signing. Happy to hold the slot until Friday."&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Day 5&lt;/td&gt;
&lt;td&gt;Give them a clean exit&lt;/td&gt;
&lt;td&gt;"If the timing is wrong, say so and I'll park this until [month] rather than keep nudging you."&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Day 10&lt;/td&gt;
&lt;td&gt;Close the loop&lt;/td&gt;
&lt;td&gt;"Closing the file for now. If it comes back onto your list, the link still works."&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Two things make this work. First, each message adds information — a constraint, an option, a deadline — instead of asking for attention. Second, the last message genuinely releases them. A follow-up that says "closing this" gets replies, because it removes the guilt of an unanswered thread.&lt;/p&gt;

&lt;h2&gt;
  
  
  A four-week project, traced
&lt;/h2&gt;

&lt;p&gt;Here is what the trail looks like when nothing is dramatic:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Week 0&lt;/strong&gt; — discovery call. Same day: a one-page recap of what you heard, what you are assuming, and what you are not doing. Send it before the proposal, not with it. Corrections are cheap here.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Week 0&lt;/strong&gt; — proposal with two or three packages, an expiry date, and an explicit exclusions line.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Week 1&lt;/strong&gt; — contract. Deposit invoice goes out the same day, not after the kickoff call.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Week 1&lt;/strong&gt; — requirements form: brand assets, hosting and domain access, who signs off each stage, the real deadline driver, and the billing contact.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Weeks 2–3&lt;/strong&gt; — work. Anything outside the agreed scope gets a change request with hours and a price, sent &lt;em&gt;before&lt;/em&gt; the work starts. One paragraph, one number, one approval line.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Week 4&lt;/strong&gt; — final invoice against the milestone in the contract, with the reference the client's finance team already has.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The requirement form is doing quiet heavy lifting. Half the "difficult client" stories I hear are really "we never established who approves, and now three people are reviewing".&lt;/p&gt;

&lt;h2&gt;
  
  
  If you want the thread as data
&lt;/h2&gt;

&lt;p&gt;Developers tend to relax when the trail is a file they own. A project record can be this small:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"client"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Acme Co"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"reference"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"REF-8KP92"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"stages"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"doc"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"proposal"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"selected"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"package"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Standard"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"doc"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"contract"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"approved"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"date"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"2026-11-14"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"doc"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"requirements"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"submitted"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"missing"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"domain access"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"doc"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"change-request-01"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"approved"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"hours"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"doc"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"invoice-0042"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"sent"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"due"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"2026-12-12"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You do not need to build this. But if you cannot fill in that structure for your current projects from memory or in one search, that is the actual audit result: the record is in your head, and your head is busy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Audit your last five projects
&lt;/h2&gt;

&lt;p&gt;Six questions. Answer them honestly and in under a minute each:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Can you find the agreed scope in under a minute?&lt;/li&gt;
&lt;li&gt;Do you know who approved it, and on what date?&lt;/li&gt;
&lt;li&gt;Can you tell which version you sent last?&lt;/li&gt;
&lt;li&gt;Do you know when the invoice was sent, and when it was paid?&lt;/li&gt;
&lt;li&gt;Can you list everything you promised verbally that is not in the contract?&lt;/li&gt;
&lt;li&gt;If the client's finance team asked for a copy of the invoice tomorrow, would you have to search?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Any "no" is a document you are reconstructing, not maintaining.&lt;/p&gt;

&lt;h2&gt;
  
  
  The honest tooling options
&lt;/h2&gt;

&lt;p&gt;There are four routes, and none of them is wrong:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Docs, PDFs and a spreadsheet.&lt;/strong&gt; Free, flexible, zero lock-in. You lose open tracking and the single record, and you will maintain the discipline yourself.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;An all-in-one freelance platform.&lt;/strong&gt; Bundled contracts, invoices and accounting. Often heavier than a solo developer needs, and priced per seat when you add help.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Build it yourself.&lt;/strong&gt; Full control, and you will own the maintenance forever. Fine if the workflow is the product; expensive if it is not.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A link-based document thread.&lt;/strong&gt; One link per client, holding the proposal, contract, requirements form and invoice, with the client record attached.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I am building the fourth one, so discount my bias accordingly. &lt;a href="https://revercue.co.uk" rel="noopener noreferrer"&gt;Revercue&lt;/a&gt; keeps those documents as interactive links rather than PDFs — you see when a proposal was opened, which FAQ was expanded, which package was selected, and the contract can be approved, declined or questioned from the page. There is a free plan with five active documents, and paid plans from $12/month. Its limits are worth knowing up front: it does not process card payments, it is not a shared file drive, it does not integrate with your inbox, calendar or accounting software, and there is no public API. It also does not replace a lawyer's contract review.&lt;/p&gt;

&lt;p&gt;If you already have a workflow that works, keep it. The point of this post is the trail, not the tool.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I would do this week
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Write the one-page recap you send before every proposal. It takes twenty minutes and kills most scope arguments before they start.&lt;/li&gt;
&lt;li&gt;Add an exclusions line and an expiry date to your proposal template.&lt;/li&gt;
&lt;li&gt;Add two fields to whatever collects requirements: &lt;em&gt;who approves this&lt;/em&gt;, and &lt;em&gt;who pays the invoice&lt;/em&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That is it. No new software required — though if the trail is the thing that keeps breaking, that is usually the signal to stop rebuilding it by hand.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;I build Revercue, a tool for keeping client documents on one thread. Feedback on the workflow above is more useful to me than signups — if your setup differs, I would like to hear where it breaks.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>freelance</category>
      <category>productivity</category>
      <category>career</category>
      <category>saas</category>
    </item>
  </channel>
</rss>
