Back to projects

Tubito

PoC In progress
  • TypeScript
  • Node.js

Why does this project exist?

In all my backend projects I end up doing the same thing: authenticate, validate parameters, handle errors, return responses in the same format… and every time I reimplement it from scratch. On top of that, those loose pieces don’t validate against each other: you can remove an auth middleware and the handler still compiles even though ctx.userId no longer exists. That kind of error only shows up at runtime, and it’s really frustrating.

Tubito is a layer that sits on top of your framework (Express, Hono or Koa) and gives you all of that solved with a single API. Each endpoint always follows three steps: protect, validate and handle. You use only what you need.


The endpoints stay clean, reduced to just the controller logic. Validation, error handling and response format are all managed by Tubito:


Endpoints defined with Tubito


Each middleware and each validation is reflected in the ctx type, so autocomplete tells you exactly what’s available. And if you break the chain (for example, remove a middleware that added userId), the compiler warns you before anything runs. That reveals integration errors at compile time, not in production.

Another thing I like is that if someday I want to migrate from Express to Hono, I change the adapter and the rest of the code stays the same. The endpoint logic doesn’t depend on the framework.

If you like this project and want to share an idea to improve it, send me an email or reach out on LinkedIn.