added the emulator functionality for local development#105
Open
Nirvanjha2004 wants to merge 1 commit intoruxailab:mainfrom
Open
added the emulator functionality for local development#105Nirvanjha2004 wants to merge 1 commit intoruxailab:mainfrom
Nirvanjha2004 wants to merge 1 commit intoruxailab:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔧 Pull Request: Fix Firebase Firestore Emulator Connection
PR Summary
This PR fixes Firebase Firestore connection issues that prevented calibration data from being saved during development. The changes ensure proper emulator connectivity when
VUE_APP_USE_EMULATORS=true.Problem Statement
firebase.firestore is not a functionerrorVUE_APP_USE_EMULATORS=true, the app was connecting to production FirebaseSolution Overview
This PR implements a complete Firebase emulator setup for local development:
Changes Made
📁 src/main.js
📁 src/store/calibration.js
import axios from "axios"; import firebase from "firebase/app"; +import "firebase/firestore"; import router from "@/router";📁 firebase.json
{ "emulators": { + "firestore": { + "port": 8081 + }, "hosting": { "port": 8000 }, "ui": { - "enabled": true + "enabled": false } } }Technical Details
Why These Changes Were Needed
Port Selection
Environment Handling
Testing
Before Fix
# Console Errors TypeError: firebase.firestore is not a function FirebaseError: Missing or insufficient permissionsAfter Fix
Test Steps
firebase emulators:start --only firestorenpm run serveBreaking Changes
❌ None - This is a bug fix that maintains existing functionality
Backwards Compatibility
✅ Fully Compatible
VUE_APP_USE_EMULATORS=false)Performance Impact
🚀 Positive Impact
Security Considerations
🔒 Enhanced Security
Documentation Updates
📚 Developer Setup Instructions
Add to README.md:
Checklist
Related Issues
Fixes #104 - Firebase Firestore Connection Issues
Screenshots
Before (Error State)
After (Working State)
Deployment Notes
VUE_APP_USE_EMULATORS=falseReviewer Notes: