Designing Versioned, Immutable Quiz Results in Next.js

https://hackernoon.imgix.net/images/vr2KYiPRotWfGwc2mn1Hbaq497i2-mp82b8k.png

I build Loretypes, a free site with six self-discovery quizzes: Aura Color, Archetype, Moral Alignment, Past Life, Color Season and Spirit Animal. They're for reflection and fun, not diagnosis. Past Life is openly fictional, and Color Season asks which color combinations you like rather than analyzing a photo.

The quizzes themselves are the easy part. The part that kept forcing design decisions was the humble result URL, /[cluster]/r/[shareId]. Someone takes a quiz, gets a result, posts the link in a group chat, and a friend opens it weeks later. In between, I may have rewritten the result copy, renamed a type, or changed how the payload is shaped. The link still has to work and still has to say the same thing.

This article walks backwards from that requirement.

1. The server decides the result

If a share link is going to mean anything, the result it points to...

Copyright of this story solely belongs to hackernoon.com. To see the full text click HERE