I built a generic multi-step flow engine on top of Laravel controllers

I built a generic multi-step flow engine on top of Laravel controllers

●1 ●4
calendar_today • schedule1 min read
— Originally published at dev.to

If your mobile app decides which step comes next, your backend is trusting the client.

That's where we were at Zeney Pay. Sign-in, KYC and transfers were multi-step flows, and half of each flow's logic lived in the app. The backend couldn't tell whether a request to "check the PIN" came after 2FA had actually passed, unless someone remembered to write that check.

So we moved the whole state machine to the server:
→ every response tells the app which steps are legal next
→ skipping a step gets a 409, and an expired flow gets a 410
→ going back rewinds the flow and discards what came after
→ the app just renders whatever the backend advertises

I wrote up the original story on dev.to: the design decisions, how we handled authentication, and the trade-offs we accepted:

https://dev.to/na2axl/i-built-a-generic-multi-step-flow-engine-on-top-of-laravel-controllers-5f9k

I'll be happy to ear what you think!

Want more #software-architecture & #laravel deep dives?

Join 6,046+ developers sharing real benchmarks, code breakdowns, and projects. Free forever.

1 Comment

1 vote

More Posts

A Textile Mill's Dyehouse Ramp Curve: Get One Step Wrong and the Sheet Belongs to the Master

aiomniu - Oct 18

How I Built a React Portfolio in 7 Days That Landed ₹1.2L in Freelance Work

Dharanidharan - Feb 9

A Message From Our Founder: On the Winding Down of LaaSy™

Ken W. Algerverified - Oct 29

Everyone says DeepSeek is cheaper, but I got tired of guessing the exact math. So I built a calculat

abarth23 - Apr 27

Dozens of email accounts: learning AI coding tools as a student

rahuldk1105 - Oct 27
chevron_left
132 Points • 5 Badges
Yaoundé - Cameroon
1Posts
0Comments
Learn how a bird flies, and you will learn how to code it.

Related Jobs

View all jobs →

Commenters (This Week)

3 comments
3 comments
1 comment

Contribute meaningful comments to climb the leaderboard and earn badges!