Access local filesystem from web browser (react) - reactjs

I am using this tool https://github.com/microsoft/VoTT. This tool is written in react/redux.
If the tool is running as web application, it does not have the option to access local file system (i.e., the computer that the browser is running). If the tool is running as an electron app, then the local system is accessible.
The question is more about how to allow the web app to access local file system.

You've answered yourself in the question. :)
As it stands today (October 2020), there is not a standard API to access the file system from a web browser without using an extended "browser" (like Electron). There is however a W3C Draft to add this capability to web browsers.

Related

Is Single Page Application needs a Application Server?

I'm new to SPA development, so this may be a stupid question. please understand.
My question is "Is SPA(Single Page Application) needs a Application Server?"
As I understand it, the SPA gets the response after calling REST API. It use that response to re-render.
If so, is the server that handles REST API "Application Server"?
So many posts say Application Server are tomcat, oracle, etc... and they are also say Application Server handle the request to access the database. Then what is "Application Server" in SPA? or there are no Application Server in SPA?
(Are there any architectures or systems I'm not aware of?)
If I'm misunderstanding the architecture, please let me know.
I want to understand web server and Application Server in SPA. So I have read many posts but I'm still confused.
Thanks.
A SPA needs one server to serve the SPA bundle to the users browser.
If the SPA interacts with an API or APIs, the API(s) could be hosted on the same server that served the SPA bundle, or they could be hosted on other servers.
A Single Page App requires a server to serve the .css, index.html, and .js files it requires. It is not a requirement that that an SPA must communicate with an application server via any means at all.
Your content can be static or self generated by the app itself. Should you require communication with a backend server, you can consume that via some sort of api over
protocols such as http, https, websockets or Server Side Events.
To summarize. An SPA can be completely self contained OR access an api to provide functionality. A standalone app requires a server only to serve the component files (.css, .js, .html) of the app itself.
With SPA as well you will have html file and images, js, css files that will be loaded when you launch your single html webpage. So you need to host this static content on some server. So it can be separate web server or same APIs
server(Application Server) which can host these static content and serve request for those files. It can be also hosted on cloud static server and distributed via CDN
Short answer:
Yes. SPA apps do need to live somewhere (as you need to host the assets (js, css, initial html, other)
Long Answer:
You need to setup somewhere to host the entry files as per the short answer. In the past I've used anything from:
NodeJS code base services running on a Docker container (app & assets being served via express), to
dotnetcore on a similar stack (With kestrel server serving the assets running on docker on ec2).
Docker container running Apache webserver hosting the statically compiled assets
More recently I've dabbled with compiling the SPA app to a bunch of static assets (such as the ability NextJS / Gatsby provides with their tooling, but there are tons of others or alternatives in other SPA worlds)... but even then you'll need to host those assets somewhere.
S3 on Amazon has the ability to host SPA apps directly via a bucket setting & providing an entry point
Vercel (...or any other SaaS alternatives, Vercel is just where I host my personal stuff and has been easy to get going)
Again it's all up to you, but yes, you still need to make the JavaScript available somehow, you just need to pick your mechanic. SaaS with a baked in WebServer such as Vercel, a CDN like S3 that AWS provides, or go totally custom and spin up your own WebServer as application entry.

Simple static website can interact with database?

Let's say that I would like to build a very simple website which retrives the content from a database but instead of building a dynamic site, which should be deployed in a VPS or a PaaS I want it to be static so it can easily run in any kind of web hosting.
Is that possible? Maybe using a CDN library like axios or jquery?
Thanks!
Since static Web pages contain fixed code, the content of each page does not change unless it is manually updated by the webmaster. So what you asked for is not a static website.
You need to use at least one server-side programming language (like PHP) to make a connection to a database.
And about compatibility, you don't need to look around VPS or PaaS at the start point, depended on your PL (programming language) and database you can choose your web hosting service from shared hosting providers, as your website growing and you learn more about the web stacks you can think about the dedicated host on VPS or use cloud service and ...

Service to update WPF application placed on server

I am developing a WPF application, which will be accessed from shared folder on server (Windows Server). My goal is to implement some mechanism of updating the app. The updater should be run on server probably as some kind of service. Which mechanism/technique would you recommended to use?
Based on your comment, I would look into using ClickOnce.
ClickOnce enables Web-style application deployment for non-Web
applications. Applications are published to and deployed from Web or
file servers.
https://msdn.microsoft.com/en-us/library/t71a733d(v=vs.140).aspx
You can also use Squirrel.
Squirrel: It's like ClickOnce but Works™
https://github.com/Squirrel/Squirrel.Windows

How to deploy website on live server?

I have created a website on angularJS. I have local server running using nodeJS. Can anyone please tell me the further process to deploy the website.
Your local server is probably only for development purposes.
You can deploy it as usual application. All you need is web server. The most common selection is Apache, nginx or IIS. You can set up one of these on your own (on your own computer/VPS etc.) or use web hosting (just google it...).
Selecting correct solution depends on budget, needed support and number of users. I assume that usual "cheap web hosting" is the best for you.

What is the relationship/differences between Google App Engine, and "normal" web apps?

I was trying to start to learn about programming on Firefox OS, and I heard that it is programmed with JavaScript and HTML5, and it uses the same structures of web apps.
Said that, I'm doing a course on Udacity ( I'm a beginner) that is about web development, and it talked about how to use the Google App Engine(we just made our own websites online, using python and some structures of the GAE), and I tryied to make some relationship with what I was seeing in the Firefox website, and I just coundn't figure out nothing.
Google App Engine is a "platform as a service model" of webapps. What you don't need is the key. You don't need :
a Database Administrator
Network technician
a Backup Admin (you still need to make backups of your app and data but not your network config files ect...)
the hardware at your company
the ISP service level agreements
there is more that Google specifically puts in over other platform as a service businesses.
Google takes care of this for you. You just write the webapp (and back it up for a rainy day)
As for Firefox OS, you build application, as you wrote, with HTML5, CSS3, and JavaScript: only web technology. Those are web applications that you build to run on Firefox OS devices, and even in the browser, depending on the API you used. The application you build https://developer.mozilla.org/en-US/Apps, can be either hosted on your own server, or if you packaged it, on the Firefox OS marketplace https://marketplace.firefox.com/.
I would also like to add that Google App Engine is a PaaS at the end of the day. So while technically, one can say that any web application should run, that is not always the case.
If you are using a PaaS, whether it is a Google App Engine or any others like Heroku, CloudFoundry, etc - you must understand the various Services and APIs that it provides in the different platforms that it supports. For e.g. using Google App Engine, you can choose either Java, Python or PHP to write and host your web applications. However, you have to use some of its services like Datastore, etc.
Moving any web application that you have written to a PaaS is not always straightforward. Except for the most simplistic apps that print a "Hello World", there are chances that you atleast have to do the following things:
Migrate parts of your application to utilize the Platform Services/APIs
Rearchitect parts of your application to take maximum advantage of the Cloud i.e. multi-tenancy, Scaling, etc.
You could treat Google App Engine(GAE) as web server hosting with specific web framework (python or java), which can host any normal webapps.
Firefox OS webapps are written with normal web skills. So you can use GAE to 'host' Firefox webapps.
(GAE is also mentioned as one of hosting place in Mozilla Developer Network
https://developer.mozilla.org/en-US/docs/Trash/Publishing_the_app )
The evil detail is Firefox webapp need an extra 'manifest.webapp' file that need extra MIME host settings
self.response.headers['Content-Type'] = 'application/x-web-app-manifest+json'
https://developer.mozilla.org/en-US/Apps/Developing/Manifest#Serving_manifests
Then you are ready to host Firefox Webapp on GAE :)

Resources