<?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: Ahmed Memon</title>
    <description>The latest articles on DEV Community by Ahmed Memon (@ahmed_memon_f17e868877740).</description>
    <link>https://dev.to/ahmed_memon_f17e868877740</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%2F4061807%2Fc7f83f6f-1ff2-4df6-a1f8-4d7972f1cad7.png</url>
      <title>DEV Community: Ahmed Memon</title>
      <link>https://dev.to/ahmed_memon_f17e868877740</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ahmed_memon_f17e868877740"/>
    <language>en</language>
    <item>
      <title>I built an invoice generator with no backend — the whole app is one HTML file</title>
      <dc:creator>Ahmed Memon</dc:creator>
      <pubDate>Tue, 04 Aug 2026 13:00:00 +0000</pubDate>
      <link>https://dev.to/ahmed_memon_f17e868877740/i-built-an-invoice-generator-with-no-backend-the-whole-app-is-one-html-file-1j1g</link>
      <guid>https://dev.to/ahmed_memon_f17e868877740/i-built-an-invoice-generator-with-no-backend-the-whole-app-is-one-html-file-1j1g</guid>
      <description>&lt;p&gt;Every invoicing tool I tried wanted an account, a subscription, and a copy of my client list on its servers — then charged me monthly to put my own logo on my own invoice.&lt;/p&gt;

&lt;p&gt;So I built the opposite. &lt;strong&gt;&lt;a href="https://billfold.io" rel="noopener noreferrer"&gt;Billfold&lt;/a&gt;&lt;/strong&gt; is a complete invoice generator that runs entirely in your browser. No account, no backend, no build step. The whole app is a single &lt;code&gt;index.html&lt;/code&gt; file you could email to yourself. It's MIT-licensed and the source is right here: &lt;a href="https://github.com/quantum-hacker0/billfold" rel="noopener noreferrer"&gt;github.com/quantum-hacker0/billfold&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here are the three parts that were actually fun to build.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. "No server" isn't a privacy policy — it's the architecture
&lt;/h2&gt;

&lt;p&gt;The usual pitch is "we take your privacy seriously." That's a promise you have to trust. I wanted it to be a &lt;em&gt;fact you can verify&lt;/em&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Open DevTools → Network, create an invoice, and count the requests. It's zero.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;There's nothing to upload because there's nowhere to upload it. Data lives in &lt;code&gt;localStorage&lt;/code&gt;. The app is HTML/CSS/JS inlined into one file — no framework, no bundler, no &lt;code&gt;node_modules&lt;/code&gt;. Download it once and it works offline forever.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Sharing an invoice without a database — put it in the URL hash
&lt;/h2&gt;

&lt;p&gt;This was the interesting constraint. How do you send someone a view-only invoice when you have no server to store it on?&lt;/p&gt;

&lt;p&gt;The trick: encode the whole document into the URL &lt;strong&gt;hash fragment&lt;/strong&gt;. The fragment (everything after &lt;code&gt;#&lt;/code&gt;) is the one part of a URL that browsers &lt;strong&gt;never send to the server&lt;/strong&gt; — it stays client-side.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;shareLink&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;state&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="nx"&gt;json&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&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="nx"&gt;state&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;encoded&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;btoa&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;unescape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;encodeURIComponent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt;
    &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="se"&gt;\+&lt;/span&gt;&lt;span class="sr"&gt;/g&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;-&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="se"&gt;\/&lt;/span&gt;&lt;span class="sr"&gt;/g&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;_&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/=+$/&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// base64url&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;origin&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;pathname&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#v=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;encoded&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 recipient's browser reads the fragment, decodes it, and renders the invoice locally. The data rides &lt;em&gt;inside the link&lt;/em&gt; and never touches a host — not even mine. PDF export, by the way, is just &lt;code&gt;window.print()&lt;/code&gt; with a print stylesheet.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Invoices as URLs — with an npm package
&lt;/h2&gt;

&lt;p&gt;Because the app reads its state from query params, a prefilled invoice is just a URL:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://billfold.io/app/?cur=USD&amp;amp;to=Acme+Co&amp;amp;item=Design+work|10|120
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That turned out to be genuinely useful — you can generate a ready-to-send invoice per customer straight from your own app or a spreadsheet. So I published a tiny zero-dependency helper to build those links safely (encoding, the &lt;code&gt;|&lt;/code&gt; field rule, negative lines for things like tax deductions):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;billfold-invoice-link
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;buildInvoiceLink&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;billfold-invoice-link&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;buildInvoiceLink&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;currency&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;USD&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;business&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Jordan Rivera Design&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;client&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Acme Co&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;items&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="na"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Landing page&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;quantity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;rate&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1800&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Revisions&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;quantity&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;rate&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;120&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;// → https://billfold.io/app/?cur=USD&amp;amp;biz=Jordan+Rivera+Design&amp;amp;to=Acme+Co&amp;amp;item=...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's typed and tested: &lt;a href="https://www.npmjs.com/package/billfold-invoice-link" rel="noopener noreferrer"&gt;npmjs.com/package/billfold-invoice-link&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bonus: license keys that verify offline
&lt;/h2&gt;

&lt;p&gt;The paid tier is a one-time unlock, and I didn't want an activation call either. Keys are signed server-side with an &lt;strong&gt;ECDSA P-256&lt;/strong&gt; private key; the app verifies them with the embedded public key via the Web Crypto API. So even &lt;em&gt;activating a license&lt;/em&gt; makes no network request, and a key can't be forged without the private key.&lt;/p&gt;

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

&lt;p&gt;Local-first isn't free. The thing you give up is &lt;strong&gt;cross-device sync&lt;/strong&gt; — your data is on the device you made it on. For an invoice tool I think that's the right trade (you export a PDF and send it anyway), but it's a real limitation.&lt;/p&gt;

&lt;p&gt;The only backend I'd ever add is &lt;em&gt;optional&lt;/em&gt; end-to-end-encrypted sync — and it would only ever see ciphertext, never your numbers. The "no server can read your data" property is the whole point; I'm not going to quietly break it.&lt;/p&gt;




&lt;p&gt;If a zero-server, single-file approach is your kind of thing, the source is one readable file: &lt;strong&gt;&lt;a href="https://github.com/quantum-hacker0/billfold" rel="noopener noreferrer"&gt;github.com/quantum-hacker0/billfold&lt;/a&gt;&lt;/strong&gt; (a ⭐ helps others find it), and the hosted version is at &lt;strong&gt;&lt;a href="https://billfold.io" rel="noopener noreferrer"&gt;billfold.io&lt;/a&gt;&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Happy to get into any of the local-first tradeoffs in the comments.&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>javascript</category>
      <category>webdev</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
