I'm creating a web app for ticket reservation. The only problem is the database. I don't want to tell my client to install XAMPP or set a database, etc.
Is there any way to package the app with the database?
SQLite is a good option for a local database that you can ship with your application. It won't require the user to setup or install any extra dependencies. It's certainly not as full featured as a full on server, but it should be good enough for a local desktop app.
Electron will act as a wrapper for the existing web app without requiring any changes to the backend. Setting up Electron is easy for this type of app! There are no changes needed at the web app codebase level.
MongoDB is a fantastic NoSQL database with a lot of resources. In MongoDB, a record is a document, which is a data structure with field and value pairs. It has a straightforward API that is simple to incorporate into your Electron application.
If your electron app state is beyond what localStorage can manage, you need to bundle a database. NEDB is a mongo API compatible, file-based database. It’s a great fit for electron apps. In this post, I’ll walk through my NEDB setup. It’s fairly simple and is being used in production at HTTPSLocalhost app. nedb-promises is a wrapper around NEDB.
Databases - List of current supported databases. Download - Installers, binaries and source. Configuration - List of saved servers and custom configurations. Terminal - A terminal-based interface of Sqlectron. Contribute - Details on how you can contribute to Sqlectron. Something missing? Edit this app.
Thanks to Node.js you'll be able to access a lot of features to create awesome apps, in this case we are going to use the mysql module to access a MySQL database within Electron. To interoperate with MySQL (in our case, we are using Xampp which includes PHPMyAdmin) using Node.js, you'll need the following node package named mysql.
SQLite is a good option for a local database that you can ship with your application. It won't require the user to setup or install any extra dependencies. It's certainly not as full featured as a full on server, but it should be good enough for a local desktop app.
There are many standalone databases you can use with JavaScript and Electron applications. Here are some that I can recommend
https://github.com/louischatriot/nedb (last release 4 years ago)
https://github.com/pubkey/rxdb (many features, observable queries)
https://github.com/pouchdb/pouchdb (many open issues)
https://github.com/techfort/LokiJS (only in-memory storage)
https://github.com/typicode/lowdb (good for simple, small datasets)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With