u/UneditedTips

▲ 7 r/nestjs+1 crossposts

Synchronize: true destroyed a production database: Here's the migration setup that prevents it

I used synchronize: true in a NestJS project for way longer than I should have. It was fine in development. But when I renamed a column in an entity, pushed to production, and TypeORM dropped the old column and created a new one on the next restart., data was gone.

You can fix this with migrations, but the TypeORM + NestJS migration setup is very confusing because the TypeORM CLI doesn't know about NestJS's dependency injection. You end up needing two configs, one for AppModule, one for the CLI, and getting them to share the same values without duplicating everything takes a bit of work.

The piece that finally made it click for me was the data-source.ts file. It's a standalone TypeORM DataSource that reads from your .env directly, no NestJS involved. The CLI uses that. NestJS uses ConfigService in AppModule. Both point to the same database, same entities, same migrations folder.

reddit.com
u/UneditedTips — 1 day ago
▲ 14 r/nestjs

Connecting NestJS to PostgreSQL with TypeORM — including the parts most tutorials skip

The NestJS + TypeORM setup isn’t hard once you’ve done it, but there are a few things nobody tells you upfront that cost you an hour when you hit them.
Here’s a full guide in my article

brandfordtech.com
u/UneditedTips — 3 days ago

If NestJS architecture confuses you coming from Express, here's how I think about it

NestJS looks complicated when you're used to Express. Modules, Providers, Controllers, services, Guards, Interceptors, it's a lot of new vocabulary for what feels like the same thing.

Here's how I broke it down in my head:

Express gives you a blank canvas, NestJS gives you a template.

The template is: one module per feature, one controller per module for HTTP, one service per module for logic. That's the whole pattern.

The module is just metadata, it tells the framework what exists and how things connect. The controller is your route handler, nothing else. The service is where your actual code lives.

Once I stopped trying to understand it all at once and just followed the pattern, everything else started to make sense.

reddit.com
u/UneditedTips — 5 days ago
▲ 1 r/Backend+1 crossposts

Switching from Express to NestJS? Here's exactly what changes (and what doesn't)

A lot of Express devs look at NestJS and immediately think it's over-engineered decorators everywhere, a module system, controllers, services, all this boilerplate just to return some JSON.

I thought the same thing. Then I realized NestJS isn't replacing Express, it's literally running on top of it. Under the hood, it's still an Express server. The same req and res objects. The same middleware model. The same Node.js HTTP behavior.

brandfordtech.com
u/UneditedTips — 6 days ago
▲ 27 r/dotnet

Transitioning From C# To Typescript

How easy is it to learn typescript as someone who is already familiar with C# ?

reddit.com
u/UneditedTips — 7 days ago

Nest Js Architecture

When I first opened a NestJS project, I genuinely thought someone had over-complicated what should be a simple Node.js API.
app.module.ts, app.controller.ts, app.service.ts, a NestFactory in main.ts, and I hadn’t written a single route yet. I was coming from Express, where you just use app.get('/users', handler) and move on, this felt like a lot of code for not much.
What changed it for me was realizing NestJS isn’t adding complexity for fun. It’s giving you the structure that large Express apps always end up building anyway, just upfront, before things get out of hand.
What are your opinions ?

reddit.com
u/UneditedTips — 8 days ago
▲ 10 r/Backend

What is your opinion about NestJS ?

I'll like to find out your opinions about Nestjs when it comes to ennterprise applications ?

reddit.com
u/UneditedTips — 9 days ago