From 3f7a8c81ef943c86625a3d84c94a6b51578cf8b7 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 11:55:36 +0000 Subject: [PATCH] Fix: Correct Firebase environment variable names This commit fixes an issue where the application would crash on startup due to incorrect environment variable names in the Firebase configuration. - Corrects `AUTHDOMAIN` to `AUTH_DOMAIN` in `src/firebase.js` for both development and production environments. - Updates `README.md` to document both development and production Firebase environment variables correctly. Fixes #38 --- README.md | 18 ++++++++++++++++-- src/firebase.js | 4 ++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c3c15a4..7af2cc4 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,19 @@ Ctrix Chat is a real-time chat application built with React and Firebase. It all * Create a new project on the [Firebase Console](https://console.firebase.google.com/). * Add a new web app to your Firebase project. * Copy your Firebase configuration. - * Create a `.env` file in the root of the project and add your Firebase config: + * Create a `.env` file in the root of the project and add your Firebase config. Make sure to use the correct variables for your environment (Development or Production). + + ### For Development + ``` + REACT_APP_FIREBASE_DEV_API_KEY=your-dev-api-key + REACT_APP_FIREBASE_DEV_AUTH_DOMAIN=your-dev-auth-domain + REACT_APP_FIREBASE_DEV_PROJECT_ID=your-dev-project-id + REACT_APP_FIREBASE_DEV_STORAGE_BUCKET=your-dev-storage-bucket + REACT_APP_FIREBASE_DEV_MESSAGING_SENDER_ID=your-dev-sender-id + REACT_APP_FIREBASE_DEV_APP_ID=your-dev-app-id + ``` + + ### For Production ``` REACT_APP_FIREBASE_API_KEY=your-api-key REACT_APP_FIREBASE_AUTH_DOMAIN=your-auth-domain @@ -63,9 +75,11 @@ Ctrix Chat is a real-time chat application built with React and Firebase. It all REACT_APP_FIREBASE_STORAGE_BUCKET=your-storage-bucket REACT_APP_FIREBASE_MESSAGING_SENDER_ID=your-sender-id REACT_APP_FIREBASE_APP_ID=your-app-id - REACT_APP_GIPHY_API_KEY=your-giphy-api-key ``` * You will also need to get a Giphy API key from the [Giphy Developer Portal](https://developers.giphy.com/). + ``` + REACT_APP_GIPHY_API_KEY=your-giphy-api-key + ``` 6. **Run the development server** ```sh diff --git a/src/firebase.js b/src/firebase.js index 72b4bb1..94b14cc 100644 --- a/src/firebase.js +++ b/src/firebase.js @@ -5,7 +5,7 @@ import { getAuth } from "firebase/auth"; const Development_Backend = { apiKey: process.env.REACT_APP_FIREBASE_DEV_API_KEY, - authDomain: process.env.REACT_APP_FIREBASE_DEV_AUTHDOMAIN, + authDomain: process.env.REACT_APP_FIREBASE_DEV_AUTH_DOMAIN, projectId: process.env.REACT_APP_FIREBASE_DEV_PROJECT_ID, storageBucket: process.env.REACT_APP_FIREBASE_DEV_STORAGE_BUCKET, messagingSenderId: process.env.REACT_APP_FIREBASE_DEV_MESSAGING_SENDER_ID, @@ -14,7 +14,7 @@ const Development_Backend = { const Production_Backend = { apiKey: process.env.REACT_APP_FIREBASE_API_KEY, - authDomain: process.env.REACT_APP_FIREBASE_AUTHDOMAIN, + authDomain: process.env.REACT_APP_FIREBASE_AUTH_DOMAIN, projectId: process.env.REACT_APP_FIREBASE_PROJECT_ID, storageBucket: process.env.REACT_APP_FIREBASE_STORAGE_BUCKET, messagingSenderId: process.env.REACT_APP_FIREBASE_MESSAGING_SENDER_ID,