<?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: Pranav Chandra</title>
    <description>The latest articles on DEV Community by Pranav Chandra (@pcpranav).</description>
    <link>https://dev.to/pcpranav</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%2F583635%2F68bbbbb9-3946-4268-8879-34f132926d91.jpg</url>
      <title>DEV Community: Pranav Chandra</title>
      <link>https://dev.to/pcpranav</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pcpranav"/>
    <language>en</language>
    <item>
      <title>Encrypting everything in a notes app, and keeping sharing: the Nuo 2.</title>
      <dc:creator>Pranav Chandra</dc:creator>
      <pubDate>Wed, 11 Nov 2026 09:36:17 +0000</pubDate>
      <link>https://dev.to/pcpranav/encrypting-everything-in-a-notes-app-and-keeping-sharing-the-nuo-2-3fg8</link>
      <guid>https://dev.to/pcpranav/encrypting-everything-in-a-notes-app-and-keeping-sharing-the-nuo-2-3fg8</guid>
      <description>&lt;h1&gt;
  
  
  Encrypting everything in a notes app, and keeping sharing: the Nuo 2.0 key design
&lt;/h1&gt;

&lt;p&gt;&lt;em&gt;How a Next.js + Postgres notes app went from "one encrypted folder" to end-to-end encryption&lt;br&gt;
for every row, migrated existing users without downtime, and kept shared folders working. The&lt;br&gt;
product-side story is on Medium.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Nuo is a notes and tasks app: block editor, My Day, folders, sharing, Android and web, one&lt;br&gt;
person building it. Until this release it had one end-to-end encrypted folder per user, opt&lt;br&gt;
in, and everything else was plaintext in Postgres. Version 2.0 encrypts every note, task and&lt;br&gt;
folder name for every account, with sharing intact. This is the design, the migration, and&lt;br&gt;
the parts that bit.&lt;/p&gt;

&lt;h2&gt;
  
  
  The constraints
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Mandatory.&lt;/strong&gt; No plaintext tier, no opt-in. The copy "we can't read your notes" has to be
true for every account on day one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The server still has work to do.&lt;/strong&gt; Home, My Day, High priority and reminders are server
queries. They need dates, priorities and completion. Only the &lt;em&gt;words&lt;/em&gt; have to be hidden.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sharing survives.&lt;/strong&gt; A folder shared with someone must stay readable by them and
unreadable by the server, and un-sharing has to mean something.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Existing users migrate themselves&lt;/strong&gt;, because only their device can read their key, and
the app has to stay usable while it happens.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One person, no budget.&lt;/strong&gt; WebCrypto only, nothing paid.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Key hierarchy
&lt;/h2&gt;

&lt;p&gt;Three levels, all AES-256-GCM, all WebCrypto.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Master key.&lt;/strong&gt; 32 random bytes, generated at set-up, held in the browser as a&lt;br&gt;
non-extractable &lt;code&gt;CryptoKey&lt;/code&gt;. Three sealed copies live on the server, each useless without&lt;br&gt;
something the server doesn't have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;under a &lt;em&gt;wrap key&lt;/em&gt; derived from the Nuo password: PBKDF2-SHA256, 600,000 iterations, salted
with &lt;code&gt;SHA-256("nuo-login-v1:" + email)&lt;/code&gt;, 64 bytes out. Bytes 0 to 31 are the wrap key and
never leave the browser. Bytes 32 to 63, hex, are the &lt;em&gt;login secret&lt;/em&gt;, which is what the
auth provider receives as the password. One password, two independent uses, and the auth
server never sees the real one.&lt;/li&gt;
&lt;li&gt;under a random 32-byte &lt;em&gt;recovery code&lt;/em&gt; that goes out in an email as a URL fragment. The
server stores the sealed copy and forgets the code.&lt;/li&gt;
&lt;li&gt;optionally, under a key derived (HKDF) from a passkey's PRF output, for fingerprint unlock.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The 24 recovery words are BIP-39 over the master key bytes themselves. No fourth copy.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Folder keys.&lt;/strong&gt; One random AES key per top-level folder, sealed under the owner's master key&lt;br&gt;
in a &lt;code&gt;folder_keys&lt;/code&gt; table. The master key is non-extractable with encrypt/decrypt usages, so a&lt;br&gt;
folder key is bytes the master key encrypts, not a WebCrypto &lt;code&gt;wrapKey&lt;/code&gt;; unwrapping is decrypt&lt;br&gt;
then &lt;code&gt;importKey&lt;/code&gt; as non-extractable. They're cached in memory for the session and dropped on&lt;br&gt;
lock.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rows.&lt;/strong&gt; Every task, note, list and folder has a &lt;code&gt;ciphertext&lt;/code&gt; + &lt;code&gt;iv&lt;/code&gt; pair sealed under its&lt;br&gt;
folder's key, with a &lt;code&gt;payload_version&lt;/code&gt; column saying what shape is inside. The blob holds the&lt;br&gt;
words: title, notes, subtasks, page content, folder name. Plain columns hold everything the&lt;br&gt;
server queries: due date, priority, completion, My Day, pinned, sort order, parents.&lt;/p&gt;

&lt;p&gt;Measured on a 2026 laptop: PBKDF2 about 108 ms; unwrapping a key 0.2 ms; decrypting a task&lt;br&gt;
0.1 ms, five hundred of them 7 ms; a 640 KB note 1.5 ms. Phones are three to five times&lt;br&gt;
slower. The network dominates everything except the password stretch.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why metadata lives in columns
&lt;/h2&gt;

&lt;p&gt;The old secure folder put &lt;em&gt;everything&lt;/em&gt; in the blob, dates included. It was pure, and it&lt;br&gt;
meant the server couldn't put a secure task on Home or send a reminder. With encryption&lt;br&gt;
mandatory that would have broken the app's main screens for everyone.&lt;/p&gt;

