Structure React events on global config - reactjs

We are working on a new React application but I am a bit struggling on how to handle all these events. One of the requirements I have is that I need to be able to realtime update the application configuration.
I read this article which pushed me to some directions but I am still now 100% convinced: http://andrewhfarmer.com/component-communication/
For example:
I have a LoginForm component which, as it says, handles the login form. There are 2 configurable settings on this form:
Where is the endpoint for the webservice
Where should i redirect to once the login is ok
The question now is how should I structure that with the configuration. The configuration itself will be a JSON file hosted somewhere on the local filesystem and will be read every 5 minutes for example to check for changes. I can of course create a global eventemitter but is this really the way forward?
Other way around, do i need to keep passing all these small events down the pipe?
Hope that somebody can help me with some insights and maybe some good examples where it is handled in a proper way
Thanks alot

Related

How does it work when there are multiple users accessing a React web app?

I am learning React.js and new to web programming. All along when doing my own projects it's only for my own use, and hosted on localhost:3000. (i.e. one user).
I have a question about multiple users which I don't know if it's specific to React or just general web programming, but I can't seem to find it online, as perhaps it's too basic? And sorry if it's a very basic question. I will have to make an app for internal use for a team of less than 10 people soon, and it will be hosted on a local server accessible by this team.
Would the code be any different in terms of how I write this app? (say, it's just a todo list where users are able to add and remove items)
Specifically, how do states work when there are more than one user? Are they stored on the user's local device?
If one user clicks a button and sets some state from true to false for example, does it re-render for the other users too? Or do all users get their own instance of the app?
I would also appreciate it if you would know what kind of resources I should look at for this question, as I would like to read more in-depth about it.
well, all the apps run on each user own machine independently. State, actions and all other(whole app) are happening only one user own machine. So there is no interaction if I may say so out of the box between different machines(users). You may achieve that with help of some sockets connections( for example instant chat)

Make the admin dashboard in the right way

I use Yii2, ReactJS and Redux in my project. So, client side is good and beautiful, but current admin panel is the most ugly thing in the world (legacy). My goal is create new one.
How can I make admin dashboard using my stack?
My needs:
Modular structure
Individual structure of the state of each module
Write frontend fully on React and make it interactive (React Router?)
Not only CRUD. Some sections may be only informative, with some buttons and checkboxes. Or reports. Or for other purposes. (dont think that REST is only one thing that I need)
Don't wanna store all of DB records in the global redux state. But wanna load all records and other information by need (Depending on the page, sections, current state etc). And it should automatically clean off the state once I change page.
Maybe there's something else that I don't know yet..)
I need advice from professionals. Maybe articles or good libraries that can help me. I'll be very grateful.
P.S.This question is all about how to connect backend and frontend and keep state clean. Not about UX or UI
P.P.S. Sorry for my "Russian" English. Hope you'll understand me :)

Add databound dropdown to Azure API App logic app shape

I have developed an azure API app that I am using in a logic app. For the purpose of this post, it doesn't matter what my app does.
In my logic app shape (Azure API App) I have managed to render a drop down list by making one of my API post params an ENUM. Then changing the swagger / swashbuckle configuration to render the definition differently.
This is a good start but I really need a data driven drop down that reads it's data from a constantly changing data source (blobs, documentDB for example but it doesn't matter).
I can't find any posts on this.
All help will be greatly appreciated
Great question - we have on our backlog to support what we call "Dynamic Swagger" that lets you do just this. I'm hoping it will be in production near the beginning of March. In the meantime you will need to just enter in the values of those fields manually.

Share Angular2 Service across multiple windows

My website is built with Angular2. Imagine it as a big dashboard with a lot of modules. Sometimes information from multiple modules are required at the same time - therefore I want to allow my users to open a module in a new window. A real-world example for this is the video container of Hangout.
From my research there would be 2 ways to do this:
I open the route of the selected Ng-Component in a new window. As a result angular would reinit all services. To keep my data consistent I would need find a way to sync the instances. Maybe some kind of service that writes all attributes to localStorage?
This is somehow the way GoldenLayout implemented the Popouts.
I could init my component in window A and hide it - Now open a new window (B) and pass a copy (Css, HTML, Data) of my component to it. This would mean that I only need to sync the mirrored component, but I am not sure if this is good architecture.
Which way would you go to solve the described problem and are there more elegant solutions?

Setting up an Angular/Ionic Mobile Application with MongoDB

I was wondering if anyone could help me at all.
I posted a previous question in regards to this title but I didn't receive much of a response (probably due to lack of information).
I started out with an Ionic Application and built the view files using state URLS to navigate from page to page in the WWW folder. I've then created corresponding controllers for the view files, for basic calls and functionality that I want my app to do in the front-end via Ionic.
My question is how do I setup MongoDB + Mongoose so I can have access to the models I have created?
I have scoured the internet but to no avail, I mean I know there is no set way to define a model within this type of application but some general guidance would be really appreciated.
I understand that when building an application with Angular you're essentially building 2 applications, the front-end where your CSS, JS and HTML goes with the front-end frameworks on top of them.
Then the backend application that runs the server, stores data and runs the business logic. This is where I have created the User Schema model for my application and have inserted a document into my database via the MongoDB shell whilst running mongod.
However I also created a users.js in another models folder in my front-end where I'm returning a resource following a url with either a get, save, query, remove or delete.
First of all I would like to say I'm relatively new to building mobile applications so this may even be entirely wrong and secondly up to this point I get lost as to what to do in my application.
I have tried setting up an express server in my app.js file and I can connect to it via my terminal as it is listening on the port number, but in the browser it is coming up with cannot /GET.
If you need any more information please feel free to ask, I know I haven't really gone into any technicals, but I'm really not sure even if I'm asking the right questions to begin with.
Thank you in advance.

Resources