Feature: Use NestJS integration as SSR/http server #972
Replies: 23 comments
-
Hello, which adapter will use the implementation? It would be great if it could use the Fastify adapter by default. 😄 |
Beta Was this translation helpful? Give feedback.
-
It will be set up in a way where you can control the implementation. There will be an API "entry point" where you can add additional configuration to the NestJS/Fastify adapter. |
Beta Was this translation helpful? Give feedback.
-
Seems like this could be helpful: |
Beta Was this translation helpful? Give feedback.
-
Does anyone currently work on this? |
Beta Was this translation helpful? Give feedback.
-
@brandonroberts how should routing work with nest? Since nest has the concept of controllers which themselves have a path and methods inside of these controllers that can have their own path, I think it might be better to just require an app module inside the server folder and then let people define their own structure inside that folder however they please? |
Beta Was this translation helpful? Give feedback.
-
Yea, that's where I'm leaning also. Integrating with Nest would be more manual in some regards, because there's no file based routing, and developers would have more control over the server integration |
Beta Was this translation helpful? Give feedback.
-
@nhvu95 no one is working on this yet |
Beta Was this translation helpful? Give feedback.
-
@brandonroberts @nhvu95 I can spend some time on this if you are open to that |
Beta Was this translation helpful? Give feedback.
-
Haven't made too much progress unfortunately. I am running into issues with loadSSRModule trying to use the vite-plugin-node and more.
@brandonroberts just to confirm my overall understanding of what is going on is correct: Does that sounds about right? |
Beta Was this translation helpful? Give feedback.
-
Yes, that sounds right. Maybe we could start by providing an example repo the two working together as a starting point. No rush on this though as we already have a working server solution in Analog and the trpc integration |
Beta Was this translation helpful? Give feedback.
-
I am happy to help out on this issue. Who is coordinating the effort? |
Beta Was this translation helpful? Give feedback.
-
Hi @jeremylcarter . Basically the issue is that If you have further questions, I'd be happy to help. I also had a bit of a conversation about this on the analog discord inside the Contributing -> ideas channel. |
Beta Was this translation helpful? Give feedback.
-
Thanks! I'll have a look |
Beta Was this translation helpful? Give feedback.
-
@jeremylcarter Any update/progress on the nestjs integration? |
Beta Was this translation helpful? Give feedback.
-
Made some progress here with efforts from @cskiwi Able to serve/build the nestjs server along with the Analog app in this repo https://github.com/brandonroberts/nestjs-analog SSR support still needs work |
Beta Was this translation helpful? Give feedback.
-
@brandonroberts oh nice. I'll try and find some time to look at the SSR, unless you figured it out by then :) |
Beta Was this translation helpful? Give feedback.
-
@brandonroberts, been a bit busy. Any changes regarding the NestJS "integration". |
Beta Was this translation helpful? Give feedback.
-
Same here. No new movement on it as of late |
Beta Was this translation helpful? Give feedback.
-
Sorry everyone. I was planning on looking at this integration, but I got distracted by Dapr NestJS integration instead :) https://github.com/jeremylcarter/nest-dapr/tree/feature/actor What are the blockers for Analog + NestJS? |
Beta Was this translation helpful? Give feedback.
-
I made some progress that can be relevant, right now this is skipping the analog. So just having a NestJs + SSR and native angular. I think once I get it up and running it should be possible to port for analog.
UPDATE; got it all working without analog. will try to port it soon |
Beta Was this translation helpful? Give feedback.
-
@brandonroberts, @jeremylcarter So I finally got some time to work on it, but i'm on a strange roadblock which I can't figure out.
So I'm currently having 2 issues, 1) Analog is not a functionIf the
2) vite_dev_server is not a functionIf I remove the module type, then the non-analog project won't build with some ESM error, but the default analog project builds, the nestjs-analog project then gives me:
So here is where I'm currtly stuck. If anyone wants to have a look at it, feel free to clone the following repo to get going: https://github.com/cskiwi/analog-nestjs |
Beta Was this translation helpful? Give feedback.
-
For anybody wondering. I made some good progress running nestjs and angular as a single app (it's now running! ) This is starting from the template: https://github.com/cskiwi/angular-nestjs-vite
however when I build the project and then run the project with I tried lot's of things, but none worked:
As the analog community is a bit larger then one of it's dependencies, might be usefull to have this here. Because at one point someone might experience the same error (sorry if this is not allowed) |
Beta Was this translation helpful? Give feedback.
-
Update from my side. got a simple working example: https://github.com/cskiwi/angular-nestjs-starter |
Beta Was this translation helpful? Give feedback.
-
Which scope/s are relevant/related to the feature request?
platform
Information
NestJS is very popular Node.js framework for building APIs and is widely used in the Angular ecosystem. This feature would allow NestJS to be used as the server for the
/api
routes, and provided integration as the backend for SSR.Links:
In development, NestJS would be configured under the
/api
path. During the build it would host the Analog application and provide additional configured API routes.Describe any alternatives/workarounds you're currently using
No response
I would be willing to submit a PR to fix this issue
Beta Was this translation helpful? Give feedback.
All reactions