&lt;p&gt;So the first migration step moved metadata out of the blob into plain columns. That is a&lt;br&gt;
deliberate, bounded leak: the server knows &lt;em&gt;when&lt;/em&gt; things are due and &lt;em&gt;whether&lt;/em&gt; they're done,&lt;br&gt;
not &lt;em&gt;what&lt;/em&gt; they are. The privacy policy lists it in those words. If you need a notes app where&lt;br&gt;
the server doesn't know you have anything due on Friday, Nuo isn't it.&lt;/p&gt;

&lt;h2&gt;
  
  
  The migration, run by the users
&lt;/h2&gt;

&lt;p&gt;The server can't convert a plaintext row into an encrypted one, because it would need the&lt;br&gt;
key. So the conversion is a client-side background job:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;On the next sign-in after the release, the user goes through set-up: password, recovery
email, 24 words. (Everyone is signed out once by a script that revokes all sessions.)&lt;/li&gt;
&lt;li&gt;The app opens, and a job runs while it's unlocked. For each plain folder it creates a
folder key, seals the folder's name, and flips the folder to encrypted. Then it fetches the
folder's plain rows in batches of 100 (notes in batches of 20, since bodies run to a
megabyte), seals each one, and writes them back with the words scrubbed from the plain
columns.&lt;/li&gt;
&lt;li&gt;Every write is conditional on the row still being plain (&lt;code&gt;WHERE is_secure = false&lt;/code&gt;), so two
devices running the job at once share the work instead of clobbering it, and a crash mid-way
just resumes next time. The unmigrated rows &lt;em&gt;are&lt;/em&gt; the queue; there's no job table.&lt;/li&gt;
&lt;li&gt;The folder flips &lt;em&gt;before&lt;/em&gt; its rows, so from that moment every new write into it is
encrypted. The window in which a plaintext write can still happen is one folder at a time,
not the whole account.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Readers handle both shapes until the last plain row is gone, which means the server-side list&lt;br&gt;
queries say &lt;code&gt;is_secure = false OR payload_version = 2&lt;/code&gt; instead of filtering plaintext.&lt;/p&gt;

&lt;p&gt;On a test account with 19 folders, 99 tasks, 43 notes and 49 inner folders the job took four&lt;br&gt;
seconds against a database in another city. The one real bug: I first wrapped each batch in a&lt;br&gt;
single interactive Prisma transaction, and 100 round trips blew its 5-second limit. Since each&lt;br&gt;
write guards its own row, the transaction bought nothing; the writes now run through a small&lt;br&gt;
concurrent pool.&lt;/p&gt;

&lt;h2&gt;
  
  
  Moving things between folders
&lt;/h2&gt;

&lt;p&gt;A row sealed under folder A's key that gets moved into folder B is now in the wrong folder&lt;br&gt;
for its key. The textbook answer, "re-encrypt in the move request", fails on size: moving a&lt;br&gt;
list of three hundred notes would mean re-uploading a few hundred megabytes in one request.&lt;/p&gt;

&lt;p&gt;Instead, rows remember which key seals them. A &lt;code&gt;key_group_id&lt;/code&gt; column, kept by a Postgres&lt;br&gt;
trigger, is stamped with the source folder whenever &lt;code&gt;group_id&lt;/code&gt; changes without a new blob,&lt;br&gt;
and cleared whenever a new blob lands. The key resolver reads &lt;code&gt;key_group_id ?? group_id&lt;/code&gt;. A&lt;br&gt;
background re-seal pass then rewrites moved rows under their new folder's key, so the state&lt;br&gt;
is short-lived; meanwhile they still open, because folder keys are never deleted while a&lt;br&gt;
folder exists. The trigger covers every path that moves a row, including the ones that&lt;br&gt;
cascade through other triggers, which is why it isn't done in application code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sharing without a readable server
&lt;/h2&gt;

&lt;p&gt;Sharing is key sharing. Three mechanisms, all client-side:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Invite links, with approval.&lt;/strong&gt; A link is &lt;code&gt;/join/&amp;lt;token&amp;gt;&lt;/code&gt; and carries no key. Opening it only asks to join: the server records a request, and the owner sees the person's name and email and approves or declines. Nobody becomes a member, and no key moves, until the owner says yes to that person. (Updated 12 Nov 2026. The first release put the folder key in the link's fragment, sealed under a random secret, so the join was instant. It also meant anyone who got hold of the link was in, so it was replaced the day after launch.)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Grants.&lt;/strong&gt; This is how the key reaches an approved person, and anyone who was already in a folder when it became encrypted. Every account has an ECDH P-256 keypair: public key in plain, private key sealed&lt;br&gt;
under the master key. The owner's device lists members who lack the folder's current key,&lt;br&gt;
and for each one does ECIES: an ephemeral keypair, a shared secret with the member's public&lt;br&gt;
key, HKDF to an AES key, the folder key sealed under it, stored with the ephemeral public key&lt;br&gt;
beside it. The member's device opens it with their private key and immediately replaces it&lt;br&gt;
with a copy under their own master key, so the private key is used once per grant.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Rotation.&lt;/strong&gt; Folder keys are versioned. Removing a member or leaving a folder deletes that person's copies and flags the folder. The&lt;br&gt;
owner's device then makes version N+1, re-seals every row and the folder's name under it,&lt;br&gt;
grants N+1 to the people still in, and deletes the old versions. Every row carries&lt;br&gt;
&lt;code&gt;key_version&lt;/code&gt;, every sealed write reports which version it used, and readers hold several&lt;br&gt;
versions of a folder's key during the rotation. What the removed person already fetched, they&lt;br&gt;
keep; the Remove button says so. What's written afterwards, they can't open.&lt;/p&gt;

