Big picture question

I’m new to Ionic and want to know if it will work for my requiremetns.

I have a very extensive web app already built in vanilla Javascript and using AWS Serverless technologies for the backend. I want to avoid having to rewrite much of the code to make it work as a mobile app if possible. It already works quite well on mobile browsers in both IOS and Android. So the reason for the mobile apps would be to 1) to add stability for background processes, particularly for websocket connections; 2) push notifications and 3) to incporate a couple native SDKs.

Here’s my question: Can I just run most of my web app in a webview where it would run pretty much just like it does on the web. The javascript code would be served on AWS servers, and the serverless databases etc would provide all of the data? Is that allowed, or would the javascript need to be stored (and thus updated on the mobile app regularly) in the mobile app itself?

And is there a way for code run externally (ie the javascript from web app) to communicate with javascript code I write for Ionic/Capacitor? For example, could the web app javascript send an event through the webview so that the local app code does something like make a connection to a server or websocket.

Hope that makes sense. Thanks in advance for any help,