Is there any way to make my svelte web app to run locally on iOS? - node.js

I have developed an app using svelte and have uploaded it to a server. Since it contains private information, I cannot share the domain with other people. So basically, the web app should be private.
But if I want to make other people use my webapp, how can I do that?
In a PC, I can give them the source code and make them locally build their webapp on their localhost:3000 using npm-run dev.
How can I achieve this on a mobile device like Android or iOS?

You can use now.sh a.k.a. ZEIT / Vercel. Deploying your Github files is very easy.
https://vercel.com/guides/deploying-svelte-with-vercel?query=svelte
You can use this hosting for free with limitation of course.

Related

Can you easily explain the process of deploying ionic (based on react) apps with a node backend?

I recently started using react with a node server as a backend. I'm having problems to understand how to deploy such an app. I'm a beginner with ionic and deploying websites (or rather web based mobile apps) so I apologize if this is an easy/stupid question.
I searched a lot about this but my brain is still struggling to understand the deployment process. As I understand, any website have generally two parts, the frontend built with HTML/CSS/JS and the backend built with nodejs (in my case). If I want to run the app, I need to type npm start in the terminal right? so I'm only running the node server actually, where it will serve the HTML pages (static pages) depending on which url endpoint I wrote, right?
So deploying this is "easy" by copying the static files into a remote server and just run the nodeJs server to serve pages depending on the request, right. Therefore, is the start command here npm start, which will start the whole app.
I'm now using the ionic framework with react syntax and nodejs in the backend. There is a special command to run the ionic app (frontend), which is ionic serve. So if I run this the frontend will show up in the browser. Furthermore, I need to run the node server with npm start to handle requests. Therefore, to start my app, I need the ionic serve and npm start commands. How can this be deployed?
After some research, I read that I need to deploy the ionic app (frontend) and the backend separately. For example the ionic app would be a webapp and the server also a separate webapp (since I'm using MS Azure). The communication between them can be over rest API or web sockets as I understand. Is this the right approach to do this or there is a better/more clear way?
deploying two apps would mean that I need to pay for two apps on azure. Is there a way to minimize costs and have a functional app?
PS: generally, I'm having problems to understand the deployment process. I understand basically how the web works and I can build website on my machine but I'm not confident about my skills when it comes to deployment. Surprisingly, there is not much on the internet about it. Can someone please recommend articles, books or ideally videos that explain this process. Thank you in advance.
here is how you deploy ionic apps as pwa - https://ionicframework.com/docs/react/pwa
if you are using a node backend, the you would start the server same as you would normally, If I am understanding the question
Though your question is not specific to a particular issue but highlights a wide variety of issues, i will still try to explain it.
Ionic is primarily used for creating HYBRID/WEB MOBILE APPLICATIONS. Although you can deploy the code as a website too, but you will not be able to get any benefit out of using ionic for a website only and not using react as a standalone framework.
Be clear on your requirement, your question talks about website and web based mobile apps. Deploying a website and a hybrid mobile application is not one and the same thing. Websites are hosted on servers, mobile apps are deployed in app stores.
If you are not going to deploy to any mobile platform, i suggest you drop ionic and build your website with react.
Now coming to Ionic mobile apps, this is the flow
Create Ionic Project -> Build project for iOS/Android platform -> Deploy these apps to respective app stores
You will not host your Ionic mobile code on any hosting provider.
Your node.js backend code gets hosted on a hosting service. The endpoint URL will change to your hosted servers IP address.
Read about following topics first
What are hybrid mobile applications
What is Ionic
How to build mobile apps using Ionic
Publishing Mobile Applications
Deploying node.js to a cloud host

What type of web hosting do I need if I want to run a Node.js app

I want to build a web app with React for frontend and Node.js for backend. The problem comes when choosing the type of hosting I need. I know that for static files(eg. html with css and js) it's enough to have a standard web hosting, but if I want to have a server running Node.js app, do I need a dedicated server or VPS? Why?
I believe you can have either. Are you trying to do this professionally for a client or for a side project?
Personally, I use services like Heroku or Netlify (others here: https://blog.bitsrc.io/8-react-application-deployment-and-hosting-options-for-2019-ab4d668309fd). They run builds of node for your app and are free initially.
You can host your app and publish it for no cost at the beginning. However, on something like Heroku, if you don't pay, it takes 5 seconds for your website to wake up. But, this is great for prototyping. It gives you a URL so others can see it. They are basically version control systems that publish what you currently have. So you can just live push your project at any time and it updates your site.
If your prototype is working and you want it to be a fully dedicated app, then you can either pay or find services that host it. I would recommend prototyping first regardless and wouldn't pay until you need to.

Deploy Angular Universal to Shared Hosting without npm or node.js

I currently have access to an standard cPanel shared hosting, without SSH
I have an angular application running there https://www.rednots.com
However now I need the app to have server side rendering for Facebook share, I've been using Universal toolkit from https://github.com/maciejtreder/ng-toolkit and it works great in local
Now my issue is: can I deploy the Universal app the same way I've deployed the Angular client side app by uploading the dist folder? Do I need node.js installed in the server and run commands? Or is it any workaround so I don't need to use commands?
ng-toolkit is using lambda functions and api gateways to be used by the services.
Technically speaking you only need to deploy the dist folder and everything should work out of the box since you mentioned that you already tested it locally and it works which means that the lambda functions are already deployed and the services are pointing to AWS gateway properly.

Google Cloud as server for node.js

I want to create a node.js with express application that can host multiple clients with different domain names.
I have never created such application, so my question is:
If I have a project on my computer and want google (or some other hosting) to run my node application, how do I do it? Do I need to zip the whole project, and transfer it to the host? If not, how do Google know the front-end and back-end code?
If you just want to deploy your code, App Engine is the best option for you.
You can deploy your code there, and Google will manage how many instances will you need. For NodeJS, you can see a quickstart that will show you how to start here. You can deploy different services and map those services with different domain names.
There are examples on App Engine if you are using Express, and a tutorial that will show you how to organize your front-end and back-end in App Engine.

Can you convert MEAN applications with a compiler to App store?

As we all know you can use compilers as Cordova to convert web applications so you can upload your application to the app store.
This can easily be done when developing with HTML5 and Node.
But is it possible to convert a MEAN application (MongoDB, Express, Angular and Node)?
You can run nodejs server on mobile with jxcore, but I think you should run only client side part on cordova and api shall stay on server. Ideally, I think that api and client side must be separate projects.
No, you can't.
MEAN stack is full stack. You can make your frontend an app with cordova but you still need database and backend service.
But that's ok. Make your app mobile friendly and stick with your server to provide the data you need to make it work.
What you can do, it's to create hosted web app. This is existing web application, just wrapped to make it possible to submit to app store.
For this you can use Manfoldjs, for example Using Cordova Plugins in Hosted Web Apps or if you use Visual Studio, you can use Visual Studio Tools
for Apache Cordova.

Resources