&lt;p&gt;The thing that bit here: three database selects on the folder screen returned every column&lt;br&gt;
except &lt;code&gt;key_version&lt;/code&gt;. The client read the missing value as 1, and after a rotation version 1&lt;br&gt;
no longer existed, so the &lt;em&gt;owner's own folder&lt;/em&gt; said "waiting for a key". Every select that&lt;br&gt;
returns an encrypted row now carries all four fields the resolver needs, and a test pins it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What had to go
&lt;/h2&gt;

&lt;p&gt;Server-side search, because there's nothing to search. Google Calendar sync, because it&lt;br&gt;
handed titles to a third party. Image uploads, rather than building encrypted file storage&lt;br&gt;
on a free plan. Push notifications carry "a task is due" and nothing else. The server-rendered&lt;br&gt;
Trash became client-rendered, decrypting names like any other list, and finally got a 30-day&lt;br&gt;
purge. Even the example folder a new account starts with is now written by the client,&lt;br&gt;
encrypted, because the server can't write a readable note any more.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's next
&lt;/h2&gt;

&lt;p&gt;Phase 6 is cleanup: once a query shows every active account migrated, the plaintext columns&lt;br&gt;
and the dual-read paths go, and &lt;code&gt;is_secure&lt;/code&gt; with them. After that: approving a new device&lt;br&gt;
from an old one instead of typing the password, and a client-side search over decrypted&lt;br&gt;
titles.&lt;/p&gt;

&lt;p&gt;Nuo is free, on Android and at nuo-app.vercel.app. The design doc and the per-phase plans are&lt;br&gt;
in the repo under &lt;code&gt;docs/&lt;/code&gt;, if you want the version with the decisions numbered.&lt;/p&gt;

</description>
      <category>security</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>privacy</category>
    </item>
    <item>
      <title>I built 'Notion meets Microsoft To Do' — E2EE notes, a PWA, and a Play Store app without Kotlin</title>
      <dc:creator>Pranav Chandra</dc:creator>
      <pubDate>Sat, 03 Oct 2026 19:25:37 +0000</pubDate>
      <link>https://dev.to/pcpranav/i-built-notion-meets-microsoft-to-do-e2ee-notes-a-pwa-and-a-play-store-app-without-kotlin-4f6h</link>
      <guid>https://dev.to/pcpranav/i-built-notion-meets-microsoft-to-do-e2ee-notes-a-pwa-and-a-play-store-app-without-kotlin-4f6h</guid>
      <description>&lt;p&gt;Notes in one app. Tasks in another. Calendar in a third. Every day I paid a little attention tax shuttling between them.&lt;/p&gt;

&lt;p&gt;So I built &lt;a href="https://nuo-app.vercel.app" rel="noopener noreferrer"&gt;Nuo&lt;/a&gt; — a block-based editor for your thoughts and a task manager for your day, in one fast, dark workspace. It's now live on &lt;a href="https://play.google.com/store/apps/details?id=app.nuo.twa" rel="noopener noreferrer"&gt;Google Play&lt;/a&gt;. This post is about the three problems that turned out to be way more interesting than "build a notes app": client-side encryption people can't lock themselves out of, calendar sync that doesn't need a sync engine, and getting a PWA onto the Play Store without writing a line of Kotlin.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Nuo is
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Notion-style block editor&lt;/strong&gt; (built on BlockNote) — slash commands, drag-to-reorder, checklists, code blocks, tables, and tasks embedded directly inside pages&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A real task manager&lt;/strong&gt; — My Day focus view, priorities, due dates, groups and lists&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Google Calendar&lt;/strong&gt; — your events show up in Nuo; tasks with due dates go to your calendar&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;An end-to-end encrypted private group&lt;/strong&gt; — encrypted in the browser before anything touches the server&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shared groups&lt;/strong&gt; — a revocable link, and a collaborator can add tasks and pages alongside you&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mobile-first PWA&lt;/strong&gt; — installable, and shipped to Android as a TWA&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Stack: &lt;strong&gt;Next.js 16 (App Router) · React 19 · tRPC 11 · Prisma 7 · Supabase (Postgres) · TypeScript · Tailwind 4&lt;/strong&gt;, tested with Vitest and Playwright.&lt;/p&gt;

&lt;h2&gt;
  
  
  The E2EE rabbit hole
&lt;/h2&gt;

&lt;p&gt;The feature I underestimated most: the secure group. The invariant is simple to state — &lt;em&gt;the server never sees plaintext for secure rows&lt;/em&gt; — and surprisingly deep to implement.&lt;/p&gt;

&lt;p&gt;The scheme:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;A random master key&lt;/strong&gt;: 256 bits, generated in the browser with WebCrypto. It encrypts each secure row with AES-256-GCM. What hits the tRPC endpoint is ciphertext; Postgres stores ciphertext; the server literally cannot decrypt it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Your passphrase only unlocks it&lt;/strong&gt;: PBKDF2-SHA256 (600k iterations) turns the passphrase into a wrap key, and the server stores the master key solely wrapped under it. Changing your passphrase re-wraps one key instead of re-encrypting every row.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Recovery&lt;/strong&gt;: this is where it gets human. People &lt;em&gt;will&lt;/em&gt; lose keys. The recovery phrase is the master key itself, encoded as 24 &lt;strong&gt;BIP-39&lt;/strong&gt; words — the mnemonic standard hardware wallets use — so recovery never needs the server to hold anything it could leak.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The hard part wasn't the crypto primitives (WebCrypto does the heavy lifting). It was designing around the failure modes: what happens on a new device, what an unlocked app should do when it's left idle (lock itself), what "search" means when the server can't read your notes — and why the encrypted group can't be shared at all. Sharing it would mean key exchange between users, so sharing stays a plaintext-group feature, enforced in the app &lt;em&gt;and&lt;/em&gt; by a database constraint.&lt;/p&gt;

&lt;h2&gt;
  
  
  Calendar sync without a sync engine
&lt;/h2&gt;

