How and where to add unleash-client for asp.net and node.js angular typescript application - node.js

I am trying to add https://github.com/Unleash/unleash-client-node to node js angular project. I am not a developer but just want integrate feature toggle in one of my projects. The application tech stack contains asp.net core, nodejs, angular and type script. What is the exact location(file) to configure the unleash-client so that I can see the application in the server. I have tried many ways and terribly failed due to my naive coding skills. Can some on give some more details on the integration.

Related

Do I need a Framework for Deploying a Postgres + Express + React + Node App

I am a new self-taught developer.
I have created a simple full stack app (learning management system) using PERN stack. Now, I want to deploy it to learn the end-to-end process of creating a web app. I have a plan to make incremental improvements in the app and add more functionality to make it usable.
While researching for deployment, I came across various posts that doesn't recommend using create-react-app for production ready React apps. Further, this official article from React recommends using some toolchains for deployment (I think it is another name for Frameworks or set of tools):
https://reactjs.org/docs/create-a-new-react-app.html
Another alternative is to optimize the code using Webpack etc. before deploying it. I am neither familiar with any React Framework nor much aware of performance optimization for PERN apps.
If I have to use a framework, then my existing code may not work. I may have to do complete review of the same to make it suitable for the framework.
What is the best way to deploy my PERN app which I can scale in the future. (I have partially understood the concept of client side and server side rendering. As of now, users have to login to use app. But in the future it will be like the users can see the page (to take advantage of SEO) but need to login in order to interact with the site).
Do I need to learn a framework? (In that case I may have to develop all the code in that framework to maintain compatibility). If this is the case, then I will be glad to know which one?
Or, is there other way to deploy fully-functional PERN apps ready to use by potential customers.
Eagerly looking for some answers as I am completely confused at this point.

asp.net core webapi with authentication (back-end) and react redux app(front-end) with authentication working independently

i need asp.netcore web api with authentication (ApplicationDbContext i.e.identity default database context ). i feel comfortable with visual studio as back-end.
2.i need react-redux app with authentication(front-end) working independently that start with "npm start". i feel good with vs code. on the front-end i want to add react-redux and redux-thunk to implement my course website front end. i have been in struggle for a week to achieve this.i tried with vs templates but when ever i install react-redux the user management fails and the client app does not start.tried, web application,api and web application with restful templates.
if someone have better idea to accomplish my task . my overall problem is to create a website that can present online courses.the teachers could add course material and student can access.
Try running npm install before your create-react-app script.
If that doesn't work, deleting "node_modules" folder and running npm install.
If that doesn't work, you can always try setting up your react environment manually (For example, as in this great tutorial here)
Worst-case, you can always use react just client-side only, and although this becomes difficult due to most online tutorials being server-side, at least you can get started and not be blocked on your project.
Source: I googled ;)

Best way to implement Angular Universal

I suffer a lot in the past with angular apps and social media, so I'm glad to see that Angular Universal is being developed.
Currently I have some apps that are Angular4 as front end, and Java with Spring as backend. As far as I know there are some ways to implement Angular Universal here but they seem pretty complex (at least is what I read). So I want to know if that is in that way or not...
But anyway, my main question here, is because I saw that in order to implement Angular Universal we should have (ideally) to make the backend with nodejs, how to structure these two technologies, I mean... Should I have Angular app as a frontend app and Nodejs app as a totally different backend app (just like Java) where both are connected with web services? Or should I served Angular4 SPA direcly from Nodejs views?
And where should I place Angular Universal here?
Now that Angular CLI v1.6 is out, there's native support for building Angular Universal into your projects easily using Node.js! Essentially, you would ng build --prod to create a dist/ folder, and then create a simple node back-end and connect to your dist/ folder containing your front-end code. This article gives a great step-by-step guide: Angular server-side rendering in Node with Express Universal Engine.
When you use Angular Universal, it is going to be a single process (Operating system process) that hosts and serves your Angular pages.
In production you may have multiple such processes behind a load-balancer.
Your back-end APIs (if developed in Javascript) may be hosted in the same Node server or in separate server.
The Angular Universal setup steps are detailed here in the official documentation.
However, I had a few wasted hours to find out the following point
Webpack 3 is not compatible with ts-loader versions higher than 3.5.0. At the time of developing this, the latest version of Angular CLI is 1.7.2 which uses Webpack 3.*. Hence, while setting up Angular Universal, install ts-config#3.5.0
Finally, here I have a seed project for Angular Universal. It uses Vagrant to locally setup the development environment. Also, by tweaking an environment variable in your local host machine, you can run it in a production mode in a Docker container. The steps to run it are detailed in the readme file.
If you refer to my Dockerfile in the above Github link, its entrypoint reads:
ENTRYPOINT ["pm2-runtime","start","/home/aus/dist/server.js"]
So, you see, it's just a singe command, and your app is up and running at port 4000. Of course you can use other command line parameters to provide memory limit, port and so on.

Do we need Node.js and Express.js while working with Angular2?

I built a sample web application using the following -
Angular 2
TypeScript
ASP.Net WebAPI 2
Mongo DB
Karma/Jasmine
Node.js (only as a server, just to the extent as specified in Angular2 Quick Start)
Considering the above tech stack do we have any need of using Node.js or Express.js for building a production web application? Is any of the above tech is replaceable with Node/Express, for better performance/memory utilization/code maintainability/faster development?
You'll need Node.js for development time tooling - for instance, TypeScript compiler and running Karma/Jasmine tests.
Regarding Express.js - you can do without it. An Angular 2 application does not rely on a back end framework. It could be served as static assets from a web server. Pick any back end framework that suits your needs.

Angular application requred node.js

I am going to create my first angular application. I have read lots of angular tutorial and many of them mentioned node.js.I am really got confused here.
Do we really need to install node.js and other dependencies to run angular application ?
Can't I just add respective angular libraries in my eclipse and create Angular application?
What are advantages of using node.js?
Also it is necessary to add all angular code is under App folder?
Regards,
Dip
As it is said on note.js website
Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.
So it depends if you want to have server logic (services) or not. If you are creating just the UI of the app you don't need note.js. Also Angular is NOT dependable on note.js

Resources