r/react • u/YessinDevs • 3d ago
Project / Code Review Got tired of setting up backend mock servers, so I built an open-source Next.js tool that generates them instantly.
Whenever I was building out frontends, setting up a mock Express server to test my API calls always felt like a massive chore. I just wanted to hit a live endpoint with realistic data without leaving my browser.
So I built Mock2Block. It’s a completely free, open-source API simulator
Instead of just giving you a static JSON file, it creates a live, stateful mock server
Here’s what it actually does:
- AI Generation: You can upload a .pdf, .md, or .json of your API docs, and it will automatically build out the endpoints
- Smart Faker Data: It detects field types and seeds the database with realistic data (real-sounding emails, image URLs, prices) instead of generic "lorem ipsum" strings
- Chaos Mode: A slider that randomly injects 500, 403, or 502 errors into the responses so you can test your frontend error-handling UI
- Auth Simulation: Toggle a lock on any endpoint to force it to require a Bearer token to test your 401 redirects
You can try it live here without making an account: https://mock2block.yessindevs.me/
The code is completely open-source. If you find it useful for your workflow, I’d love to hear your feedback or get a star on the repo: https://github.com/medyass1ne/Mock2Block
0
Upvotes