&lt;p&gt;Two-way sync is where calendar integrations go to die, so Nuo doesn't do it. Each side owns its own things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Google owns events.&lt;/strong&gt; Nuo only reads them, to show your week next to your tasks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Nuo owns tasks.&lt;/strong&gt; Tasks with due dates go out as &lt;em&gt;one digest event per day&lt;/em&gt;, rebuilt whenever a task on that date changes. No per-task events to reconcile.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deletions don't silently propagate.&lt;/strong&gt; If you delete a digest in Google, Nuo notices the missing day and asks whether to delete those tasks or keep them.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Rebuilding hundreds of days at once (say, "add everything planned to my calendar") is one database query with a window per requested day — not a query per date, and not one giant range that drags a year of rows over the wire.&lt;/p&gt;

&lt;h2&gt;
  
  
  PWA → Play Store, no Kotlin
&lt;/h2&gt;

&lt;p&gt;Nuo is mobile-first, so it had to feel native on a phone. The pipeline:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Build a proper PWA — service worker, install manifest, a persisted query cache so it opens fast on a bad connection.&lt;/li&gt;
&lt;li&gt;Wrap it with &lt;strong&gt;Bubblewrap&lt;/strong&gt; into a &lt;strong&gt;Trusted Web Activity (TWA)&lt;/strong&gt; — a real Android package (&lt;code&gt;app.nuo.twa&lt;/code&gt;) that renders your PWA full-screen in Chrome, no browser UI.&lt;/li&gt;
&lt;li&gt;Ship the same codebase to the web and the Play Store. One deploy updates both.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The gotchas were all in the details: Digital Asset Links need the fingerprints of &lt;em&gt;both&lt;/em&gt; your upload key and Play's app-signing key, or store installs quietly show a browser bar; the Android &lt;code&gt;versionCode&lt;/code&gt; has to stay ahead of what Play already has, not what your repo says; and Bubblewrap's default release build ships with R8 optimization switched off. On the web side, the work was making sure a killed app or a flaky connection doesn't eat a half-typed note.&lt;/p&gt;

&lt;h2&gt;
  
  
  Testing an encrypted app
&lt;/h2&gt;

&lt;p&gt;Vitest covers the unit layer (800+ tests) and Playwright drives real flows in Chromium, Firefox and WebKit. For the encrypted side, the strongest guarantee lives in Postgres: CHECK constraints reject any secure row that's missing its ciphertext or still carries a plaintext title, and reject sharing a secure group. A bug can't quietly store your private notes in the clear — the write fails.&lt;/p&gt;

&lt;p&gt;Timezones taught me the other lesson. The unit tests ran pinned to UTC, which hid a bug that shifted due dates by a day for everyone else. The date tests now switch through seven timezones, and a Playwright spec emulates India and Los Angeles in a real browser.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://play.google.com/store/apps/details?id=app.nuo.twa" rel="noopener noreferrer"&gt;Google Play&lt;/a&gt; · &lt;a href="https://nuo-app.vercel.app" rel="noopener noreferrer"&gt;nuo-app.vercel.app&lt;/a&gt;&lt;/strong&gt; — free, no ads, and your data is never sold.&lt;/p&gt;

&lt;p&gt;I'd genuinely love feedback — especially on the E2EE UX. Where does the recovery-phrase flow feel scary? What would make you trust an encrypted notes app (or not)?&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Other things I've built: &lt;a href="https://wiz-craft.vercel.app" rel="noopener noreferrer"&gt;Sitecraft&lt;/a&gt; (free AI website builder) and &lt;a href="https://promptcraft-io.vercel.app" rel="noopener noreferrer"&gt;App Architect&lt;/a&gt; (5-phase app design workflow). More at &lt;a href="https://pranavchandra-portfolio.vercel.app" rel="noopener noreferrer"&gt;my portfolio&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>webdev</category>
      <category>showdev</category>
      <category>react</category>
    </item>
    <item>
      <title>I gave up on making my AI builder write good media queries</title>
      <dc:creator>Pranav Chandra</dc:creator>
      <pubDate>Thu, 28 May 2026 20:29:44 +0000</pubDate>
      <link>https://dev.to/pcpranav/i-gave-up-on-making-my-ai-builder-write-good-media-queries-1bl9</link>
      <guid>https://dev.to/pcpranav/i-gave-up-on-making-my-ai-builder-write-good-media-queries-1bl9</guid>
      <description>&lt;p&gt;Every site my AI website builder produced looked great on a phone and weak on a desktop. The hero stretched edge-to-edge in a single anemic column. Features grids stayed at one column on a 27" monitor. Section padding that felt generous on mobile felt empty at desktop widths.&lt;/p&gt;

&lt;p&gt;I spent two weeks trying to fix this from the prompt side. None of it worked the way I wanted. Then I gave up on the approach entirely and switched the generation to &lt;strong&gt;Tailwind via CDN&lt;/strong&gt;. The desktop problem disappeared.&lt;/p&gt;

&lt;p&gt;This is the writeup of why the original approach was wrong, what I tried first, and the specific change that mattered.&lt;/p&gt;

&lt;h2&gt;
  
  
  The symptom
&lt;/h2&gt;

&lt;p&gt;The system prompt told the model to write mobile-first CSS:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Default CSS targets mobile (≤480px); layer up with &lt;code&gt;@media (min-width: 768px)&lt;/code&gt; and &lt;code&gt;(min-width: 1024px)&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Models followed the instruction. They wrote good mobile rules. Then they wrote thin, half-hearted desktop overrides — a max-width here, a media query for two-column layout there. Critical things were missing: bounded container widths, real multi-column grids, typography that genuinely scaled up, deliberate section padding rhythm. Desktop wasn't broken — it was &lt;em&gt;underdesigned&lt;/em&gt;. The mobile rules absorbed most of the model's attention budget.&lt;/p&gt;

