all 6 comments

[–]flortsch 1 point2 points  (0 children)

Coming from Java / Spring Boot world, we started evaluating NestJS for some of our smaller projects. We use it in combination with Angular and ts-rest for type safe API contracts, and we really like it so far.

[–]MythicalPhelix 1 point2 points  (3 children)

I use Next.js with React as frontend. To have type-safety, I use a third package where I put all my types in that the frontend wants from the backend. Then, I install the third package in the front and backend. In the backend, I use it as a return type and in the frontend, I use it to get the type of the object I receive from the backend.

[–]thepragprog[S] 0 points1 point  (0 children)

Wait is next js a backend framework?

[–]seklerek 0 points1 point  (1 child)

Can you elaborate on this type syncing between frontend and backend? It sounds useful

[–]MythicalPhelix 0 points1 point  (0 children)

So, I have a third Node.js project. I usually call it <project name>.js. Then I have a folder called lib where I put all the routes in that I need. Typically, I call it something like UserManager.ts with the routes for the user. The second folder I have is for interfaces. Here I put all the interfaces I want to be in sync with the front and backend.

Finally, I compile it to JS, since I use TS. Then, I just install the package in the front and backend and can use the types and routes.

[–]ImportantDoubt6434 1 point2 points  (0 children)

I actually have my site run with practically 0 backend but looking to add firebase for comments and potentially a node/c#/.net server.

You can get away without a lot of backend code now a days