Hacker News new | ask | show | jobs
by mccorrinall 1382 days ago
I like NextJS too, except for the API part. The DX is so poor compared to e.g. fastify.

Want to only allow a specific http method for this route? Have fun adding boilerplate.

Want to throw a specific http error like 403? Have fun writing this by hand.

It also lacks schema validation (I’d love to see ajv here) and openapi gen. You have to write everything. by. yourself.

1 comments

I like NextJS for the frontend and django-ninja for the backend. django-ninja has all those things you mention and way more, and has a very rich backend ecosystem thanks to being in the django world. https://django-ninja.rest-framework.com/

FastAPI is also great but a little more involved. It's good if you don't want to be in the Django world.

Yes, there are many solutions to this problem if you don’t mind hosting yet another service, but the best would be if the integrated API routes wouldn’t suck so hard.