&lt;p&gt;This wasn't a one-model problem. I &lt;a href="https://dev.to/pcpranav/i-tested-4-free-70b-class-llm-endpoints-for-real-production-work-heres-what-each-is-actually-1if9"&gt;tested four&lt;/a&gt; (Cerebras GPT-OSS 120B, Groq Llama 4 Scout, Cloudflare Qwen3 30B, OpenRouter free auto-router). All four showed the same pattern. The strongest model produced the most polished mobile experience and still had thin desktop.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I tried first
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Round 1: explicit desktop rules in the prompt.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;Desktop must be a designed experience, not a stretched mobile view:
&lt;span class="p"&gt;-&lt;/span&gt; Every major section uses a bounded container (max-width 1100–1280px).
&lt;span class="p"&gt;-&lt;/span&gt; Multi-column grids on desktop (3-col features, not 1-col).
&lt;span class="p"&gt;-&lt;/span&gt; Typography scales up: hero ≥ clamp(2rem, 6vw, 5rem), body 16–18px.
&lt;span class="p"&gt;-&lt;/span&gt; Section padding visibly larger on desktop.
&lt;span class="p"&gt;-&lt;/span&gt; Real horizontal nav on desktop (no permanent hamburger).
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Helped, maybe 20% better. Not enough. Models still hand-wrote breakpoints one at a time, often forgot the container, often kept padding mobile-sized.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Round 2: an anti-patterns list.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="p"&gt;-&lt;/span&gt; Desktop that looks like a stretched mobile view.
&lt;span class="p"&gt;-&lt;/span&gt; Hero full-width on a 1440px screen with content centered in a phone column.
&lt;span class="p"&gt;-&lt;/span&gt; Single-column features grid on desktop.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Marginal again. The fundamental problem was that the model had to re-invent responsive CSS from scratch on every generation. With finite tokens of attention, it allocated effort to whatever was first and most reinforced — which was mobile.&lt;/p&gt;

&lt;h2&gt;
  
  
  The realization
&lt;/h2&gt;

&lt;p&gt;Asking an LLM to hand-write mobile-first responsive CSS is a bad task to ask an LLM. It's brittle, repetitive, and the model has to make the same dozen decisions every time.&lt;/p&gt;

&lt;p&gt;But LLMs are &lt;em&gt;great&lt;/em&gt; at Tailwind. They've seen millions of &lt;code&gt;class="grid grid-cols-1 md:grid-cols-3"&lt;/code&gt; examples in their training data. The responsive prefix system is mobile-first &lt;em&gt;by definition&lt;/em&gt; — every &lt;code&gt;md:&lt;/code&gt; and &lt;code&gt;lg:&lt;/code&gt; utility is a desktop affordance the model adds deliberately, one piece at a time, because the syntax forces it.&lt;/p&gt;

&lt;p&gt;I switched the generation system to require &lt;a href="https://wiz-craft.vercel.app/" rel="noopener noreferrer"&gt;Tailwind via CDN&lt;/a&gt;. The desktop problem solved itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  The change — three pieces
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Mandate the CDN script and inline config in &lt;code&gt;&amp;lt;head&amp;gt;&lt;/code&gt;:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;
  &lt;span class="nx"&gt;tailwind&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;config&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;theme&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;extend&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;colors&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="na"&gt;brand&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#3b82f6&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;accent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#f43f5e&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
          &lt;span class="na"&gt;surface&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#0a0a14&lt;/span&gt;&lt;span class="dl"&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;fontFamily&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
          &lt;span class="na"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;"Space Grotesk"&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;system-ui&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;sans-serif&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
          &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Inter&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;system-ui&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;sans-serif&lt;/span&gt;&lt;span class="dl"&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="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://cdn.tailwindcss.com"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Order matters — the config has to be parsed before the CDN script initializes, otherwise custom colors silently fail.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Make desktop equally first-class in the prompt:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;## RESPONSIVE — MOBILE-FIRST, DESKTOP EQUALLY FIRST-CLASS&lt;/span&gt;
Tailwind is mobile-first by default. Responsive prefixes (sm: md: lg:) are
how desktop gets designed deliberately — not as an afterthought.
&lt;span class="p"&gt;
-&lt;/span&gt; Container: &lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;-&lt;/span&gt; Multi-column grids: grid-cols-1 sm:grid-cols-2 lg:grid-cols-3
&lt;span class="p"&gt;-&lt;/span&gt; Hero: lg:grid-cols-2 (split) or lg:grid-cols-5 (asymmetric)
&lt;span class="p"&gt;-&lt;/span&gt; Type: text-3xl sm:text-5xl lg:text-7xl for headlines
&lt;span class="p"&gt;-&lt;/span&gt; Padding: py-12 sm:py-20 lg:py-28 for section spacing
&lt;span class="p"&gt;-&lt;/span&gt; Nav: hidden md:flex on the menu, md:hidden on the hamburger
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice every rule has an &lt;code&gt;md:&lt;/code&gt; or &lt;code&gt;lg:&lt;/code&gt; prefix. The prompt isn't asking the model to invent breakpoint logic — it's asking the model to &lt;em&gt;append responsive prefixes to utilities it already knows&lt;/em&gt;. That's a much smaller task. And smaller tasks for LLMs produce dramatically more consistent output.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. A final-check block at the end of the prompt:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;## FINAL CHECK&lt;/span&gt;
Before emitting your response, verify that &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt; contains BOTH:
&lt;span class="p"&gt;  1.&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;tailwind.config = { ... }&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;  2.&lt;/span&gt; &lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://cdn.tailwindcss.com"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
If either is missing, every Tailwind class in your output renders nothing.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This last one matters. Without it, my first round of Tailwind output had models that wrote Tailwind classes but skipped the CDN script. The page rendered as raw unstyled HTML — every class a silent no-op. The final-check section dropped that failure mode close to zero.&lt;/p&gt;

&lt;h2&gt;
  
  
  The result
&lt;/h2&gt;

