Back End Options



  • I’m looking for someone I can have a conversation with about backend options.

    Specifically, I am learning Quasar in order to create an app for my wife’s gardening business. We have 4-5 gardeners each season, and I want them to interact with the app while they’re in the gardens. We also want to interact with it from the office via the web. So we need a web version, an iOS version, and an Android version, which is why I’m learning Quasar.

    The app will tell the gardeners which customer’s house to visit that day. It will help them map the location and provide GPS info to the gardens’ locations via Google Maps. It will supply information about the specific jobs and tasks they will do in the gardens, and it will provide a way for them to report back what it is that they ended up doing on the job site that day. It will include a built-in time clock for them to clock in and clock out. Since multiple gardeners can work on the same job site, the data must be easily sharable, and they need to be able to see what each other reported back about what they did on the job site. There will be an estimator page for our sales rep to use on the job-site to estimate for the customer in advance how much it will cost to get their job done. From this estimate, the app will produce work orders for the gardeners to use to know what work needs to be done and to report back. There will also be a schedule page for the staff to reference to see their own assigned tasks at a glance.

    Many have recommended Firebase for a back-end, but I don’t like it for three reasons.

    First, I plan to include customer information in the app, and I don’t want to give that info to Google or to anyone else. I need to keep that info private within our company.

    Second, the staff will be sharing access to the data, so a relational DB makes more sense to me.

    Third, I’m more familiar with PHP and MariaDB and have my own CentOS server.

    With the help of a great resource I found online, I have a simple set of PHP pages to serve as “middleware” for my app to interact with. I still need to create some security for these pages, including adding a login system, but I’ll get to that later. The web pages produce json output from the DB, which I presume I should be able to use in the app.

    I have three overall questions I’m trying to answer.

    The first has to do with the fact that the gardeners are often offline in the gardens we put them in, so the app definitely needs to be able to function offline.

    After doing a lot of research over the past three months, I’ve concluded that my best option is to store the day’s data locally in SQLite for when the gardeners aren’t close enough to a cell tower and then sync that data with MariaDB on my server whenever their phone is connected for data.

    So my first question is: does this overall approach make the most sense?

    I’m also having trouble finding a way to add SQLite to my Vue app. I’ve looked at the better-sqlite3, sqlite3, and sqlite libraries.

    Better-sqlite3 seems only to be written in C++ (with no references to how to make it work in a js framework despite the fact that its readme talks about working “in a javascript way”). It claims to be tons faster than the other two, so it would be great if I could use it. But I can’t figure out if there’s a way to do that.

    The other two appear to be javascript libraries, but I’m struggling with creating a boot file that will successfully load one of them.

    Finally, I’m trying to figure out what the best way is to sync the data between SQLite and MariaDB.

    Thanks in advance for any help.



  • @omgwalt said in Back End Options:

    So my first question is: does this overall approach make the most sense?

    client side:
    for the offline, shared, synced, peer to peer part there is something like:
    https://yjs.dev/

    it is backed locally by w3c standard - indexed db, so you do not need local sqlite.

    Instead of native app you can build a pwa app and have one codebase to maintain. It’s easier.

    server side:
    Big plus is that you can host your own stack. You should choose something you are familiar with or something you want to learn. I would prefer postgresql because it has a great support for json, tons of documentation and high performance libraries. As an webservice/api layer, I would recommend fastapi:
    https://fastapi.tiangolo.com/

    fastapi is surprisingly, excellent documented, productive, awesome API platform, with automatic OpenAPI docs generator. It is worth to know this. gl.



  • Suggest you look into “offline-first databases” if you have not already. I have no serious experience but have casually followed GunDb for a while and see there is also TurtleDb (amongst others I am sure). Perhaps another user can cast more light on these but GunDB is simple to get running and may serve your use case.



  • My thanks to both of you.


Log in to reply