deepkit / deepkit-framework

A new full-featured and high-performance TypeScript framework
https://deepkit.io/
MIT License
3.14k stars 116 forks source link

Next.js working setup example #583

Open nanoander opened 1 week ago

nanoander commented 1 week ago

Hello, I spent hours trying to get deepkit working on a Next.js app (latest version) without success. Considering the huge popularity of Next.js, can you please provide an example app with the right setup?

Thank you very much.

marcj commented 1 week ago

@nanoander I assume NextJS doesn't use the official TypeScript compiler anymore, so it's not compatible. Also Next and Deepkit share very different architecture philosophies, NextJS uses globals and heavy conventions, while Deepkit dependency injection and SOLID code, so I'd recommend not to mix both as it will lead to unmaintainable spaghetti code. Generally the target audience of NextJS does not overlap at all with Deepkit's. One is targeted at beginners, the other is targeted at seniors (that come from Spring/Symfony). Mixing both means putting a Ferrari V12 engine into a Fiat Punto.

If you want to get a scaleable and fast backend with nice frontend/SSR, I recommend Deepkit+Angular 18 (zoneless). It's a dream team, but needs skill to handle it correctly.

kkimdev commented 18 hours ago

One datapoint: Our company uses Next.js for well maintained out-of-box features and productivity. We have been using gRPC-web with NextJS, but are interested in evaluating Deepkit RPC.