mobile navigator for custom truck route - mobile

what mobile navigator are you using , who is able to accept custom made route for trucks with Here Maps?
Here Wego is not for commercial use and is not accepting multiple way points from the custom made route ,
Thank you!
made some tests with Here WeGo , but is not accepting multiple waypoints from the custom made route,

Related

Separating two different UI in react application

I want to build a react application where there will be two types of UI, one for admin and other for user. All the files included in header and footer will be separate. how can I achieve this?
Approach 1
Creating two separate application for admin and user like
example.com for user and admin.example.com
So that I can include all the css and js files of respective design in index.html
Approach 2
Integrating in one application where url will be example.com for user and example.com/admin for admin.
but then my question is where will the asset file will in included for both user and admin where the respective template will be created.
Please help and pardon me if the question framing is not correct.
The second approach looks better to me.
Where to include assets and where to create the template?
Have all the Components (admin + user components)in the Components folder, and in App.js, while defining the routing, provide components to routes accordingly. For example:
for path="/", it should provide component <UserHome/>
for path="/admin/", it should provide <AdminHome/>
Hope that answers your question.
Both these are equally good.
Would recommend method 2 if there is any common data or function between them

Dynamically generating site info based on the URL used to get there [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I am currently working on a contract site for a financial planning company.
For some context:
The site will allow their clients to sign up for the companies monthly webinars by making requests to an API for Webinarjam.com
The client side is a very simple one page site built with React. It includes info about the webinar, info about the presenter of the webinar and the form to sign up.
I have a simple proxy server (NodeJS(Express)) that makes the requests to the WebinarJam api on the back end. Along with a single table PostgreSQL DB that will save the attendees info for the company's reference. (name, email, phone, webinar attended, etc.)
The site is completely built and ready to be hosted and thus my question.
My question
The site will be used by 5 different presenters at the company. They would each like to have their own link and be able to send that link to their specific clients. All the other info on the page would remain the same (Same webinar, same things discussed) only the presenter would change.
So I'm wondering if there is a way to dynamically render the info on a site based on the link that was used to
get there?
When the site first renders a request is made to Webinarjam's API for info on a specific webinar using the webinar's ID. This returns an object with all of the info about the webinar INCLUDING the presenter(s) info. (All the info displayed on the site is dynamically rendered from the data returned from this request)
So in theory, could the link 'john.webinar.com' reroute to 'webinar.com' and the site would render John's info as the presenter?
(I am currently using Context API for global state management, I also am comfortable with Redux if it is applicable for something like this.)
Is there a way to dynamically render the info on a site based on the link that was used to get there?
Yes, absolutely! The react-router and qs packages can make this easier and cleaner, but here's a way just with DOM methods.
const query = new URLSearchParams(window.location.search);
const presenter = query.get("presenter");
The presenter variable will either be the string from the URL or null if the URL didn't include one.
export default function App() {
const query = new URLSearchParams(window.location.search);
const presenter = query.get("presenter");
return (
<div>
{presenter ? (
<h1>Presented By {presenter}</h1>
) : (
<h1>All Presentations</h1>
)}
</div>
);
}
If you go to mysite.com then it renders "All Presentations" but if you go to mysite.com/?presenter=John then it renders "Presented By John".
A path-based link like mysite.com/john can be set up with react-router-dom. If you want a subdomain like john.mysite.com then that requires additional configuration on your server (through .htaccess or similar).

How to deal with REST API calls in a multi-tenant application frontend in React?

I have a multi-tenant application separated in frontend(React) and backend(REST API made in Node.js). Each user can have their own subdomain, such as alice.example.com or bob.example.com, where the tenant is the first part of the URL. Each one of those custom pages have their own theme(just a primary color and a logo). You can access the API for a specific tenant through bob.example.com/api/v1, for example.
So far so good. But the problem is: How to deal with this in the frontend? When someone enters bob.example.com how will the React application know which specific theme to load from backend and make API calls only to bob.example.com/api/v1? Is it ok to make an API call everytime my page reloads to get theme colors and images? If so, how to get the tenant in frontend since React Router doesn't deals with subdomains?
Thanks in advance.
Here you can store colors value in redux specific to users. So that when ever you reload or when ever different user try to use the page then w.r.t user color theme can be shown.
Thankyou

Rendering Just one module/state of Angular app

I've angular app with lots of states and modules etc. Now, I want to send a link to the user. When user'll hit this url, I want to redirect him to a new tab rendering only that particular state (specified in URL) i-e I don't want anything else to be visible to the user. Or you can say, I want to open a popup window rendering that particular state's html in popup window . This is the approach that comes to my mind to sort it out.
Ps. There are Rest APIs at the backend which I am calling through angular resource service to bind data with the model of the views
Option
I've rest APIs on backend, So, I was thinking to developing s separate Nodejs application, And I will send nodejs application url to the user and in the default/home route I'll call backend API and, the returned resultset will be rendered in html file within nodeJs application and this way, I'll render the corresponding data to user's browser window.
This is the flow for that
I don't know if that is right or clever approach. Please suggest me what will be the best approach to sort it out.
Thanks in advance.
This is what my app looks like
Everything in the left side-nav is a module and clicking on this I am routing to a different state. I am using angular-material and lots of other dependencies in this project.
And this is what I want.
I'll refer a link to the user for example www.myapp.com/specificpage.html. And hitting this url, a new tab/popup will be opened rendering state defined in the same app but with some non-editable url. And it should like.
There are multiple ways to achieve this and each approach has advantage and disadvantage. You have to choose depending on requirement and architecture. Details are below-
Create a separate app - You can do it through separate code base or use the module based build process and include this module only for new app.
Divide application is two part, public pages and private pages - Include this page and required APIs for this page in the public modules for your app.
Send token in the link - If you want to make secure page, send short lived token in the eMail and validate token on the server before displaying page to the user.

Login form and dashboard with segments in AngularJS

I am pretty new to AngularJS and although I understand basic concepts (I also have years of experience in JS) this is a bit of problem to me.
I want a login form that opens a dashboard with multiple sections accessed from a lateral menu (or breadcrumb element)
For the login part I used some code from Angular Registration Login Example
but now I want to open the dashboard and enable the route segments (using http://angular-route-segment.com/) for the dashboard navigation menu. How would I go around this?
Can I do this in the dashboard's controller, create another module, or how should I separate login from dashboard?
Would I do it globally, in app.config for all routes and segments?
Maybe you know some examples I could use as reference. I guess this is something that you find in many applications

Resources