Theo's Typesafe CultTTC
Theo's Typesafe Cult3y ago
42 replies
exodus

Typesafe backend stack

Having a hard time deciding on a backend stack. Happy with where things are going, but nothing’s quite there yet.

Looking for decent scalability and type safety.

I’ve done NestJS, Typegoose, and openapi generator. Works reasonably well, single source of truth (ish, because you’re still writing DTOs). Ditching Mongo though so I’m looking at TypeORM or prisma now.

Not sure if I’ll keep using NestJS. It is a godsend for organization and scalability, and the batteries included nature means it’s reasonably easy to integrate any semi popular tech, but it is also a bit inflexible as a result. Not a huge OO fan, but the Spring bootiness of it does scale nicely. I’ve never properly scaled a purely Express backend and there really isn’t a well documented pattern to follow here. I can manage it, but it’s additional mental overhead.

tRPC is really cool and would give the best DX, but we do also need OpenAPI for external consumers, and although there’s an unofficial plug-in for it, I’m a bit hesitant.

Lots of decisions to make here, and I’m curious if anyone has any input when it comes to scalability across multiple apps and micro services.

Main decisions to make:
Nest vs. pure Express
tRPC vs monorepo shared types vs codegen
Was this page helpful?