Going Full Stack Angular with NestJS
HTML-код
- Опубликовано: 8 сен 2024
- Combine your frontend and your backend into a single project with cohesive patterns by using NestJS. In this demo I show off adding NestJS to an existing Angular application and take advantage of their tooling to show off Server Side Rendering with a fully integrated frontend and backend.
Learn more about NestJS: nestjs.com
This is what I call the proper tutorial. This video should be the only guide for NestJS & Angular.
Oh ! I started playing with nestjs, and I love it, but this way of integration is just awesome ! Thanks a lot !
We've missed you Stephen...... Can you do videos regularly 😍
Very nice video! But we still waiting for a real world example detailed NestJS tutorial from you! Thx in advance!
Big tnx, i am waithing this for a long time!
Great! Thanks. It would be even greater to go deep inside the topic. Can you do a small app with data persistance and build for production tips?
For those of you who are getting error, try with `ng add @nestjs/ng-universal --clientProject=[your project name]`
This is amazing, thanks for introducing!
Woah. That’s really cool! Thanks for the vid
Mind. Blown.
Its simply amazing!!! :)
If you're using NPM, then use `npm run serve`
How to deploy nestjs to firebase cloud functions and angular app to firebase hosting ????...
yes, please real world nest - angular app tutorial!
i like it
Can you do a video on Nx + Angular + Nest + Mongo?
Can you please give a real world example of a use case for server-side rendered app with AJAX? Or the advantages of using this kind of stack?
Do you mean a server-side rendered SPA? The main benefits are SEO, social site bot support, and fast bootstrapping times and times to meaningful paint.
Hi, It's a great video as always.
Can you expalin maybe how to deploy this into firebase hosting and functions?
0:57 Just ignore the page full or warnings. You know, it works on my machine! 🤷♀️
How to run the app for production in this scenario using (PM2) ?
Any help please.
so each route needs to be created and controlled by a separate controller?
like having 50 routes+ ~ 50 controllers?
well if this integrated server is just for testing purpose then it is totally ok then.
if this can be a full back-end then I would love to see a detailed tutorial from you, because having the same angular structure when full-stack while maintaining SPA is a dream to be honest
In practice, you'd probably have controllers that are responsible for a group of related routes. If you were building a REST api you might have 'users' as the path for the controller, and each function in the controller would handle the various verbs and sub-routes as well. So GET users, GET users:/id, POST users/create, PATCH users/:id, PUT users/:id/thumbsup, etc, etc.
And obviously, every Angular route is handled & prerendered automatically (you don't have to create dedicated controllers for them)
@@kamilmysliwiec7394 Great work with NestJS.!!!
Interesting ... I must dabble...
Do you know if this Nx command would do the same integration ?
npx create-nx-workspace@next myapp --preset=full-stack
I did not test it already :)
How do you launch the front AND the back at the same time with NPM not YARN ?
npm run serve:ssr
is nest is alternative to express??
Hello please help me,
I am having issues by ng add @nestjg/ng-universal
Could not resolve dependency:
npm ERR! peer @angular/animations@"6.1.10" from @angular/platform-server@6.1.10
As soon as I start to add modules for nest my frontend doesnt get served anymore.. just blank html, no errors no nothing
it's not working on angular 12
I installed angular 8 and added nest js but issue is when I use route , it is redirected me to home page instead of /api/hello/ . Do I need to define route
Any chance you resolve this issue?
Make sure you have created your controller within the server folder when running the nest generate controller schematic
@@antonyserralta try running "npm serve" instead of "npm start". start only runs the front-end.
Not a natural couple. So better off decouple them. TypeScript is unified but to share classes between client and server is still weird. Then the benefit is more of a trap. They are together but they are really not
I found it pretty successful when using nx, made a library of classes that can be imported from a namespace, thus sharing them between client and server easily.
i like it