Adarsh Khatri

~ writings

Food Preference System

next.jsweb developmentproblem solving
Food Preference System

problem

Every day at 3PM, my shift at Vertex begins with the same scene. A cook walks department to department asking: "Veg or non-veg today?"

As a frontend engineer, I watched this daily routine and thought: there has to be a better way.

is this a good idea ?

What if people could set their food preferences once and share them easily? No more daily interruptions. No more missed preferences. Just a simple system that works.

Building the Solution

I started with Next.js and a basic form. Simple enough. But then reality hit—this needed to work everywhere:

  • On phones during lunch breaks
  • On tablets for restaurant managers
  • On desktops for event planners

The system had to be fast and reliable globally.

the challenge

I built everything with jsonwebtoken for authentication. It worked perfectly in development.

Then I deployed it.

// This worked locally but failed in production
const token = jwt.sign(payload, secret, { expiresIn: "7d" });

The basic features worked fine, but the admin section completely broke. The authentication library couldn't handle edge environments.

the fix ?

After research and too much coffee, I found jose—built specifically for modern edge computing.

// This worked everywhere
const token = await new jose.SignJWT(payload)
  .setProtectedHeader({ alg: "HS256" })
  .setExpirationTime("7d")
  .sign(secret);

One small change. Everything worked smoothly.

  • Technical solutions should solve human problems
  • The obvious choice isn't always the best choice
  • Real user feedback beats assumptions every time
  • Small improvements can have big ripple effects

But mostly, I'm listening to users. That's what started this whole journey.

takeaway

Sometimes the best projects come from daily frustrations. What began as a workplace annoyance became a tool that helps restaurants serve customers better.

The technical challenges were temporary. Focusing on the human problem guided me to the right solutions.


Built something to solve a personal problem? I'd love to hear your story.