I am currently in the process of converting a dynamic Laravel-based web application into a PWA.
Specifically, I am trying to get the offline caching for my app to apply across the entire code structure.
Ultimately, if a user saves the app to their mobile device after logging in then they should be able to use all the pages/features offline with caching which typically involves creating objects using front-end forms, etc.
So far, I have installed the Composer package 'Laravel PWA' to my app which all works as expected.
However, the next step is to get offline mode working for every route of the app.
If someone could help point me in the right direction it would be greatly appreciated.
Related
im new here, lately i've tried to find a way to recreate a GUI for an application and still maintain his functionality.
Let's take SnapChat as example, i would redesing the application GUI but without editing that part of code that makes the application function.Im sorry if im not giving very specific explanations but i really don't know how to say it. Im really clueless on how to do so, and even if is possible in in the first place.
If someone could help me out it would be really apreaciate
So far i haven't tried anything bheside searching something online.
I believe you want to make a 'frontend' that looks like Snapchat and have it functioning like the real site. You will need to have a backend will all the features of Snapchat. Most websites on the internet have two parts to them - frontend and the backend. And most sites won't allow you to access their backend from other frontend for security reasons.
I personally don't use that site so I don't know about its features, but assuming it's a chat platform you will need user authentication and some way to store your messages.
You should start out with React or Vue.js, and work your way up to responsive sites like Snapchat.
A quick and easy solution would be to create an extension that changes the styling once the site loads on your machine so you don't have to code your own front-end.
I want to make a Firefox extension that can store and retrieve data from a database. However I've only been finding solutions that would work locally for each user. I'd like every user to have access to the same database.
Is that possible?
It is possible to access remote SQL databases like MySQL and PostgreSQL with node.js modules, but it is more sensible to create REST API front ends to your databases and call them from the extension. Exposing the SQL calls directly in your web extension is not a good idea. It is basically bad security practice and will expose your database to hackers.
You will also need your addon to pass Mozilla's approval process if you are going to distribute publicly and I doubt the reviewers will be pleased to see raw SQL calls in your extension's code.
The more sensible way is to update the database is through a REST API front end.
A simple example on how to create a REST API for a Postgres database can be found at Node.js, Express.js, and PostgreSQL: CRUD REST API example - LogRocket Blog and this playlist show how to create a REST interface in a Firefox extension - Build a Firefox Extension from Scratch that integrates with Node.js - DEV Community
The above database example is quite simple. For real world use you will need a more advanced REST framework for your API which sanitizes the data before inserting it into the databasse. You have more reading to do here.
However if you need to make SQL calls directly from your extension which I still don't advise, you can include some packages from node.js in your web extension, and use browserify which extracts and packages the modules needed into your extension. Your addons though had better be for private or in-house use, not for public distribution.
Some nodejs modules for database access are - https://github.com/mysqljs/mysql, https://node-postgres.com/ and https://www.npmjs.com/package/pg.
Just a little advice. Feel free to ignore it if you have nothing to do with it. Your question sounds quiet generic. You should learn and doing it by yourself first and only ask here when there are specific issues you're stuck with.
By "locally", I think you mean via Web SQL or IndexedDB. They're called local database and their behaviors are totally different from what you're looking for.
I should haven't need to tell you to do this. Just in case. Of course first thing first you need to know how website is working for both front end and back end, not just local stuff, especially how they're communicating between each other. So you should know about HTTP request, Javascript, and AJAX.
What has it to do with Firefox extension?. Not just Firefox, browser extension is just another type of web page that overlaying the opened web page in all kind of browser. In Firefox the opened page is called activeTabs. The only difference from regular web page is you need to signup your account first, manifest.json file as your project root file, and it compile from command line with web-ext tools. In case if you're facing Cross-origin resource sharing (CORS) restriction, follow instructions HERE and allow the URL on server side.
I host my app on the browser and I using a wrapper to load it on the mobile phone. I have huge problem with cashing data, anytime I make a change in the code, or different user log in I have to delete the app and install it again so I can see my changes. What should be done so I prevent caching .
I tried things that I read in this site about it but still I have the same issue.
I also save some data in the local storage browser
I'm building a Windows Phone 8 app that needs to get data from a website that was built on Joomla I believe.
Is it possible to create a Webservice that my app can consume?
Or is there a better way?
The Joomla version is 2.5.9 I believe
You will have to write a service layer in your CMS. Then data which are required for the android app will be exposed as a data service from your Joomla CMS. Please check the link for more info.
How to write a REST API?
Just in case you're not aware there is a range of critical bugs and exploits that have been fixed since 2.5.9. Your client should update to 2.5.16 ASAP as there is a well known exploit that can be used to effectively root the site in a matter of minutes.
After updating, you could look at the AJAX interface that Matt from Between Brain created for most versions of Joomla (it's actually part of the core from 3.2 onwards).
That would be the simplest way to get started as it provides a path in that can be authenticated etc and extending it to other non-core extensions is relatively trivial.
I'm continuing my research on solutions for our organization for our mobile app strategy. There's two somewhat conflicting requirements:
it should be a web app in that all updates for users are immediate as we update the app on the server
the app should leverage native UI widgets and native device features as much as possible
With PhoneGap, the process appears to be that you'd normally keep the UI on the device, as part of the compiled app, and you'd hit your server via AJAX to deal with the data updates and submissions. That then gives you access to the native device's UI widgets and features using the PhoneGap API into their hooks.
However, in doing that, we lose bullet point one.
My question is if one can, using PhoneGap, create a 'web view' within the app that would allow us to keep the UI on our server (the app then pretty much becomes a custom browser). And, if so, could our UI still access the device's native functionality via PhoneGap's API or is that only accessible if we compiled our UI code?
A similar question came up on the PhoneGap Google Group recently.
One thing that came up was that you are unlikely to pass app store certification if you are loading UI and core functionality from a remote server as this invalidates much of the purpose of certification.
If you're going to do this, you should set up web services that return the content you want to display to users. Then you can use jQuery Mobile and PhoneGap to take the content returned from the server and display it on the application with the appropriate native UI widgets and features that you want.
So use jQuery Mobile to hit your server for data using something like:
var fileUrl = "http://www.mywebserver.com/servedevice?data=current&selection=fresh";
$.ajax({
url: fileUrl,
dataType: "html",
success: function( html ) {
// If the call succeeds, do something with the return value here
}
});
There are many other ways you can handle it including JSONP methods. See the documentation for details:
http://api.jquery.com/jQuery.ajax/
Another approach would be to point your HTML file at a server for the JavaScript, just like a CDN file load. Then, your app's JavaScript would be loaded at runtime instead of bundled into the app. However, when it actually runs, it is running within the PhoneGap WebView so it has access to all of the PhoneGap APIs.
This is the jQuery Mobile example:
<script src="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.js"></script>