Offline Firebase stub - json

I've written a front-end application in Angular which communicates with a back-end application in NodeJS. The backend application talks to a Firebase instance to fetch/store/modify data. In some occasions, I need to run this backend offline (without a connection to the Internet), so I can't connect to Firebase.
Is there any (simple) way to create a stub (e.g. using the export JSON file from Firebase) that reads from and writes to this file, to emulate a Firebase instance? I've been looking on the Internet, and some people recommended MongoDB, but this would require quite a lot of modification to my code.

Yup. You can run a local firebase with firebase-server. It's worth noting it has some limitations (no Firebase auth, for instance) but that should be easier to stub.
You can read more on the firebase blog: https://www.firebase.com/blog/2015-04-24-end-to-end-testing-firebase-server.html

Related

Can Flutterflow app access MySQL database from my Google Cloud Instance?

I will create a mobile app for Android and iOS. The purpose of the app is to access just a segment of the MySQL database, that part is for customers (the rest of the database is used by employees via my web application).
Is there a way the for FlutterFlow app to access MySQL database instead of FireBase Storage? If not, what are the alternatives?
Though flutterflow has default integration with Firebase firestore database,
below 2 approaches can be used.
API integration approach can be used to use MYSQL database.
Please refer below flow:
You can have backend Server which will host the API.
This backend server will have integration with MYSQL DB
API's will be consumed in flutterflow app
https://docs.flutterflow.io/data-and-backend/api-calls
Custom code approach (Though have not used it before)
https://docs.flutterflow.io/customizing-your-app/manage-custom-code-in-github

Concept Confused : Cloud Interaction with Wordpress in GCP and APP with Spring

I'm quite new to wordpress and GCP, learning programming less than one year.
Now I'm writing a project using wordpress in GCP and mobile app in the frontend and MySQL in GCP and Spring Boot as server and controller.
In GCP, Wordpress, MySQL, Apache, etc are included and managed.
As you can see in the architecture I assume they will work, there is no need to send Rest API to spring boot and react to DB. I would like to know if I am right about the basic concept.
There is shared information in wordpress and app, for example, membership data.
In app, we send request to spring and spring reacts with DB in GCP, as wordpress acquires data from DB again, a new member info is loaded automatically in the frontend.
And in wordpress, request is sent to DB in GCP and Data is renewed. Once the app acquires data thru spring and DB, the new in is loaded.
I have the issue because the mentor said it is not usual practice for web to react directly with DB, and the co-workers insist establishing a connection between web and spring. Why?
The initial concept is to create a web and app that shares same database, but create different functionality, web for selling, app for interactive activities. We learned the basics in java, spring and web, but we are really unfamiliar with network concept.
(The frontend part and DB establishment are finished. We are working on the Server part.)
If there is any clarification or any suggestion to modify the whole procedure, it's well appreciated.
If there is any nothing I did not explain so well, I will try harder.

Delphi existing application connect to cloud

I have my application in Delphi with MySQL as a database. This is a Desktop application with local Database connected using ADO components.
I have another web application done in PHP and MYSQL.
I want to merge both databases and connect the Delphi application to the cloud MySQL database.
Do I need to put all my logic in PHP scripts and access them from Delphi?
How Delphi to cloud connection can be established?
You can use FireDAC to connect to a database located in the cloud, as soon as your provider allows that connectivity.
But exposing you database to the internet is not the best secure architecture. As you suggest yourself with naming it, a much better architecture is REST. The idea is to write server side software - could be PHP - to accept REST requests from a client, execute it (access the database) and send a reply to the client.
Today's, the REST requests are frequently using JSON to pass requests and receive replies. JSON is supported by Delphi. In short, this is an ASCII representation for object properties.
If accessing the database directly is what you really want, look at this video by Stephen Ball showing how to access an MS-SQL database on Azure cloud. This would be pretty well the same with mySQL.

Working with azure(mysql database) in node javascript with cloud API

I'm working with an API app on Azure by deploying an API written in NodeJs which stores data in MongoDb.
Make a new API for web & mobile apps from Azure portal.
Choose MongoDb by adding MongoLab module from Azure.
Create a table (collection) and populate it with few entries.
Prepare our Git repository from Azure portal and link it to our local Git on computers.
Decide which NodeJs modules to use to set the dependencies.
Edit the configuration file for NodeJs.
Make the main API file with the following functionalities:
Connection to the database.
Running the service.Making CRUD operation services (CREATE, READ,DELETE...)
Testing our API on a browser.
Making an application using our API
My question: how to use these steps to store data in mysql database(azure)?
I cannot fully understand your requirement, do you want to use the MySQL database to store your data in your API application in Node.js? If not, please clarify your purpose.
To implement connection to MySQL in Node.js, you can use some 3rd part MySQL handler modules.
For example:
node-mysql - A pure node.js JavaScript Client implementing the MySql protocol
or
Sequelize - A promise-based ORM for Node.js and io.js
Any further concern, please feel free to let me know.

Using a MySQL database on Windows Phone 7?

I'm attempting to write a Windows Phone 7 application which needs to connect to a remote data source, in this case it's a MySQL database on a Linux server. I'm not able to move this over to MSSQL, nor to build any kind of windows-based solution (like a WCF web service on the server).
Is there a way for me to use my MySQL database from my Windows Phone 7 application? The MySQL assemblies don't seem to work on the phone. If not, what would the best solution for me to use this database from the phone?
You could build your self a service which would send you json or xml. this can easily be built using mono, python, Ruby, php or any technology that you are comfortable with.
You can build it in a restful manner where all you have to do is call urls in a HTTP GET to retreive data which you handle with the services.
and use the HTTP POST to submit changes to your service.
you can then from WP7 make calls to this service and consume the data.
WP7 does not support sockets at the moment. So your best bet is transfering your payloads over HTTP.
As I mentioned before, if you have access to the machines configuration. You could run Mono which isn't too far off of .Net in terms of language and functionality.
further more, from the phone you can use the Rx library to make these calls Async and keep your application responsive.