&lt;p&gt;Desktop output went from a recurring complaint to a non-issue. Single-page sites now have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Bounded content widths instead of edge-to-edge sprawl&lt;/li&gt;
&lt;li&gt;Three-column features grids on desktop, single-column on mobile, two-column on tablet — automatic&lt;/li&gt;
&lt;li&gt;Hero layouts that use the horizontal space (split, asymmetric, full-bleed) instead of a centered phone column&lt;/li&gt;
&lt;li&gt;Typography that actually scales up&lt;/li&gt;
&lt;li&gt;Real horizontal navigation on desktop with the hamburger reserved for mobile&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;None of this is the model "trying harder." It's the model being asked to do something it's good at instead of something it's mediocre at.&lt;/p&gt;

&lt;h2&gt;
  
  
  The generalization
&lt;/h2&gt;

&lt;p&gt;When an LLM is producing mediocre output on a task, the first instinct is to fix the prompt. Add more rules. Add examples. Add anti-patterns. Each helps marginally.&lt;/p&gt;

&lt;p&gt;The higher-leverage move is to ask whether the &lt;em&gt;task&lt;/em&gt; is wrong. Is there a primitive the model is &lt;strong&gt;already great at&lt;/strong&gt; that maps to your problem?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tailwind utility classes are that primitive for responsive web design.&lt;/li&gt;
&lt;li&gt;Markdown is that primitive for structured prose.&lt;/li&gt;
&lt;li&gt;JSON Schema is that primitive for structured data extraction.&lt;/li&gt;
&lt;li&gt;React/JSX is that primitive for component output.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If the answer is yes, the rewrite tends to be smaller than the prompt-tuning rabbit hole you were heading down, and the quality ceiling is much higher.&lt;/p&gt;

&lt;p&gt;I lost two weeks before making this switch. The prompt-side fixes felt productive — each one moved the needle a little. The structural fix took a few hours and moved it more than all the prompt fixes combined.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Try it live: &lt;a href="https://wiz-craft.vercel.app/" rel="noopener noreferrer"&gt;wiz-craft.vercel.app&lt;/a&gt; — open source on &lt;a href="https://github.com/pcpranav/sitecraft" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;. Four free open-source models, generates Tailwind-styled single-page sites from a prompt, streams the iframe live as the model writes. Built with Claude.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;More on the four providers I'm using: &lt;a href="https://dev.to/pcpranav/i-tested-4-free-70b-class-llm-endpoints-for-real-production-work-heres-what-each-is-actually-1if9"&gt;I tested 4 free 70B-class LLM endpoints for real production work&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>webdev</category>
      <category>tailwindcss</category>
    </item>
    <item>
      <title>I tested 4 free 70B-class LLM endpoints for real production work — here's what each is actually good at</title>
      <dc:creator>Pranav Chandra</dc:creator>
      <pubDate>Sat, 02 May 2026 09:35:16 +0000</pubDate>
      <link>https://dev.to/pcpranav/i-tested-4-free-70b-class-llm-endpoints-for-real-production-work-heres-what-each-is-actually-1if9</link>
      <guid>https://dev.to/pcpranav/i-tested-4-free-70b-class-llm-endpoints-for-real-production-work-heres-what-each-is-actually-1if9</guid>
      <description>&lt;h2&gt;
  
  
  The question
&lt;/h2&gt;

&lt;p&gt;Most "production-grade" AI tools ship on paid endpoints — OpenAI, Anthropic, Gemini Pro. That's the safe choice. It's also the expensive one.&lt;/p&gt;

&lt;p&gt;I wanted to know: in mid-2026, can free 70B-class open-source endpoints actually carry a real product workload? Not a toy chatbot — a tool that generates working HTML/CSS/JS for arbitrary user prompts.&lt;/p&gt;

&lt;p&gt;So I built one. The result is &lt;strong&gt;Sitecraft&lt;/strong&gt; (&lt;a href="https://wiz-craft.vercel.app/" rel="noopener noreferrer"&gt;wiz-craft.vercel.app&lt;/a&gt;) — a free, open-source AI website builder. It runs across &lt;strong&gt;four different free endpoints&lt;/strong&gt; and lets users switch between them mid-conversation.&lt;/p&gt;

&lt;p&gt;This post is what I learned about each one. Not a benchmark — a working engineer's notes.&lt;/p&gt;

&lt;h2&gt;
  
  
  The 4 endpoints I shipped
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Provider&lt;/th&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;Why it's on the list&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Cerebras&lt;/td&gt;
&lt;td&gt;Qwen 3 235B&lt;/td&gt;
&lt;td&gt;Reasoning depth — strongest at "think before generating"&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Groq&lt;/td&gt;
&lt;td&gt;Llama 4 Scout&lt;/td&gt;
&lt;td&gt;Throughput king — fastest token rate I've measured&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;OpenRouter&lt;/td&gt;
&lt;td&gt;Ling-2.6 Flash&lt;/td&gt;
&lt;td&gt;Generalist; best fallback when the others rate-limit&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Cloudflare&lt;/td&gt;
&lt;td&gt;GPT-OSS 120B&lt;/td&gt;
&lt;td&gt;Edge inference; lowest latency from a Workers backend&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;All four have free tiers that are actually usable for shipping (not just "free for 100 tokens then $50/M"). Different free-tier shapes, but real free.&lt;/p&gt;

&lt;h2&gt;
  
  
  What each one is actually good at
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Cerebras · Qwen 3 235B — the reasoner
&lt;/h3&gt;

&lt;p&gt;When the prompt requires &lt;em&gt;planning&lt;/em&gt; (e.g. "build a 3-page site with consistent design language across all pages, plus a working contact form"), Qwen on Cerebras consistently produces the most coherent output. It thinks about the whole problem before emitting code.&lt;/p&gt;

