Weigh is a small web app for one job: helping you choose between two or more options (two job offers, staying or moving, and so on). You rate each option on the same 7 questions, and it shows a weighted score. There is no account, no server and no AI. Decisions live in localStorage.
The feature I wanted most was Ask a friend: a friend rates the same options blind, then you see where you agree and where you differ. Usually that needs a database. Here is how it works with nothing but links.
The round trip
- You finish a decision and tap Ask a friend. The app builds a link that contains the decision title and the option names, but not your ratings.
- Your friend opens it, answers the same 7 questions, and gets their own result.
- Their result screen gives them a link back to you. That link contains their answers. You open it and see "you vs friend": whether the winner matches and which question you disagree on most.
Nothing is stored anywhere except the two browsers.
Encoding state into the URL
The payload is JSON, UTF-8 encoded, then base64, then URL-encoded:
function encodeBase64(obj: unknown): string { const json = JSON.stringify(obj); const bytes = new TextEncoder().encode(json); const binary = Array.from(bytes, (b) => String.fromCharCode(b)).join(""); return encodeURIComponent(btoa(binary)); } TextEncoder matters: plain btoa throws on non-Latin-1 characters, and people name their options in every language.
Making the links ~5x shorter
The first version put the whole decision in the link, including the full text of all 7 questions. That made links long enough to look like spam in WhatsApp.
The fix was to send only what the receiver can't rebuild. The questions are fixed templates in the app, so a link carries a templateId and the receiver looks the text up locally:
interface FriendV2 { v: 2; title: string; templateId: string; options: Array<{ id: string; name: string }>; // no ratings } The version field keeps old links working: if v isn't 2, the app decodes the old full format.
When the friend's answers come back, the app checks whether this browser holds a decision with the same option ids. If it does, you are the owner and you get the comparison. If not, it's the friend's own device and they just see their result.
Scoring
The score is a plain weighted average on a 1-5 scale. When two options tie exactly, the one that wins on the highest-weighted question goes first. That uses the user's own priorities instead of a random pick:
const raw = decision.criteria.reduce( (sum, c) => sum + (option.answers[c.id] ?? 1) * c.weight, 0); const score = raw / totalWeight; SEO for a client-side app
An SPA that renders in the browser is nearly invisible to crawlers. I didn't want SSR for a tiny app, so:
- guide pages ("how to choose between two job offers" and similar) are generated as static HTML at build time. They import the same scoring code as the app, so the worked examples on the page always match what the app would compute;
- each guide's button opens the app with the example pre-filled (
/new?title=...&o=...&o=...); - the home page ships a small static block inside
#rootthat React replaces on load.
Why no AI
A chatbot can give you a confident answer about your life from one paragraph of context. I wanted the opposite: the answer comes from your own honest ratings, and you can see exactly why an option won. The questions are inspired by Schwartz's research on basic human values and by regret minimization. The weights are the app's defaults and I'm open about that.
You can try it here: https://weigh-pwa.web.app/?ref=devto
I'd love feedback on two things. Did the result match your gut feeling? And which of the 7 questions felt wrong for your decision?
This post was written with AI assistance and reviewed against the app's source code.