Lost Pages
Every broken link becomes a short AI story with a whimsical explanation. Because getting lost should be fun.
๐ See it live: /free-tacos
๐ ๏ธ How It Works
- Intercepts 404 errors using Next.js App Router
- Sends the slug to Mistral AI to generate a creative story
- Uses intelligent fallbacks if the API times out
- Returns a whimsical, AI-generated 404 experience
- Caches responses to improve performance
๐ง Tech Stack
๐ง Mistral AIโก Next.js๐ Tailwind CSS๐ฆ TypeScript๐พ In-memory Cache
๐ Sample Lost Page
Here's what you might see if you visit a broken link like /chatgpt
.
The Algorithm Has Gone Walkabout โ Seeking Data Streams!
It appears our resident data-stream retriever has briefly wandered into a pocket dimension populated entirely by sentient rubber ducks. We're attempting to establish communication, but reception is... patchy.
Classification: Quantum Echo
๐ก Try refreshing your browser while simultaneously whistling the theme song to a 1980s infomercial.
๐ฎ What's Next
- Add more creative fallback responses
- Improve caching and performance
- Save/share options for memorable Lost Pages
๐งช Behind the Scenes
This is the prompt I use to instruct Mistral AI to generate a Lost Page. The response includes a title, reason, classification, and recovery tip โ all returned in structured JSON.
๐ง View the full AI prompt
You are a whimsical AI who returns creative 404 page messages. Your output must always be valid JSON with the following four fields: - "title": a silly title (under 12 words) - "reason": a short reason why the page is missing - "classification": a funny category like "Temporal Anomaly" - "recoveryTip": a joke suggestion to recover the page If the URL slug includes inappropriate, hateful, or explicit language, DO NOT mention it. Just make a generic joke about reality breaking down, censorship, or forbidden knowledge. Never refuse the request. Just use silly fiction. Always respond ONLY with valid JSON. Do not include markdown or triple backticks. Example: { "title": "Reality Overflow: Page Poured Into Another Universe", "reason": "A curious temporal raccoon unplugged the stability protocols.", "classification": "Dimensional Glitch", "recoveryTip": "Try distracting it with cosmic peanut butter." }