&lt;p&gt;Trade-off: it's slower per token than Groq, and the free tier rate-limits aggressively when you go beyond a few requests per minute.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use it when:&lt;/strong&gt; The prompt is open-ended and the model needs to invent structure.&lt;/p&gt;

&lt;h3&gt;
  
  
  Groq · Llama 4 Scout — the speed demon
&lt;/h3&gt;

&lt;p&gt;Groq's LPUs are the fastest inference I've ever benchmarked. Llama 4 Scout hits ~500+ tokens/second sustained, which means a full single-page site (~3000-5000 tokens) lands in under 10 seconds — feels instant in the UI.&lt;/p&gt;

&lt;p&gt;Trade-off: Llama 4 Scout is smaller and less "thoughtful" than Qwen 3 235B. For complex prompts it sometimes generates plausible but incorrect code (wrong CSS selectors, hallucinated APIs).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use it when:&lt;/strong&gt; Iteration speed matters more than first-shot correctness.&lt;/p&gt;

&lt;h3&gt;
  
  
  OpenRouter · Ling-2.6 Flash — the generalist fallback
&lt;/h3&gt;

&lt;p&gt;OpenRouter's free Ling-2.6 Flash isn't the best at any single thing, but it's &lt;em&gt;consistently okay&lt;/em&gt; across prompt types and almost never rate-limits. That makes it the perfect fallback target when one of the other three is throttled.&lt;/p&gt;

&lt;p&gt;Trade-off: code output quality is noticeably lower than Qwen — more boilerplate, less elegant HTML structure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use it when:&lt;/strong&gt; You need a fallback that won't fail. Paired with quality-checks downstream, it's the safety net.&lt;/p&gt;

&lt;h3&gt;
  
  
  Cloudflare · GPT-OSS 120B — the edge play
&lt;/h3&gt;

&lt;p&gt;If your backend already runs on Cloudflare Workers, calling Cloudflare AI from the same edge node is hands-down the lowest-latency setup. No cross-region hop, no cold-start penalty.&lt;/p&gt;

&lt;p&gt;Trade-off: GPT-OSS 120B is older architecture than the others. Output quality sits between Llama 4 Scout and Ling — fine for short outputs, weaker for long-form generation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use it when:&lt;/strong&gt; Your stack is already on Cloudflare and you want to keep the inference call inside the edge.&lt;/p&gt;

&lt;h2&gt;
  
  
  The orchestration strategy
&lt;/h2&gt;

&lt;p&gt;You don't pick one. You orchestrate.&lt;/p&gt;

&lt;p&gt;For Sitecraft I shipped a simple router:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Default:&lt;/strong&gt; Groq Llama 4 (fastest perceived response)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;If user explicitly toggles "high-quality":&lt;/strong&gt; Cerebras Qwen 3 235B&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;If primary is rate-limited (429):&lt;/strong&gt; fall back to OpenRouter Ling&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cloudflare GPT-OSS:&lt;/strong&gt; offered as a manual switch for users on slow connections (edge-routed)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The user can also switch mid-conversation — useful when, say, Qwen produced a great structural draft but you want Groq to iterate fast on the styling.&lt;/p&gt;

&lt;p&gt;The whole router is ~80 lines of plain JS. No LangChain, no framework. Just an &lt;code&gt;if/else&lt;/code&gt; over which endpoint to hit, plus a small wrapper that normalises response formats (each provider returns slightly different envelope JSON).&lt;/p&gt;

&lt;h2&gt;
  
  
  The honest trade-offs
&lt;/h2&gt;

