polina-c / flutter-auth-ui

flutter-auth-ui is an authentication library for flutter web applications. It uses Firebase auth as security as a service (SECaaS) provider. It implements UI to register user, validate email, sign in, sign out, restore password, access firestore..
https://flatter-auth-ui-demo1.codemagic.app/#/
Apache License 2.0
57 stars 18 forks source link

Possible to use the Firebase/Firestore local emulator? #26

Closed MostHated closed 4 years ago

MostHated commented 4 years ago

Hey there, I am currently using this in a desktop application I have been working on (I tried to get several different libraries working on Windows and Linux, this is one of the few that worked. Not only did it work, but it also works great, big thanks for making it!). I wanted to work on making a few small serverless functions that were driven by database events and I saw there was ability to utilize a local Firestore emulator in which your app can connect and communicate. I tried to see if simply changing "databaseURL": "http://192.168.50.76:8080", in my faui config would do the trick, but having done that, my app still seemed to function the same.

Do you happen to have any recommendations of where I might have to make some changes in the codebase in order to connect to my emulated database for testing purposes, then I can just revert back to the original codebase once I have my serverless functions created?

If it helps any, this is what I was attempting to use as the basis to start with to at least see if I could even get my app to connect to a local emulator: https://github.com/firebase/quickstart-nodejs/tree/master/firestore-emulator/browser-quickstart I pretty much just fired it up so that the DB was running, then changed the config in my app.

Thanks, -MH

polina-c commented 4 years ago

Thank you for sharing this. Do you want to pull request README.md with this information?

MostHated commented 4 years ago

I am not sure I understand. I was asking how I might go about connecting fauidDbAccess to the Firebase emulator local test environment instead of: "databaseURL": "https://<myproject>.firebaseio.com",, as changing it to http://localhost:<port> didn't work for some reason. It still connected to my actual Firebase DB.

polina-c commented 4 years ago

Sorry, I did not get this. Unfortunately, I never worked with emulator.

I suggest to try to change value of const String _fbApiUrl = "https://firestore.googleapis.com/v1/"; in db_connector.dart.

If this work out, feel free to make pull request to make the url configurable.

MostHated commented 4 years ago

Thank you, I appreciate it. I will give that a try and see, and then go from there. 👍