DEV Community

Kyle Logue
Kyle Logue

Posted on

The 4-Day Wait: Why I'm Always Blocked Waiting for APIs

Okay, this happened to me again yesterday and I finally snapped.

On a Monday...

PM: "hey, we need a user profile page for the new dashboard"

Me: "Cool, what does the user API look like?"

Backend dev: "Oh, I need to build that first. Give me a few days."

Me: "..."

So here I am on Wednesday, still waiting. Again. And I'm sitting here wondering - am I the only one who deals with this constantly?

This kept happening until I did something about it

I started actually tracking this because it was driving me nuts. In the last few months:

  • Got blocked 8+ different times waiting for APIs
  • Average wait: about 4 days each time
  • Half the time when the API is "ready," it's different than what we talked about

Like last week - we agreed the user object would have name and email. API comes back with full_name and email_address.

Cool.

And it's not like these are complex APIs! Most of them are just basic CRUD stuff. Get user, update user, delete user. But I still have to wait around twiddling my thumbs.

I got so frustrated that I actually built a CLI tool to solve this. It's called SpecJet and it's free on npm. But honestly, I'm not sure if I just solved my own weird workflow problem or if this is actually useful for other developers.

What I was doing (and I bet you do too)

The hopeful mock data approach:

// Fingers crossed this matches what backend builds const user = { id: 1, name: "John Doe", email: "john@example.com" } 
Enter fullscreen mode Exit fullscreen mode

Then backend delivers:

{ user_id: "usr_123abc", display_name: "John Doe", email_address: "john@example.com", created_at: "2024-01-15T10:30:00Z", preferences: { theme: "dark" } // oh, we have preferences now? } 
Enter fullscreen mode Exit fullscreen mode

Cue me spending half a day fixing everything 🙃

The context switching nightmare:
"I guess I'll work on the settings page while I wait"
opens different branch
"Oh wait, settings also needs a user preferences API"
sigh

What I built (and why I need your input)

So I built this CLI tool that lets you:

  1. Quickly design the API contract (takes like 5 minutes)
  2. Generate TypeScript types immediately
  3. Start a mock server with realistic data
  4. Build your frontend feature right away
  5. When backend is ready, change one line and everything works

It looks like this:

npm install -g specjet specjet init user-api cd user-api specjet generate # Creates TypeScript types specjet mock # Realistic mock server running 
Enter fullscreen mode Exit fullscreen mode

Then you just build against the mock server like it's the real API. When the real API is ready, you change localhost:3001 to api.myapp.com and everything works.

But here's my question...

Is this just me being weird about workflows, or do other frontend developers actually experience this "4-day wait" pattern?

Because if it's just me, then I built a tool to solve my personal quirks. But if this is a real problem that lots of teams have, then maybe this approach actually helps.

I've been using it for my own projects and it eliminates the waiting entirely. But I'm one person with one workflow.

What's your experience?

Seriously though - am I the only one frustrated by this? Do you:

  • Get blocked waiting for APIs regularly?
  • Mock your own data and hope it matches?
  • Have better strategies I'm missing?
  • Think a CLI approach would actually help your workflow?

And if you're curious about the tool, it's here or you can just npm install -g specjet. I'd genuinely love feedback on whether this solves a real problem or if I'm just solving my own weird issues.

The tool exists, but the real question is whether it matters to anyone besides me.

Top comments (0)