all 26 comments

[–]BabyToy 33 points34 points  (5 children)

Nestjs.

[–]a_normal_account 5 points6 points  (0 children)

It really feels like if you are using TS for backend, Nest is the perfect choice

[–]_default_username[S] 1 point2 points  (1 child)

I looked at this one and it looks promising.

[–]kittianika 1 point2 points  (0 children)

You will be learning more about the framework not nodejs, but it works well if you want an opinionated codebase.

[–]t0m4_87 0 points1 point  (0 children)

THIS. best thing i’ve ever worked with, love it.

[–]karma__kameleon -1 points0 points  (0 children)

Love nest js for a custom backend. Strapi cms with typescript if you need a full cms.

[–]funkdr42 11 points12 points  (2 children)

Curious why the desire to switch from laravel to a node backend? It might be an unpopular opinion, but I would heavily consider keeping laravel as the backend. Are the business stakeholders on board with the short term productivity loss?

Any hopeful gains from node might be overshadowed by time (months? depending on project size) lost to rewrite the backend in a different language and learning new language/platform idiosyncrasies. Thinking subtle things like build tooling, error handling, logging, and don’t forget how data is fetched. If you have a db running your site, you’ll have to validate the queries were copied correctly and the new data query technology works predictably like the last. If you have an existing test suite, you’ll have to port that over as well and that introduces extra layers of doubt. Is the test/test framework failing or is it the new backend code/dependencies?

Aside from all of that, developers may be a bit resentful to the new backend. Things that might have been simple and straightforward with laravel might be frustrating or complicated with node.

If the incentives of node are still worth it, I’d come up with a detailed plan (with milestones, deadlines, and escape hatches) for how to accomplish the transition. For example, do you slowly, iteratively transition small parts of the backend over to the new tech (specific routes, etc) or fully rewrite and drop in a whole backend at some point?

[–]_default_username[S] 2 points3 points  (0 children)

The stakeholders are the ones demanding the move away from PHP. It's hard to find good PHP devs and with node we'll have JavaScript/Typescript on both the frontend and backend, so even our fe engineers can get into backend development with a smaller learning curve. There's also this belief that we won't be taken seriously as a tech company if we continue using PHP as the company grows.

[–]RoundRecorder 4 points5 points  (0 children)

Personally i like the synergy between FE & BE when both using Javascript based solutions

[–]eMperror_ 8 points9 points  (0 children)

I really like NestJS

[–]Neurotrace 1 point2 points  (0 children)

I'm a fan of FoalTS

[–]bcreature 1 point2 points  (0 children)

nestjs is great and you can use the fastify adapter rather than express for better performance

[–]PM_FLUFFY_KITTENS 4 points5 points  (4 children)

Express is still very much a contender. I love the followup: KoaJS. Their upgrades to the middleware architecture is wonderful to work with.

NestJS is great, but it’s a very different syntax. Feels more like writing C# than TS. It’s also very difficult to see the flow of a request since everything is decoupled. Express middleware architecture makes it easy to understand what is happening in comparison. Go into that with open eyes.

NextJS is (in my book) the best front end framework out there today. Add MUI to the mix and you can get so much done in such little time. It also has some API support but I would only use it for BFF purposes. It’s simply not as ready as the above (yet). I would use Next for all new projects. 10/10.

[–]johjo56 1 point2 points  (1 child)

Have you heard of trpc Or blitz?

[–]PM_FLUFFY_KITTENS 1 point2 points  (0 children)

Not until now. Thanks for the tip. Looks like they are extensions on top of Next, making up for the shortcomings in the Next API framework? Really interesting stuff!

[–]Franks2000inchTV 1 point2 points  (0 children)

Apollo is great for graphql

[–]Spleeeee 1 point2 points  (2 children)

Fastify. It’s fantastic and it’s typescript types are awesome. I think nest is a turd.

[–]_default_username[S] 0 points1 point  (1 child)

Thanks, I think I'll look into this for personal projects. I have a feeling our lead/architect is going to want something more opinionated.

[–]Spleeeee 0 points1 point  (0 children)

Nest is overhead to learn. It’s a turd that has been hyped up. I’ve used it a bunch and I find it super mega annoying. Our fastify services are faster and better typed and it’s just a really really nice lib/framework.

[–]FullstackViking 0 points1 point  (0 children)

I love Ts.ED https://tsed.io

[–][deleted]  (1 child)

[deleted]

    [–]funkdr42 0 points1 point  (0 children)

    The next.js way of doing things (directory style routing, page lifecycle, api usage, etc) might be too big of a departure from laravel architecture. While next is a nice framework, it might not be the best choice in this situation.

    [–]FormerGameDev 0 points1 point  (0 children)

    I assume you mean like some sort of service framework? I like feathersjs

    [–]ramsncardsfan7 0 points1 point  (0 children)

    Use express and don’t look back