&lt;p&gt;If you're considering this approach, here's what I wish someone had told me upfront:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Response format quirks.&lt;/strong&gt; Every provider returns slightly different JSON. Cerebras gives &lt;code&gt;choices[0].message.content&lt;/code&gt;, Cloudflare gives &lt;code&gt;result.response&lt;/code&gt;, OpenRouter mostly mirrors OpenAI but with quirks on streaming. &lt;strong&gt;Build a normaliser early&lt;/strong&gt; or you'll regret it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Free tiers are real but bounded.&lt;/strong&gt; "Free" usually means rate-limited per minute and per day. For a side project with low traffic, you'll never notice. For a viral hit, you'll need a paid tier or a queue.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Quality variance is real.&lt;/strong&gt; Even within the same prompt, Qwen and Llama 4 will produce noticeably different code. If your UX expects consistency, normalise via post-processing or pick one provider per request type.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;No streaming compatibility guarantees.&lt;/strong&gt; SSE format varies subtly. If you stream tokens to a UI, expect to write provider-specific stream parsers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Latency varies wildly by region.&lt;/strong&gt; Groq is fast from US-East. From APAC, the round-trip dominates. Cloudflare's edge play wins here.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  When this approach is right (and when it isn't)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Use free open-source endpoints if:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You're shipping a side project / proof-of-concept and don't want a credit-card dependency&lt;/li&gt;
&lt;li&gt;Your users are okay with "good enough" code (and you can iterate)&lt;/li&gt;
&lt;li&gt;You want flexibility to swap models without lock-in&lt;/li&gt;
&lt;li&gt;You're learning about LLM orchestration and want hands-on experience with the trade-offs&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Stick with paid (Claude / GPT-5 / Gemini Pro) if:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You need single-shot correctness (no iteration loop)&lt;/li&gt;
&lt;li&gt;You're building agentic workflows with deep reasoning (multi-tool, long context)&lt;/li&gt;
&lt;li&gt;You have a real budget and uptime SLA matters&lt;/li&gt;
&lt;li&gt;Your prompts genuinely need 200K+ context&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For Sitecraft, the 4-endpoint orchestration was the right call — generating a website is iterative anyway, the user is in the loop, and "free forever" is part of the product pitch.&lt;/p&gt;

&lt;p&gt;For my other side project, &lt;a href="https://promptcraft-io.vercel.app/" rel="noopener noreferrer"&gt;App Architect&lt;/a&gt; (a 5-phase design workflow that turns app ideas into TDD prompts), I went the opposite direction and built it on Claude Artifacts — because &lt;em&gt;that&lt;/em&gt; tool needs deep reasoning over a long structured conversation, and the paid frontier model is worth it.&lt;/p&gt;

&lt;p&gt;Right tool for the right job.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;→ &lt;strong&gt;&lt;a href="https://wiz-craft.vercel.app/" rel="noopener noreferrer"&gt;wiz-craft.vercel.app&lt;/a&gt;&lt;/strong&gt; — switch between the 4 endpoints mid-conversation and feel the difference for yourself.&lt;/p&gt;

&lt;p&gt;Source: &lt;strong&gt;&lt;a href="https://github.com/pcpranav/sitecraft" rel="noopener noreferrer"&gt;github.com/pcpranav/sitecraft&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you've shipped on free open-source endpoints, I'd love to hear which providers you settled on and why. Drop a comment.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>opensource</category>
      <category>webdev</category>
    </item>
    <item>
      <title>I built a 5-phase design system that turns "I have an app idea" into a TDD prompt</title>
      <dc:creator>Pranav Chandra</dc:creator>
      <pubDate>Fri, 01 May 2026 21:14:27 +0000</pubDate>
      <link>https://dev.to/pcpranav/i-built-a-5-phase-design-system-that-turns-i-have-an-app-idea-into-a-tdd-prompt-3do</link>
      <guid>https://dev.to/pcpranav/i-built-a-5-phase-design-system-that-turns-i-have-an-app-idea-into-a-tdd-prompt-3do</guid>
      <description>&lt;p&gt;App Architect walks you from a one-line idea to a production-ready prompt — user flow, page map, system design, spec, and tests. Here's why I built it and how it works.&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem with "build me an app" prompts
&lt;/h2&gt;

&lt;p&gt;Every developer has done this at least once: you have a vague idea, you open Claude or ChatGPT, you type &lt;em&gt;"build me a habit tracker with social features"&lt;/em&gt;, and forty seconds later you're staring at 600 lines of code that compiles but doesn't actually solve the problem you had in your head.&lt;/p&gt;

&lt;p&gt;The model isn't wrong. Your prompt is.&lt;/p&gt;

&lt;p&gt;There's a missing layer between &lt;strong&gt;"I have an idea"&lt;/strong&gt; and &lt;strong&gt;"here is the code"&lt;/strong&gt; — the layer where a real engineering team would normally spend a week: user flows, page maps, schemas, edge cases, the boring stuff that decides whether the thing actually ships.&lt;/p&gt;

&lt;p&gt;I kept skipping that layer. So I built a tool that refuses to let me skip it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What App Architect does
&lt;/h2&gt;

&lt;p&gt;App Architect is a Claude artifact that takes you through five structured phases. You describe your idea in one sentence; it asks the right follow-up questions; at the end you get a single prompt you can paste into Claude Code (or any capable LLM) to actually build the thing.&lt;/p&gt;

&lt;p&gt;The five phases:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;App Flow&lt;/strong&gt; — user journey, tech stack, integrations, edge cases&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Page Map&lt;/strong&gt; — routes, wireframes, layout zones, key interactions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;System Design&lt;/strong&gt; — DB schema, API routes, architecture diagram&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Executive Summary&lt;/strong&gt; — full spec: features, stack, risks, open questions&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;TDD Prompt&lt;/strong&gt; — a production-ready prompt with unit tests, E2E tests, and CI config baked in&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The output of phase 5 is the artifact. Everything before it exists to make that final prompt non-garbage.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why TDD as the final output
&lt;/h2&gt;

&lt;p&gt;Because the failure mode of AI-generated code isn't "it doesn't compile." It's "it compiles, looks reasonable, and silently does the wrong thing in three places."&lt;/p&gt;

&lt;p&gt;If the final prompt asks the LLM to write tests &lt;strong&gt;first&lt;/strong&gt;, then implementation, you get:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A clear, executable definition of "done"&lt;/li&gt;
&lt;li&gt;A regression net the moment something else changes&lt;/li&gt;
&lt;li&gt;A way to spot hallucinated APIs early (the test fails before you ship)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You don't need to be a TDD purist to want that.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to use it
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Open the &lt;a href="https://promptcraft-io.vercel.app" rel="noopener noreferrer"&gt;App Architect&lt;/a&gt; landing page&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Launch&lt;/strong&gt; — it opens as a Claude artifact in your own Claude account (free tier works fine)&lt;/li&gt;
&lt;li&gt;Describe your idea in one or two sentences&lt;/li&gt;
&lt;li&gt;Answer the phase prompts honestly — "I don't know yet" is a valid answer and the tool handles it&lt;/li&gt;
&lt;li&gt;Copy the final TDD prompt and paste it into Claude Code, Cursor, or any agentic dev tool&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There's no sign-up on my side. No data collection. Usage runs on your Claude account, billed to you. I don't see any of it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd do differently
&lt;/h2&gt;

&lt;p&gt;A few things I'd change if I rebuilt it tomorrow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Persist drafts.&lt;/strong&gt; Right now if you close the tab mid-flow you start over. Local storage would fix it cheaply.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Branching flows.&lt;/strong&gt; Some apps don't have a "page map" (CLIs, MCP servers, libraries). The current flow nudges everything toward web apps. A branch at phase 1 would help.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stack templates.&lt;/strong&gt; A "Next.js + Postgres + Drizzle" preset would skip three rounds of follow-up questions for the 60% of users who already know their stack.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I'll get there. For now, the v1 covers the painful part: stopping you from prompting before you've thought.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;→ &lt;strong&gt;&lt;a href="https://promptcraft-io.vercel.app" rel="noopener noreferrer"&gt;promptcraft-io.vercel.app&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you build something with it, I'd genuinely love to see what comes out the other side. Drop a comment.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>claude</category>
      <category>productivity</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
